JP2009199175A - Program dividing device and method thereof - Google Patents

Program dividing device and method thereof Download PDF

Info

Publication number
JP2009199175A
JP2009199175A JP2008037825A JP2008037825A JP2009199175A JP 2009199175 A JP2009199175 A JP 2009199175A JP 2008037825 A JP2008037825 A JP 2008037825A JP 2008037825 A JP2008037825 A JP 2008037825A JP 2009199175 A JP2009199175 A JP 2009199175A
Authority
JP
Japan
Prior art keywords
program
unit
end position
division
data amount
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.)
Granted
Application number
JP2008037825A
Other languages
Japanese (ja)
Other versions
JP5197061B2 (en
Inventor
Katsunori Hirase
勝典 平瀬
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.)
Sanyo Electric Co Ltd
Original Assignee
Sanyo Electric Co Ltd
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 Sanyo Electric Co Ltd filed Critical Sanyo Electric Co Ltd
Priority to JP2008037825A priority Critical patent/JP5197061B2/en
Publication of JP2009199175A publication Critical patent/JP2009199175A/en
Application granted granted Critical
Publication of JP5197061B2 publication Critical patent/JP5197061B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To solve the problem that dividing a program manually is cumbersome. <P>SOLUTION: An object data volume retaining part 10 retains a reference object data volume as a reference data volume. An end position setting part 14 determines a temporary end position of a division program starting at a start position specified by the division start position information detected by a start position information detection part 12. A conversion direction part 20 directs a predetermined compiler 200 to compile a temporary division program defined by the start position and the temporary end position determined by the end position setting part 14. A conversion result acquisition part 22 acquires an object data volume corresponding to the result of the conversion by the compiler 200 according to the direction by the conversion direction part 20 as an acquired data volume. A control part 24 compares the reference data volume retained by the object data volume retaining part 10 with the acquired data volume acquired by the conversion result acquisition part 22, and controls the end position setting part 14 according to the comparison result. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、プログラムを分割するためのプログラム分割装置および分割方法に関する。   The present invention relates to a program dividing apparatus and a dividing method for dividing a program.

近年、マルチスレッドを活用したプログラミングが盛んである。マルチスレッドとは、一つのアプリケーションを複数のスレッドに分割し、プロセッサに並行して処理させる手法である。処理時間を非常に短い単位に分割し、複数のスレッドに順番に処理することによって、シングルコアのプロセッサでも複数の処理を同時に行っているようにみせることができる。   In recent years, programming utilizing multi-threading has become popular. Multithreading is a technique in which one application is divided into a plurality of threads and processed in parallel by a processor. By dividing the processing time into very short units and processing them in order to a plurality of threads, it is possible to make a single core processor seem to perform a plurality of processes simultaneously.

ソースプログラムをスレッドに分割して時分割処理する場合、好適に分割しないとリアルタイム性がそこなわれてしまう。また、マルチコアのプロセッサでもコアの数より多いスレッドを同時に処理する場合、同様である。   When the source program is divided into threads and processed in a time-sharing manner, the real-time property is impaired unless it is divided appropriately. The same applies when a multi-core processor simultaneously processes more threads than the number of cores.

回路構成が動的に変更可能なリコンフィギュラブルプロセッサを用いる場合、その分割位置を求めるのに多くの作業量を要する。リコンフィギュラブルプロセッサは、ALU(Arithmetic Logic Unit)と呼ばれる基本演算機能を複数持つ多機能素子を多段に並べたALUアレイを備える。リコンフィギュラブルプロセッサでは、ソースプログラムの記述から、その記述を実行する場合に必要な実行ステップ数を推測することが難しいため、好適な分割位置を簡単に求めることができない。   When a reconfigurable processor whose circuit configuration can be dynamically changed is used, a large amount of work is required to obtain the division position. The reconfigurable processor includes an ALU array in which multi-functional elements having a plurality of basic arithmetic functions called ALU (Arithmetic Logic Unit) are arranged in multiple stages. In a reconfigurable processor, it is difficult to estimate the number of execution steps necessary for executing the description from the description of the source program, and thus a suitable division position cannot be easily obtained.

出願人は、リコンフィギュラブルプロセッサに実行させるべきソースプログラムをトライ&エラーで分割していた。すなわち、ソースプログラムを手作業で分割し、その分割プログラムをコンパイルして実行ステップ数を取得し、その実行ステップ数をもとに次の分割位置を決めるという作業を、取得された実行ステップ数が所定の最大実行ステップ数に収まる最大になるまで繰り返していた。   The applicant divided the source program to be executed by the reconfigurable processor by trial and error. That is, dividing the source program manually, compiling the divided program to obtain the number of execution steps, and determining the next division position based on the number of execution steps, the acquired number of execution steps is The process was repeated until the maximum number of execution steps was reached.

特許文献2は、処理ブロックをGUI操作で組み合わせてプログラミングを行う組み込み用プログラム生成方法を開示する。この方法は、処理ブロックに関するライブラリ情報を基にして、生成されるプログラムが必要とするハードウエア資源データ、プログラム容量、及びサイクル数を算出し、生成されるプログラムが一つのプロセッサの性能を超えるものである場合、並列又は直列に接続される複数のプロセッサに分けてソースプログラムを生成する。
特開2006−4345号公報 特開2007−80049号公報
Patent Document 2 discloses a method for generating an embedded program that performs programming by combining processing blocks through GUI operations. This method calculates the hardware resource data, program capacity, and number of cycles required for the generated program based on the library information about the processing block, and the generated program exceeds the performance of one processor. In this case, the source program is generated separately for a plurality of processors connected in parallel or in series.
JP 2006-4345 A JP 2007-80049 A

上述したような手作業による分割は煩雑であり、アプリケーションの開発効率を低下させていた。本発明はこうした状況に鑑みなされたものであり、その目的は、簡単にソースプログラムを好適な位置で分割することができるプログラム分割装置および方法を提供することにある。   The manual division as described above is complicated and reduces the development efficiency of the application. The present invention has been made in view of such circumstances, and an object of the present invention is to provide a program dividing apparatus and method capable of easily dividing a source program at a suitable position.

本発明のある態様のプログラム分割装置は、ソースプログラムを分割するプログラム分割装置であって、基準とすべきオブジェクトデータ量を基準データ量として保持するオブジェクトデータ量保持部と、ソースプログラム内から分割開始位置情報を検出する開始位置情報検出部と、開始位置情報検出部により検出された分割開始位置情報で特定される開始位置から始まる分割プログラムの暫定終了位置を定める終了位置設定部と、開始位置と、終了位置設定部により定められる暫定終了位置とで規定される仮分割プログラムをコンパイルするよう所定のコンパイラに指示する変換指示部と、変換指示部による指示に応じた、コンパイラの変換結果に対応するオブジェクトデータ量を取得データ量として取得する変換結果取得部と、オブジェクトデータ量保持部により保持される基準データ量と、変換結果取得部により取得される取得データ量とを比較し、その比較結果に応じて終了位置設定部を制御する制御部と、を備える。制御部は、基準データ量と取得データ量とが一致または近づくように暫定終了位置を変更するよう、終了位置設定部を制御する。   A program dividing apparatus according to an aspect of the present invention is a program dividing apparatus that divides a source program, an object data amount holding unit that holds a reference object data amount as a reference data amount, and a division start from within the source program A start position information detecting unit for detecting position information, an end position setting unit for determining a provisional end position of a divided program starting from a start position specified by the division start position information detected by the start position information detecting unit, and a start position A conversion instruction unit that instructs a predetermined compiler to compile a provisional divided program defined by the provisional end position determined by the end position setting unit, and a conversion result of the compiler according to the instruction by the conversion instruction unit A conversion result acquisition unit that acquires the object data amount as an acquisition data amount; and an object Comprises a reference amount of data held by Todeta amount holding unit, the conversion result is compared with the acquired amount of data acquired by the acquisition unit, and a control unit for controlling the end position setting unit according to the comparison result. The control unit controls the end position setting unit to change the provisional end position so that the reference data amount and the acquired data amount match or approach each other.

本発明のさらに別の態様は、プログラム分割装置である。この装置は、ソースプログラムを分割するプログラム分割装置であって、ソースプログラム内から分割開始位置情報を検出する開始位置情報検出部と、ソースプログラム内から分割終了位置情報を検出する終了位置情報検出部と、開始位置情報検出部により検出された分割開始位置情報で特定される開始位置と、終了位置情報検出部により検出された分割終了位置情報で特定される終了位置とで規定される分割プログラムをコンパイルするよう所定のコンパイラに指示する変換指示部と、変換指示部による指示に応じた、コンパイラの変換結果を取得する変換結果取得部と、を備える。   Yet another embodiment of the present invention is a program dividing device. This apparatus is a program dividing apparatus that divides a source program, and includes a start position information detection unit that detects division start position information from within the source program, and an end position information detection unit that detects division end position information from within the source program. And a division program defined by the start position specified by the division start position information detected by the start position information detection unit and the end position specified by the division end position information detected by the end position information detection unit A conversion instruction unit that instructs a predetermined compiler to compile, and a conversion result acquisition unit that acquires a conversion result of the compiler according to an instruction from the conversion instruction unit.

なお、以上の構成要素の任意の組み合わせ、本発明の表現を方法、装置、システム、記録媒体、コンピュータプログラムなどの間で変換したものもまた、本発明の態様として有効である。   It should be noted that any combination of the above-described constituent elements and a conversion of the expression of the present invention between a method, an apparatus, a system, a recording medium, a computer program, and the like are also effective as an aspect of the present invention.

本発明によれば、簡単にソースプログラムを好適な位置で分割することができる。   According to the present invention, a source program can be easily divided at a suitable position.

図1は、実施の形態1に係る情報処理システム300の構成を示すブロック図である。情報処理システム300は、プログラム分割装置100およびコンパイラ200を備える。プログラム分割装置100は、オブジェクトデータ量保持部10、開始位置情報検出部12、終了位置設定部14、仮分割プログラム登録部16、仮分割プログラム保持部18、変換指示部20、変換結果取得部22および制御部24を含む。   FIG. 1 is a block diagram illustrating a configuration of an information processing system 300 according to the first embodiment. The information processing system 300 includes a program dividing device 100 and a compiler 200. The program dividing apparatus 100 includes an object data amount holding unit 10, a start position information detecting unit 12, an end position setting unit 14, a temporary divided program registration unit 16, a temporary divided program holding unit 18, a conversion instruction unit 20, and a conversion result acquisition unit 22. And a control unit 24.

これらの構成は、ハードウェア的には、任意のコンピュータのCPU、メモリ、その他のLSIで実現でき、ソフトウェア的にはメモリにロードされたプログラムなどによって実現されるが、ここではそれらの連携によって実現される機能ブロックを描いている。したがって、これらの機能ブロックがハードウェアのみ、ソフトウェアのみ、またはそれらの組み合わせによっていろいろな形で実現できることは、当業者には理解されるところである。   These configurations can be realized in terms of hardware by a CPU, memory, or other LSI of an arbitrary computer, and in terms of software, they are realized by programs loaded in the memory. Draw functional blocks. Therefore, those skilled in the art will understand that these functional blocks can be realized in various forms by hardware only, software only, or a combination thereof.

オブジェクトデータ量保持部10は、基準とすべきオブジェクトデータ量を基準データ量として保持する。基準とすべきオブジェクトデータ量は、プロセッサの単位時間当たりの実行ステップ数、または使用メモリサイズで規定されるオブジェクトデータ量であってもよい。より具体的には、プロセッサの単位時間当たりに実行可能な最大実行ステップ数、または使用可能な最大メモリ領域であってもよい。   The object data amount holding unit 10 holds the object data amount to be used as a reference as a reference data amount. The amount of object data to be used as a reference may be the number of execution steps per unit time of the processor or the amount of object data defined by the used memory size. More specifically, it may be the maximum number of execution steps that can be executed per unit time of the processor, or the maximum memory area that can be used.

また、基準とすべきオブジェクトデータ量は、y(yは2以上の整数)個の演算器を含む演算器列で、またはx×y(x、yは2以上の整数)で二次元配置された複数の演算器を含む演算アレイで、m(mは自然数)サイクルに実行可能なステップ数で規定されるオブジェクトデータ量であってもよい。とくに後者は、リコンフィギュラブルプロセッサを用いる場合に適用可能な基準である。この詳細は後述する。   The amount of object data to be used as a reference is an arithmetic unit array including y (y is an integer of 2 or more) arithmetic units, or two-dimensionally arranged in x × y (x and y are integers of 2 or more). Further, it may be an object data amount defined by the number of steps that can be executed in m (m is a natural number) cycles in an arithmetic array including a plurality of arithmetic units. In particular, the latter is a standard that can be applied when a reconfigurable processor is used. Details of this will be described later.

開始位置情報検出部12は、ソースプログラム内から分割開始位置情報を検出する。このソースプログラムはC言語などの高級言語で記述されており、分割を開始すべき位置に分割開始位置情報が付加されている。分割開始位置情報は、プログラムなどによりコメントとして埋め込まれる。また、本プログラム分割装置100が統合開発環境下のGUI操作のツールとして実装される場合、分割開始位置情報をマウス操作などで付加するようにしてもよい。分割開始位置情報は、意味的または機能的にまとまった単位演算処理を記述した部分の、実質的な処理が開始される行に付加されることが多い。この単位演算処理はサブルーチンまたは関数ととらえてもよい。   The start position information detection unit 12 detects division start position information from within the source program. This source program is described in a high-level language such as C language, and division start position information is added to a position where division is to start. The division start position information is embedded as a comment by a program or the like. Further, when the program dividing apparatus 100 is implemented as a GUI operation tool in an integrated development environment, division start position information may be added by a mouse operation or the like. In many cases, the division start position information is added to a line where a substantial process is started in a portion describing a unit operation process that is semantically or functionally grouped. This unit calculation process may be regarded as a subroutine or a function.

終了位置設定部14は、開始位置情報検出部12により検出された分割開始位置情報で特定される開始位置から始まる分割プログラムの暫定終了位置を定める。実施の形態1の基本例では、ソースプログラム内において分割開始位置情報で特定される開始位置に対し、所定の行数進んだ行を暫定終了位置の初期値とする。たとえば、一行進んだ行であってもよい。以下、この暫定終了位置を制御部24からの指示により変更する。なお、この暫定終了位置は上記開始位置を含む単位演算処理の最終行を超えることはない。   The end position setting unit 14 determines a provisional end position of the division program starting from the start position specified by the division start position information detected by the start position information detection unit 12. In the basic example of the first embodiment, a line advanced by a predetermined number of lines from the start position specified by the division start position information in the source program is set as the initial value of the provisional end position. For example, it may be a line advanced by one line. Hereinafter, the provisional end position is changed by an instruction from the control unit 24. The provisional end position does not exceed the last line of the unit calculation process including the start position.

仮分割プログラム登録部16は、仮分割プログラム保持部18に仮分割プログラムを登録する。仮分割プログラムを登録する際、開始位置を含む単位演算処理のうち、開始位置と暫定終了位置とで規定された部分以外の記述は削除する。その単位演算処理の前後の記述であって、その仮分割プログラムでは実行されない関数など、不要な記述は、コンパイラ200によりコンパイルされる際に削除されるため、ここで削除する必要はない。ただし、後述するシーケンサの指定など残しておくべき動作補助用コメントは、コンパイラ200に削除されないよう削除禁止の識別情報を付しておく必要がある。   The temporary division program registration unit 16 registers the temporary division program in the temporary division program holding unit 18. When registering the temporary division program, descriptions other than those defined by the start position and the provisional end position are deleted from the unit calculation processing including the start position. Descriptions before and after the unit operation processing and unnecessary descriptions such as functions that are not executed in the provisional division program are deleted when compiled by the compiler 200, and therefore need not be deleted here. However, it is necessary to attach deletion-prohibited identification information to the compiler 200 so that the comment for operation assistance that should be left, such as designation of a sequencer to be described later, is not deleted.

仮分割プログラム登録部16は、暫定終了位置が変更されるたびに仮分割プログラムを登録する。暫定終了位置が変更される場合でも、制御部24から登録する必要がない旨の指示があった場合、登録しない。   The temporary division program registration unit 16 registers the temporary division program every time the temporary end position is changed. Even when the provisional end position is changed, if there is an instruction from the control unit 24 that it is not necessary to register, registration is not performed.

仮分割プログラム保持部18は、仮分割プログラム登録部16により登録される仮分割プログラムを保持する。仮分割プログラム登録部16により登録される、すべての仮分割プログラムを保持してもよいし、直近に登録された仮分割プログラムのみを保持し、先に登録された仮分割プログラムは削除してもよい。   The temporary division program holding unit 18 holds the temporary division program registered by the temporary division program registration unit 16. All temporary division programs registered by the temporary division program registration unit 16 may be held, or only the most recently registered temporary division program may be held, and the previously registered temporary division program may be deleted. Good.

変換指示部20は、上記開始位置と、終了位置設定部14により定められる暫定終了位置とで規定される仮分割プログラムをコンパイルするよう所定のコンパイラ200に指示する。コンパイラ200に渡すべきデータは、仮分割プログラム登録部16が仮分割プログラム保持部18に渡すデータと同じでよい。   The conversion instruction unit 20 instructs a predetermined compiler 200 to compile a provisional division program defined by the start position and the provisional end position determined by the end position setting unit 14. The data to be passed to the compiler 200 may be the same as the data that the temporary divided program registration unit 16 passes to the temporary divided program holding unit 18.

変換指示部20は、暫定終了位置が変更されるたび、仮分割プログラムの変換をコンパイラ200に指示する。暫定終了位置が変更される場合でも、制御部24から、コンパイラ200にコンパイルを指示する必要がない旨の指示があった場合、コンパイラ200に指示しない。   The conversion instruction unit 20 instructs the compiler 200 to convert the temporary divided program every time the provisional end position is changed. Even when the provisional end position is changed, if the control unit 24 instructs the compiler 200 not to instruct compilation, the compiler 200 is not instructed.

変換結果取得部22は、変換指示部20による指示に応じた、コンパイラ200の変換結果に対応するオブジェクトデータ量を取得データ量として取得する。変換結果取得部22は、当該取得データ量を上記基準データ量と同様の形式、たとえばプロセッサの実行ステップ数で取得してもよいし、取得したオブジェクトファイルから実行ステップ数を特定してもよい。   The conversion result acquisition unit 22 acquires the object data amount corresponding to the conversion result of the compiler 200 in accordance with the instruction from the conversion instruction unit 20 as the acquisition data amount. The conversion result acquisition unit 22 may acquire the acquired data amount in the same format as the reference data amount, for example, the number of execution steps of the processor, or may specify the number of execution steps from the acquired object file.

制御部24は、オブジェクトデータ量保持部10により保持される基準データ量と、変換結果取得部22により取得される取得データ量とを比較し、その比較結果に応じて終了位置設定部14を制御する。制御部24は、基準データ量と取得データ量とが一致または近づくように暫定終了位置を変更するよう、終了位置設定部14を制御する。例外的に、仮分割プログラムが開始位置を含む単位演算処理のすべてを含み、かつその仮分割プログラムの変換結果であるところの取得データ量が基準データ量より小さい場合、両データ量の差を近づけようとせずに、その仮分割プログラムを正式な分割プログラムとする。   The control unit 24 compares the reference data amount held by the object data amount holding unit 10 with the acquired data amount acquired by the conversion result acquisition unit 22, and controls the end position setting unit 14 according to the comparison result. To do. The control unit 24 controls the end position setting unit 14 to change the provisional end position so that the reference data amount and the acquired data amount match or approach each other. Exceptionally, if the provisional division program includes all unit operation processing including the start position, and the acquired data amount that is the conversion result of the provisional division program is smaller than the reference data amount, the difference between the two data amounts is brought closer. Instead, the temporary division program is made an official division program.

以下、より具体的に説明する。制御部24は、取得データ量が基準データ量未満であり、かつ暫定終了位置が、開始位置を含む単位演算処理の最後に到達していないとき、暫定終了位置をn(nは自然数)行、進めるよう終了位置設定部14に指示する。制御部24は、取得データ量が基準データ量を超えたとき、仮分割プログラム保持部18に超える前の最後に登録された仮分割プログラムを正式な分割プログラムとする。制御部24は、取得データ量と基準データ量とが一致したとき、そのときの仮分割プログラムを正式な分割プログラムとする。暫定終了位置が単位演算処理の最後に到達したときも、そのときの仮分割プログラムを正式な分割プログラムとする。   More specific description will be given below. When the acquired data amount is less than the reference data amount and the provisional end position has not reached the end of the unit calculation process including the start position, the control unit 24 sets the provisional end position to n (n is a natural number) rows, The end position setting unit 14 is instructed to proceed. When the acquired data amount exceeds the reference data amount, the control unit 24 sets the temporary divided program registered last before exceeding the temporary divided program holding unit 18 as the formal divided program. When the acquired data amount matches the reference data amount, the control unit 24 sets the temporary division program at that time as a formal division program. Even when the provisional end position reaches the end of the unit calculation process, the provisional division program at that time is set as a formal division program.

制御部24は、暫定終了位置が、開始位置のネストより下位のネストに到達したとき、変換指示部20に、仮分割プログラムのコンパイルをコンパイラ200に指示しないよう指示し、当該開始位置と同位のネストに到達するまで、当該暫定終了位置を進めるよう終了位置設定部14に指示する。開始位置を含む単位演算処理より下位の単位演算処理内では分割しないため、不要な仮分割プログラムの登録やコンパイルを回避することができる。   When the provisional end position reaches a lower nest than the nest of the start position, the control unit 24 instructs the conversion instruction unit 20 not to instruct the compiler 200 to compile the temporary divided program, and is the same as the start position. The end position setting unit 14 is instructed to advance the provisional end position until the nest is reached. Since the division is not performed in the unit calculation process lower than the unit calculation process including the start position, unnecessary registration and compilation of the temporary divided program can be avoided.

制御部24は、変換結果取得部22がコンパイラ200からエラーを取得したとき、そのときの仮分割プログラムを仮分割プログラム保持部18に登録しないよう、仮分割プログラム登録部16に指示する。文法的に分割してはいけない位置で分割されている場合、エラーが発生する。たとえば、If..文、elseif..文、else文、などは文法的に文の途中で切ることができない。   When the conversion result acquisition unit 22 acquires an error from the compiler 200, the control unit 24 instructs the temporary division program registration unit 16 not to register the temporary division program at that time in the temporary division program holding unit 18. An error occurs if it is split at a position that should not be split grammatically. For example, If. . Sentence, elseif. . Sentences, else sentences, etc. cannot be cut grammatically in the middle of a sentence.

コンパイラ200は、変換指示部20から指示された、仮分割プログラムをコンパイルし、その変換結果を変換結果取得部22に渡す。なお、オブジェクトデータ量保持部10に保持されている基準データ量と同様の形式、たとえばプロセッサの実行ステップ数を出力してもよいし、単純にオブジェクトファイルを変換結果取得部22に渡してもい。また、変換中にエラーが発生した場合、その旨を変換結果取得部22に通知する。   The compiler 200 compiles the temporary division program instructed from the conversion instruction unit 20 and passes the conversion result to the conversion result acquisition unit 22. Note that the same format as the reference data amount held in the object data amount holding unit 10, for example, the number of execution steps of the processor may be output, or the object file may be simply passed to the conversion result acquisition unit 22. If an error occurs during conversion, the conversion result acquisition unit 22 is notified of this.

図2は、実施の形態1に係るプログラム分割装置100の動作例を示すフローチャートである。前提として、単位時間あたりのプロセッサの最大実行ステップ数が基準データ量としてオブジェクトデータ量保持部10に保持されているものとする。また、分割すべきソースプログラムには、その分割開始位置を指定するコメントが埋め込まれているものとする。   FIG. 2 is a flowchart showing an operation example of the program dividing apparatus 100 according to the first embodiment. It is assumed that the maximum number of execution steps of the processor per unit time is held in the object data amount holding unit 10 as a reference data amount. In addition, it is assumed that a comment specifying the division start position is embedded in the source program to be divided.

まず、プログラム分割装置100にソースプログラムファイルが読み込まれ(S10)、開始位置情報検出部12は、そのソースプログラムに分割開始位置がコメントとして埋め込まれているか否か調査する(S12)。そのコメントが埋め込まれていなければ(S12のN)、処理不能として終了する。埋め込まれていれば(S12のY)、つぎの処理へ移行する。   First, a source program file is read into the program dividing apparatus 100 (S10), and the start position information detection unit 12 checks whether or not the division start position is embedded as a comment in the source program (S12). If the comment is not embedded (N in S12), the process is terminated as impossible. If it is embedded (Y in S12), the process proceeds to the next process.

開始位置情報検出部12は、当該コメントのある行を分割開始位置に設定し、終了位置設定部14は、その行の次の行を分割すべき暫定終了位置の初期値に設定する(S14)。仮分割プログラム登録部16は、当該コメントのある関数内(以下適宜、エントリ関数という)で、開始位置から暫定終了位置までに関係のないソースプログラムの記述を削除する(S16)。その際、ヘッダファイルから値を呼び出す必要がある変数など、初期値が設定されていない変数に初期値を代入する。   The start position information detection unit 12 sets the line with the comment as the division start position, and the end position setting unit 14 sets the initial value of the provisional end position at which the next line of the line is to be divided (S14). . The provisional division program registration unit 16 deletes the description of the source program that is not related from the start position to the provisional end position within the function with the comment (hereinafter referred to as an entry function as appropriate) (S16). At that time, the initial value is assigned to a variable for which no initial value is set, such as a variable whose value needs to be called from the header file.

仮分割プログラム登録部16は、上記記述の削除後のソースプログラムを仮分割プログラムファイルとして、仮分割プログラム保持部18に一時保存する(S18)。この際、この仮分割プログラムの関数名を分割前ソースプログラム内の関数名から、コンパイラ200で使用するパラメータファイルに記述する関数名に変更するとよい。   The temporary division program registration unit 16 temporarily stores the source program after the deletion of the description as a temporary division program file in the temporary division program holding unit 18 (S18). At this time, the function name of the temporary divided program may be changed from the function name in the pre-division source program to the function name described in the parameter file used by the compiler 200.

変換指示部20は当該仮分割プログラムをコンパイラ200にコンパイルさせる(S20)。制御部24は、変換結果取得部22がコンパイラ200からエラー通知を受けたか否か判定する(S22)。受けていない場合(S22のN)、ステップS24に遷移し、受けた場合(S22のY)、ステップS30に遷移する。エラーの発生は、分割できない位置で分割された仮分割プログラムであることを示しており、ステップS24、ステップS26およびステップS28の処理は実行する必要がなく、それらの処理をスキップする。なお、エラーが発生した仮分割プログラムについては、そのファイルを仮分割プログラム保持部18から削除する。   The conversion instruction unit 20 causes the compiler 200 to compile the provisional division program (S20). The control unit 24 determines whether the conversion result acquisition unit 22 has received an error notification from the compiler 200 (S22). If not received (N in S22), the process proceeds to step S24. If received (Y in S22), the process proceeds to step S30. The occurrence of an error indicates that the program is a temporary division program divided at a position where it cannot be divided, and the processes in steps S24, S26, and S28 do not need to be executed, and those processes are skipped. Note that the temporary divided program in which an error has occurred is deleted from the temporary divided program holding unit 18.

ステップS24において、変換結果取得部22は、コンパイラ200から変換結果として実行ステップ数を取得する(S24)。制御部24は、この実行ステップ数が上記基準データ量より小さいか否かを判定する(S26)。実行ステップ数が当該基準データ量より小さい場合(S26のN)、ステップS28に遷移し、実行ステップ数が当該基準データ量以上の場合(S26のY)、ステップS36に遷移する。   In step S24, the conversion result acquisition unit 22 acquires the number of execution steps as a conversion result from the compiler 200 (S24). The control unit 24 determines whether or not the number of execution steps is smaller than the reference data amount (S26). If the number of execution steps is smaller than the reference data amount (N in S26), the process proceeds to step S28. If the number of execution steps is equal to or greater than the reference data amount (Y in S26), the process proceeds to step S36.

ステップS28において、制御部24は、暫定終了位置が、エントリ関数の最終行を超えたか否か判定する(S28)。エントリ関数の最終行を超えていれば(S28のY)、ステップS38に遷移し、エントリ関数の最終行を超えていなければ(S28のN)、ステップS30に遷移する。   In step S28, the control unit 24 determines whether or not the provisional end position has exceeded the last line of the entry function (S28). If it exceeds the last line of the entry function (Y in S28), the process proceeds to step S38. If it does not exceed the final line of the entry function (N in S28), the process proceeds to step S30.

終了位置設定部14は、制御部24の指示に応じて暫定終了位置を一行分、インクリメントする(S30)。制御部24は、インクリメントされた暫定終了位置が、エントリ関数より下位のネストに入ったか否かを判定する(S32)。たとえば、暫定終了位置がfor文、while文、do while文、などのループ内に入った場合などが該当する。下位のネストに入った場合(S32のY)、ステップS30に遷移し、下位ネストから抜けるまで(S32のN)、暫定終了位置のインクリメントを繰り返す。下位ネストから抜けた場合、または下位ネストに入っていない場合(S32のN)、ステップS34に遷移する。   The end position setting unit 14 increments the provisional end position by one line in accordance with an instruction from the control unit 24 (S30). The control unit 24 determines whether or not the incremented provisional end position has entered a lower nest than the entry function (S32). For example, this corresponds to a case where the provisional end position enters a loop such as a for sentence, a while sentence, and a do while sentence. If the lower nest is entered (Y in S32), the process proceeds to step S30, and the temporary end position is incremented until the lower nest is exited (N in S32). If the lower nest is left, or if the lower nest is not entered (N in S32), the process proceeds to step S34.

制御部24は、暫定終了位置が、エントリ関数より上位のネストに入ったか否かを判定する(S34)。上位のネストに入った場合(S34のY)、ステップS38に遷移する。目的とする分割位置に達したため、新たな分割は行わない。上位のネストに入っていない場合(S34のN)、ステップS16に遷移し、新たな分割位置での分割を継続する。   The control unit 24 determines whether or not the provisional end position has entered a higher nest than the entry function (S34). When the upper nest is entered (Y in S34), the process proceeds to step S38. Since the target division position has been reached, no new division is performed. If it is not in the upper nest (N in S34), the process proceeds to step S16, and the division at the new division position is continued.

ステップS26において、取得された実行ステップ数が当該基準データ量以上の場合(S26のY)、制御部24は、この実行ステップ数が上記基準データ量と一致するか否かを判定する(S36)。一致する場合(S36のY)、仮分割プログラム保持部18に最後に保存された仮分割プログラムを正式な分割プログラムに決定する(S37)。一致しない場合(S36のN)、仮分割プログラム保持部18に前回保存された仮分割プログラムを正式な分割プログラムに決定する(S38)。   In step S26, when the number of execution steps acquired is equal to or larger than the reference data amount (Y in S26), the control unit 24 determines whether or not the number of execution steps matches the reference data amount (S36). . If they match (Y in S36), the temporary division program stored last in the temporary division program holding unit 18 is determined to be an official division program (S37). If they do not match (N in S36), the temporary division program previously stored in the temporary division program holding unit 18 is determined as an official division program (S38).

制御部24は、ステップS37またはステップS38で決定された分割プログラム内からエントリ関数の前後にある、当該分割プログラムで使用しない関数など、不要な記述を削除し最終的な分割プログラムを分割ソースプログラムファイルとして生成する(S39)。以上で全体処理が終了する。   The control unit 24 deletes unnecessary descriptions such as functions that are not used in the split program before and after the entry function from the split program determined in step S37 or step S38, and converts the final split program into a split source program file. (S39). Thus, the entire process ends.

図3は、実施の形態に係る分割プログラムを実行させるべき、リコンフィギュラブル回路50を搭載したプロセッサ500の構成を示す図である。このプロセッサ500は、設定データ保持部30、シーケンサ装置40、リコンフィギュラブル回路50および出力データ保持部60を備える。   FIG. 3 is a diagram illustrating a configuration of a processor 500 equipped with the reconfigurable circuit 50 that is to execute the division program according to the embodiment. The processor 500 includes a setting data holding unit 30, a sequencer device 40, a reconfigurable circuit 50, and an output data holding unit 60.

設定データ保持部30は、リコンフィギュラブル回路50に所期の回路を構成するための設定データを保持し、その設定データをリコンフィギュラブル回路50に供給する。シーケンサ装置40は、設定データ保持部30からリコンフィギュラブル回路50に供給する設定データを選択する。   The setting data holding unit 30 holds setting data for configuring a desired circuit in the reconfigurable circuit 50 and supplies the setting data to the reconfigurable circuit 50. The sequencer device 40 selects setting data to be supplied from the setting data holding unit 30 to the reconfigurable circuit 50.

リコンフィギュラブル回路50は、機能の変更が可能なALUを複数有する。具体的には、縦方向にx個、横方向にy個のALUが配置されたx×yのALUアレイを備える。ここでは、縦方向に四個、横方向に六個配置されている。ALUアレイに加えて、前段のALU列の出力と後段のALU列の入力との接続関係を設定可能な接続部を備える。各ALUの機能および各ALU間の接続関係は、上記設定データにより設定される。通常、一クロックで一段のALU(y個)が同時に動作する。この一段のALUで実行されるプログラムの分量がスレッドの基本実行単位となる。   The reconfigurable circuit 50 has a plurality of ALUs whose functions can be changed. Specifically, an x × y ALU array in which x ALUs in the vertical direction and y ALUs in the horizontal direction are arranged is provided. Here, four are arranged in the vertical direction and six are arranged in the horizontal direction. In addition to the ALU array, a connection unit that can set the connection relationship between the output of the preceding ALU column and the input of the subsequent ALU column is provided. The function of each ALU and the connection relationship between each ALU are set by the setting data. Normally, one stage of ALU (y units) operates simultaneously with one clock. The amount of the program executed by this one-stage ALU is the basic execution unit of the thread.

出力データ保持部60は、リコンフィギュラブル回路50から出力されるデータを保持する。このデータは、外部に出力されることも、リコンフィギュラブル回路50の入力にフィードバックされることも可能である。   The output data holding unit 60 holds data output from the reconfigurable circuit 50. This data can be output to the outside or fed back to the input of the reconfigurable circuit 50.

上述したように、基準とすべきオブジェクトデータ量としてプロセッサの実行ステップ数を採用することができる。図3に示すような、リコンフィギュラブル構成を備えたプロセッサでは、実行ステップ数をつぎのように規定することができる。まず、横方向にy個配置されたALUアレイ一段の一サイクルで実行可能な処理を、単位実行ステップ数と規定することができる。さらに、縦方向にx個、横方向にy個配置されたALUアレイ全体の一サイクルで実行可能な処理を、単位実行ステップ数と規定することもできる。基準データ量として実行ステップ数がmと設定された場合、ALUアレイの一段または全体をm回使用して実行可能なプログラムの最大量が、分割すべきスレッドの最大量となる。ALUアレイの全体を基準とすると、ALU列の空き時間を抑制し、より無駄のないコマンドの割り当てが可能となる。   As described above, the number of execution steps of the processor can be adopted as the amount of object data to be used as a reference. In a processor having a reconfigurable configuration as shown in FIG. 3, the number of execution steps can be defined as follows. First, a process that can be executed in one cycle of one ALU array arranged in the horizontal direction can be defined as the number of unit execution steps. Furthermore, a process that can be executed in one cycle of the entire ALU array arranged x in the vertical direction and y in the horizontal direction can be defined as the number of unit execution steps. When the number of execution steps is set as m as the reference data amount, the maximum amount of programs that can be executed by using one stage or the entire ALU array m times is the maximum amount of threads to be divided. If the entire ALU array is used as a reference, the free time of the ALU column can be suppressed, and commands can be assigned more efficiently.

図3に示すように、プロセッサ500は出力データ保持部60に出力されたデータがリコンフィギュラブル回路50の初段にフィードバックする構成を持っているため、リコンフィギュラブル回路50を複数サイクル使用する場合でも、その合計の段数をそのまま基準データ量とすることができる。   As shown in FIG. 3, the processor 500 has a configuration in which the data output to the output data holding unit 60 is fed back to the first stage of the reconfigurable circuit 50. Therefore, even when the reconfigurable circuit 50 is used for a plurality of cycles. The total number of stages can be used as the reference data amount as it is.

以下、実施の形態1に係るプログラム分割装置100を用いたソースプログラムの分割処理と、その処理により分割された分割プログラムを図3に示したプロセッサ500で実行させる処理を実際の具体例を用いて説明する。   Hereinafter, a source program dividing process using the program dividing apparatus 100 according to the first embodiment and a process of causing the processor 500 shown in FIG. 3 to execute the divided program divided by the process will be described using an actual specific example. explain.

図4は、実施の形態1に係るプログラム分割装置100で分割すべき、分割開始位置がコメントとして埋め込まれているソースプログラムの第1例を示す。図5は、図4のソースプログラムの仮分割プログラムを示す。図6は、図4のソースプログラムの最終的な分割プログラムを示す。図7は、図4のソースプログラムに対応するデータフローグラフを示す。図8は、図6のソースプログラムに対応するデータフローグラフを示す。   FIG. 4 shows a first example of a source program in which the division start position to be divided by the program dividing apparatus 100 according to the first embodiment is embedded as a comment. FIG. 5 shows a provisional division program of the source program of FIG. FIG. 6 shows a final divided program of the source program of FIG. FIG. 7 shows a data flow graph corresponding to the source program of FIG. FIG. 8 shows a data flow graph corresponding to the source program of FIG.

ここでのデータフローグラフとは、リコンフィギュラブル回路50の各ALUで実行すべき各演算間の実行順序の依存関係を表現し、入力変数および定数の演算の流れをグラフ形式で示したものである。図7、8のデータフローグラフは、4×6のALUアレイを持つリコンフィギュラブル回路50に実行させるべきデータフローグラフを示す。各データフローグラフ内の、「○」が演算命令(以下適宜、ノードという)、「□」が入力変数または出力変数を示す。ALUアレイの配置構成とデータフローグラフの構成が対応していれば、上記単位実行ステップ数は、データフローグラフの一段(ALUアレイの一段に対応)または一ユニット(ALUアレイ全体に対応する)ととらえることができる。   The data flow graph here represents the dependency of the execution order between the operations to be executed by each ALU of the reconfigurable circuit 50, and shows the flow of operations of input variables and constants in a graph format. is there. 7 and 8 show data flow graphs to be executed by the reconfigurable circuit 50 having a 4 × 6 ALU array. In each data flow graph, “◯” indicates an operation instruction (hereinafter referred to as a node as appropriate), and “□” indicates an input variable or output variable. If the arrangement configuration of the ALU array corresponds to the configuration of the data flow graph, the number of unit execution steps is one stage of data flow graph (corresponding to one stage of the ALU array) or one unit (corresponding to the entire ALU array). Can be captured.

以下、この例では4×6のALUアレイで実行可能な処理を単位実行ステップ数とし、上述した基準データ量として実行ステップ数=2が設定されているものとする。
図4のソースプログラムは、配列xの要素0から要素7までに格納された値を順次加算し、その加算後の値に変数z1と変数z2の値を加算する演算処理を実行する。具体的には、変数y=0+1+2+3+4+5+6+7+8+100+200を演算する。
Hereinafter, in this example, it is assumed that the processing that can be executed by the 4 × 6 ALU array is the unit execution step number, and the execution step number = 2 is set as the reference data amount described above.
The source program shown in FIG. 4 executes arithmetic processing for sequentially adding the values stored in elements 0 to 7 of the array x and adding the values of the variables z1 and z2 to the value after the addition. Specifically, the variable y = 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 100 + 200 is calculated.

このソースプログラム内には、「_VMSIZE_CHK_START_」というコメントが埋め込まれている。開始位置情報検出部12はこのコメントを検出すると、この行を分割すべき開始位置に設定する。   In this source program, a comment “_VMSIZE_CHK_START_” is embedded. When the start position information detection unit 12 detects this comment, the start position information detection unit 12 sets this line as the start position to be divided.

図5は、for文の最後で分割された仮分割プログラムを示す。すなわち、変数yに対する変数z1と変数z2の加算は含まれていない。図5では、仮分割プログラム内の関数名を「divide_tmp」にしている。   FIG. 5 shows the temporary division program divided at the end of the for sentence. That is, the addition of the variable z1 and the variable z2 to the variable y is not included. In FIG. 5, the function name in the temporary division program is “divide_tmp”.

図6は、正式に決定された分割プログラムを示す。分割位置が図5の仮分割プログラムと同じであるため、その分割位置が上記基準データ量を満たす、最大の分割位置であったことが分かる。図6では、正式な分割プログラム内の関数名を「Divide_Result」にしている。   FIG. 6 shows an officially determined division program. Since the division position is the same as the provisional division program of FIG. 5, it can be seen that the division position is the maximum division position that satisfies the reference data amount. In FIG. 6, the function name in the formal division program is “Divide_Result”.

図7は、コンパイラ200により図4のソースプログラムが変換されたデータフローグラフである。ノード内の「MOV」はスルー、「+」は加算処理である。ここでは実行ステップ数=3、すなわち最終結果を出力する時点が上記ALUアレイの三サイクル目になるため、基準データ量である実行ステップ数=2の条件を満たしていない。   FIG. 7 is a data flow graph in which the source program of FIG. “MOV” in the node is through, and “+” is addition processing. Here, since the number of execution steps = 3, that is, the time when the final result is output is the third cycle of the ALU array, the condition of the number of execution steps = 2, which is the reference data amount, is not satisfied.

図8は、コンパイラ200により図6のソースプログラムが変換されたデータフローグラフである。ここでは実行ステップ数=2、すなわち最終結果を出力する時点が上記ALUアレイの二サイクル目の最終段になるため、基準データ量である実行ステップ数=2の条件を満たしている。   FIG. 8 is a data flow graph in which the source program of FIG. Here, the number of execution steps = 2, that is, the time when the final result is output is the final stage of the second cycle of the ALU array, so the condition of the number of execution steps = 2, which is the reference data amount, is satisfied.

図9は、実施の形態1に係るプログラム分割装置100で分割すべき、分割開始位置がコメントとして埋め込まれているソースプログラムの第2例を示す。図10は、図9のソースプログラムの仮分割プログラムを示す。図11は、図9のソースプログラムの最終的な分割プログラムを示す。図12は、図9のソースプログラムに対応するデータフローグラフを示す。図13は、図11のソースプログラムに対応するデータフローグラフを示す。   FIG. 9 shows a second example of a source program in which the division start position to be divided by the program dividing apparatus 100 according to the first embodiment is embedded as a comment. FIG. 10 shows a provisional division program of the source program of FIG. FIG. 11 shows a final divided program of the source program of FIG. FIG. 12 shows a data flow graph corresponding to the source program of FIG. FIG. 13 shows a data flow graph corresponding to the source program of FIG.

以下、この例では4×6のALUアレイで実行可能な処理を単位実行ステップ数とし、上述した基準データ量として実行ステップ数=3が設定されているものとする。
図9のソースプログラムの基本構造は、ヘッダファイルから読み込まれた変数EXT_in1が0より小さいとき、「変数G_aaa」=「変数G_aaa1」+2+3+「変数EXT_in1」+1を演算し、0以上のとき、「変数G_aaa」=「変数G_aaa」+1+1を演算するものである。
Hereinafter, in this example, it is assumed that processing that can be executed by a 4 × 6 ALU array is the number of unit execution steps, and the number of execution steps = 3 is set as the reference data amount described above.
The basic structure of the source program of FIG. 9 is that when the variable EXT_in1 read from the header file is smaller than 0, “variable G_aaa” = “variable G_aaa1” + 2 + 3 + “variable EXT_in1” +1 is calculated. G_aaa ”=“ variable G_aaa ”+ 1 + 1 is calculated.

このソースプログラム内には、「_VMSIZE_CHK_START 」というコメントが埋め込まれている。開始位置情報検出部12はこのコメントを検出すると、この行を分割すべき開始位置に設定する。   A comment “_VMSIZE_CHK_START” is embedded in the source program. When the start position information detection unit 12 detects this comment, the start position information detection unit 12 sets this line as the start position to be divided.

図10は、2回目に登場するif文の最後で分割された仮分割プログラムを示す。すなわち、3、4回目if文は含まれていない。図11は、正式に決定された分割プログラムを示す。分割位置が図10の仮分割プログラムと同じであるため、その分割位置が上記基準データ量を満たす、最大の分割位置であったことが分かる。図10と図11とを比較すると、図11では、void func3() {G_aaa+=3;}が削除されていることが分かる。この処理は3回目のif文の判断結果により実行される関数であり、分割プログラムに3回目のif文が含まれない以上、不要な記述であり削除される。   FIG. 10 shows a temporary division program that is divided at the end of the “if” sentence that appears for the second time. That is, the third and fourth if statements are not included. FIG. 11 shows an officially determined division program. Since the division position is the same as the temporary division program of FIG. 10, it can be seen that the division position is the maximum division position that satisfies the reference data amount. Comparing FIG. 10 with FIG. 11, it can be seen that void func3 () {G_aaa + = 3;} is deleted in FIG. This process is a function executed based on the determination result of the third if statement, and is an unnecessary description and deleted as long as the third if statement is not included in the divided program.

図12は、コンパイラ200により図9のソースプログラムが変換されたデータフローグラフである。ノード間の実線は実際のデータの流れを示し、点線は制御信号、たとえば条件判定結果の流れを示す。ノード内の「>=」、「!=」は条件判定処理、「merge」は制御信号に応じて入力データを切り替える処理である。たとえば、そのデータフローグラフの二段目の二列に位置するノード内の、「merge」は一段目一列に位置するノードからの制御信号を受けて「1」を取り込むか、変数「G_stage」を取り込むかを決定する。   FIG. 12 is a data flow graph in which the source program of FIG. 9 is converted by the compiler 200. A solid line between nodes indicates an actual data flow, and a dotted line indicates a flow of a control signal, for example, a condition determination result. “> =” And “! =” In the node are condition determination processing, and “merge” is processing to switch input data in accordance with a control signal. For example, “merge” in the node located in the second row of the second row of the data flow graph receives “1” in response to a control signal from the node located in the first row or the first row, or sets the variable “G_stage”. Decide whether to import.

図12のデータフローグラフでは、実行ステップ数=4、すなわち最終結果を出力する時点が上記ALUアレイの四サイクル目になるため、基準データ量である実行ステップ数=3の条件を満たしていない。   In the data flow graph of FIG. 12, the number of execution steps = 4, that is, the time point when the final result is output is the fourth cycle of the ALU array, so the condition of the number of execution steps = 3, which is the reference data amount, is not satisfied.

図13は、コンパイラ200により図11のソースプログラムが変換されたデータフローグラフである。ここでは実行ステップ数=3、すなわち最終結果を出力する時点が上記ALUアレイの三サイクル目の最終段になるため、基準データ量である実行ステップ数=3の条件を満たしている。   FIG. 13 is a data flow graph in which the source program of FIG. 11 is converted by the compiler 200. Here, the number of execution steps = 3, that is, the time point when the final result is output is the final stage of the third cycle of the ALU array, so the condition of the number of execution steps = 3 which is the reference data amount is satisfied.

つぎに実施の形態1に係るプログラム分割装置100の変形例について説明する。本変形例は、基本例のように暫定終了位置を順次移動させるのではなく、二分法を用いて暫定終了位置を移動させる。   Next, a modification of the program dividing apparatus 100 according to the first embodiment will be described. In this modification, the provisional end position is not moved sequentially as in the basic example, but the provisional end position is moved using a bisection method.

以下、図1に示した構成要素の、基本例と異なる動作について説明する。
終了位置設定部14は、分割すべきソースプログラム内において、開始位置情報検出部12により検出された分割開始位置情報で特定される開始位置の行と、その開始位置を含む単位演算処理の最終行と、の半分の位置にある行を暫定終了位置の初期値とする。単位演算処理全体の行数が割り切れない場合、小数を切り捨てするか切り上げるかして整数にする。以下、本変形例の他の除算についても同様とする。
Hereinafter, operations different from the basic example of the components shown in FIG. 1 will be described.
The end position setting unit 14 includes, in the source program to be divided, the line of the start position specified by the division start position information detected by the start position information detection unit 12 and the last line of the unit calculation process including the start position. The line at half the position is the initial value of the provisional end position. If the number of lines in the whole unit operation process is not divisible, round down or round up to the nearest whole number. Hereinafter, the same applies to other divisions in this modification.

制御部24は、取得データ量が基準データ量を超えるとき、初期では、上記開始位置の行から上記最終行までの1/4の行数、二回目以降では、上記暫定終了位置を前回移動した行数の半分の行数、戻すよう終了位置設定部14に指示する。逆に、取得データ量が基準データ量未満のとき、初期では、上記開始位置の行から上記最終行までの1/4の行数、二回目以降では、上記暫定終了位置を前回移動した行数の半分の行数、進めるよう終了位置設定部14に指示する。取得データ量と基準データ量が一致したとき、仮分割プログラム保持部18に最後に登録された仮分割プログラムを正式な分割プログラムとする。上記暫定終了位置が前回移動した行数が一のとき、取得データ量が基準データ量以下である仮分割プログラムのうち、仮分割プログラム保持部18に最後に登録された仮分割プログラムを正式な分割プログラムとする。   When the acquired data amount exceeds the reference data amount, the control unit 24 initially moved the quarter number of lines from the start position line to the last line, and the second and subsequent times, the temporary end position was moved last time. The end position setting unit 14 is instructed to return the number of lines that is half the number of lines. Conversely, when the amount of acquired data is less than the reference data amount, the number of rows from the start position to the last row is ¼ at the beginning, and the number of rows from which the provisional end position has been moved last time after the second time. The end position setting unit 14 is instructed to advance by half the number of lines. When the acquired data amount matches the reference data amount, the temporary division program last registered in the temporary division program holding unit 18 is set as a formal division program. When the provisional end position is the number of lines moved last time, among the temporary division programs whose acquired data amount is equal to or less than the reference data amount, the temporary division program last registered in the temporary division program holding unit 18 is officially divided. A program.

制御部24は、取得データ量が基準データ量を超えるときの仮分割プログラムを、仮分割プログラム登録部16に登録しないよう指示してもよいし、または仮分割プログラム保持部18に登録された後に、その仮分割プログラムを仮分割プログラム保持部18内から削除してもよい。   The control unit 24 may instruct not to register the temporary division program when the acquired data amount exceeds the reference data amount in the temporary division program registration unit 16 or after being registered in the temporary division program holding unit 18. The temporary division program may be deleted from the temporary division program holding unit 18.

図14は、実施の形態1の変形例に係るプログラム分割装置100の動作例を示すフローチャートである。前提として、単位時間あたりのプロセッサの最大実行ステップ数が基準データ量としてオブジェクトデータ量保持部10に保持されているものとする。また、分割すべきソースプログラムには、その分割開始位置を指定するコメントが埋め込まれているものとする。   FIG. 14 is a flowchart showing an operation example of the program dividing apparatus 100 according to the modification of the first embodiment. It is assumed that the maximum number of execution steps of the processor per unit time is held in the object data amount holding unit 10 as a reference data amount. In addition, it is assumed that a comment specifying the division start position is embedded in the source program to be divided.

まず、プログラム分割装置100にソースプログラムファイルが読み込まれ(S40)、開始位置情報検出部12は、そのソースプログラムに分割開始位置がコメントとして埋め込まれているか否か調査する(S42)。そのコメントが埋め込まれていなければ(S42のN)、処理不能として終了する。埋め込まれていれば(S42のY)、つぎの処理へ移行する。   First, a source program file is read into the program dividing apparatus 100 (S40), and the start position information detection unit 12 checks whether or not the division start position is embedded as a comment in the source program (S42). If the comment is not embedded (N in S42), the process ends as impossible. If it is embedded (Y in S42), the process proceeds to the next process.

開始位置情報検出部12は、当該コメントのある行を分割開始位置に設定し、終了位置設定部14は、その行と、その行を含む関数の最終行との半分に位置する行を分割すべき暫定終了位置の初期値に設定する(S44)。仮分割プログラム登録部16は、エントリ関数内で、開始位置から暫定終了位置までに関係のないソースプログラムの記述を削除する(S46)。仮分割プログラム登録部16は、上記記述の削除後のソースプログラムを仮分割プログラムファイルとして、仮分割プログラム保持部18に一時保存する(S48)。   The start position information detection unit 12 sets the line with the comment as the division start position, and the end position setting unit 14 divides the line located at half of the line and the last line of the function including the line. Set to the initial value of the provisional end position (S44). The provisional division program registration unit 16 deletes the description of the source program that is not related from the start position to the provisional end position in the entry function (S46). The temporary division program registration unit 16 temporarily stores the source program after the deletion of the description as a temporary division program file in the temporary division program holding unit 18 (S48).

変換指示部20は当該仮分割プログラムをコンパイラ200にコンパイルさせる(S50)。変換結果取得部22は、コンパイラ200から変換結果として実行ステップ数を取得する(S52)。制御部24は、この実行ステップ数と上記基準データ量とが一致するか否か判定する(S54)。一致する場合(S54のY)、ステップS64に遷移し、一致しない場合(S54のN)、ステップS56に遷移する。   The conversion instruction unit 20 causes the compiler 200 to compile the temporary divided program (S50). The conversion result acquisition unit 22 acquires the number of execution steps as a conversion result from the compiler 200 (S52). The control unit 24 determines whether or not the number of execution steps matches the reference data amount (S54). If they match (Y in S54), the process proceeds to step S64. If they do not match (N in S54), the process proceeds to step S56.

ステップS56において、制御部24は、暫定終了位置を二分法によりさらに移動可能か否かを判定する(S56)。前回の移動行数が1行の場合、移動不能となる。移動可能な場合(S56のY)、ステップS58に遷移し、移動不能な場合(S56のN)、ステップS64に遷移する。   In step S56, the control unit 24 determines whether or not the provisional end position can be further moved by the bisection method (S56). When the previous number of moving lines is one, it becomes impossible to move. If it is movable (Y in S56), the process proceeds to step S58, and if it is not movable (N in S56), the process proceeds to step S64.

ステップS58において、制御部24は、取得された実行ステップ数が上記基準データ量より大きいか小さいか判定する(S58)。大きい場合(S58のY)、暫定終了位置を二分法により後退させるよう終了位置設定部14に指示する。具体的には、前回移動した行数の半分の行数後退させるよう指示する(S60)。小さい場合(S58のN)、暫定終了位置を二分法により前進させるよう終了位置設定部14に指示する(S62)。具体的には、前回移動した行数の半分の行数前進させるよう指示する。ステップS60またはステップS62の後、ステップS46に遷移し、新たな分割位置での分割を継続する。   In step S58, the control unit 24 determines whether the acquired number of execution steps is larger or smaller than the reference data amount (S58). If larger (Y in S58), the end position setting unit 14 is instructed to retract the provisional end position by the bisection method. Specifically, an instruction is given to reverse the number of lines that is half the number of lines moved last time (S60). If it is smaller (N in S58), the end position setting unit 14 is instructed to advance the provisional end position by the bisection method (S62). Specifically, an instruction is given to advance the number of lines that is half the number of lines moved last time. After step S60 or step S62, the process proceeds to step S46, and the division at the new division position is continued.

ステップS64において、制御部24は、取得された実行ステップ数が上記基準データ量以上の仮分割プログラムのうち、最後に登録された仮分割プログラムを正式な分割プログラムに決定する(S64)。   In step S64, the control unit 24 determines that the temporary division program registered last among the temporary division programs whose acquired number of execution steps is equal to or larger than the reference data amount is an official division program (S64).

なお、フローチャートには記述しないがこの正式な分割プログラムがコンパイラ200からエラーが通知されたものである場合、この分割プログラムの終了位置を、コンパイルした際にエラーが発生しない位置まで後退させるよう終了位置設定部14に指示し、その位置の仮分割プログラムを正式な分割プログラムに決定する。   Although not described in the flowchart, if this formal divided program is one for which an error has been notified from the compiler 200, the end position of the divided program is moved backward to a position where no error occurs when compiling. The setting unit 14 is instructed, and the provisional division program at that position is determined as an official division program.

また、上記正式な分割プログラムの終了位置が開始位置のネストより下位のネストに入っている場合、この仮分割プログラムの終了位置を、開始位置のネストと同位になる位置まで後退させるよう終了位置設定部14に指示する。その位置の仮分割プログラムを正式な分割プログラムに決定する。   In addition, if the end position of the formal division program is in a nest lower than the nest of the start position, the end position is set so that the end position of the temporary division program is moved backward to a position that is the same as the nest of the start position. The unit 14 is instructed. The temporary division program at that position is determined to be an official division program.

制御部24は、当該正式な分割プログラムからエントリ関数の前後にある、当該分割プログラムで使用しない関数など、不要な記述を削除し最終的な分割プログラムを分割ソースプログラムファイルとして生成する(S66)。以上で全体処理が終了する。   The control unit 24 deletes unnecessary descriptions such as functions not used in the divided program before and after the entry function from the official divided program, and generates a final divided program as a divided source program file (S66). Thus, the entire process ends.

以上説明したように実施の形態1によれば、基準とすべきオブジェクト量を登録し、かつ分割開始位置を指定するだけで、終了位置はシステムが最適な位置に決定することから、簡単にソースプログラムを好適な位置で分割することができる。リアルタイム性が保証される最大処理量の実行が可能な位置で分割することができる。これにより、複数のスレッドを時分割に処理する場合、各スレッドのリアルタイム性が保証されつつ、全体の処理時間を短縮することができる。よって、マルチスレッドに対応したアプリケーションの開発効率を向上させることができる。とくに、リコンフィギュラブル回路を搭載したプロセッサで実行させることに適した、短いサイクル時間で実行ステップ数を一定の値以下に抑えることを要請されるアプリケーションを開発する場合に有効である。   As described above, according to the first embodiment, the system determines the end position as an optimal position simply by registering the object amount to be used as a reference and specifying the division start position. The program can be divided at a suitable position. It is possible to divide at a position where the maximum processing amount that guarantees real-time performance can be executed. As a result, when a plurality of threads are processed in a time-sharing manner, the entire processing time can be shortened while ensuring the real-time property of each thread. Therefore, it is possible to improve the development efficiency of an application that supports multithreading. In particular, it is effective when developing an application that is required to be executed in a processor equipped with a reconfigurable circuit and that is required to keep the number of execution steps below a certain value in a short cycle time.

また、実際に仮分割プログラムをコンパイルして実行ステップ数を求めることにより、コンパイラによる最適化を反映させた正確な実行ステップ数を求めることができる。ライブラリ情報をもとに予測するだけでは、最適化を反映した正確な実行ステップ数を求めることが困難である。   In addition, by actually compiling the temporary divided program and obtaining the number of execution steps, the accurate number of execution steps reflecting the optimization by the compiler can be obtained. It is difficult to obtain an accurate number of execution steps that reflect optimization simply by making predictions based on library information.

また、最適な終了位置を探索するために二分法を採用すると、最適な終了位置を探索するまでの時間を平準化することができる。なお、制御部24は開始位置を含む単位演算処理の長さに応じて、順次探索を採用するか二分法探索を採用するか決定してもよい。すなわち、所定の行数より短いとき前者を採用し、長いとき後者を採用する。これにより、最適な終了位置までの探索時間をより最適化することができる。   In addition, when the bisection method is employed to search for the optimal end position, the time until the optimal end position is searched can be leveled. The control unit 24 may determine whether to employ sequential search or bisection search according to the length of the unit calculation process including the start position. That is, the former is adopted when the number is shorter than the predetermined number of rows, and the latter is adopted when the number is longer. Thereby, the search time to the optimal end position can be further optimized.

図15は、実施の形態2に係る情報処理システム300の構成を示すブロック図である。情報処理システム300は、プログラム分割装置100およびコンパイラ200を備える。プログラム分割装置100は、開始位置情報検出部12、終了位置情報検出部15、変換指示部20および変換結果取得部22を備える。   FIG. 15 is a block diagram illustrating a configuration of the information processing system 300 according to the second embodiment. The information processing system 300 includes a program dividing device 100 and a compiler 200. The program dividing apparatus 100 includes a start position information detection unit 12, an end position information detection unit 15, a conversion instruction unit 20, and a conversion result acquisition unit 22.

開始位置情報検出部12は、ソースプログラム内から分割開始位置情報を検出する。終了位置情報検出部15は、ソースプログラム内から分割終了位置情報を検出する。このソースプログラム内には、分割開始位置情報と同様に、分割を終了すべき位置に分割開始位置情報が付加されている。   The start position information detection unit 12 detects division start position information from within the source program. The end position information detection unit 15 detects division end position information from within the source program. In this source program, division start position information is added to the position where the division is to be ended, similarly to the division start position information.

変換指示部20は、開始位置情報検出部12により検出された分割開始位置情報で特定される開始位置と、終了位置情報検出部により検出された分割終了位置情報で特定される終了位置とで規定される分割プログラムをコンパイルするよう所定のコンパイラ200に指示する。変換結果取得部22は、変換指示部20による指示に応じた、コンパイラ200の変換結果を取得する。ここでは、オブジェクトデータ量およびエラーの有無の、少なくとも一方を取得する。オブジェクトデータ量を実行ステップ数で規定する場合、コンパイラ200からオブジェクトデータ量をプロセッサの実行ステップ数として取得してもよいし、取得したオブジェクトファイルからプロセッサの実行ステップ数をプログラム分割装置100側で求めてもよい。   The conversion instruction unit 20 is defined by a start position specified by the division start position information detected by the start position information detection unit 12 and an end position specified by the division end position information detected by the end position information detection unit. The predetermined compiler 200 is instructed to compile the divided program. The conversion result acquisition unit 22 acquires the conversion result of the compiler 200 according to the instruction from the conversion instruction unit 20. Here, at least one of the object data amount and the presence / absence of an error is acquired. When the object data amount is defined by the number of execution steps, the object data amount may be acquired from the compiler 200 as the number of execution steps of the processor, or the number of execution steps of the processor is obtained from the acquired object file on the program dividing device 100 side. May be.

図16は、実施の形態2に係るプログラム分割装置100の動作例を示すフローチャートである。前提として、分割すべきソースプログラムには、その分割開始位置を指定するコメントおよびその分割終了位置を指定するコメントが埋め込まれているものとする。   FIG. 16 is a flowchart showing an operation example of the program dividing apparatus 100 according to the second embodiment. As a premise, it is assumed that a comment specifying the division start position and a comment specifying the division end position are embedded in the source program to be divided.

まず、プログラム分割装置100にソースプログラムファイルが読み込まれ(S70)、開始位置情報検出部12および終了位置情報検出部15は、そのソースプログラムに分割開始位置および分割終了位置がコメントとしてそれぞれ埋め込まれているか否か調査する(S72)。そのコメントの少なくとも一方が埋め込まれていなければ(S72のN)、処理不能として終了する。両方埋め込まれていれば(S72のY)、つぎの処理へ移行する。   First, a source program file is read into the program dividing apparatus 100 (S70), and the start position information detection unit 12 and the end position information detection unit 15 embed the division start position and the division end position as comments in the source program, respectively. It is investigated whether it exists (S72). If at least one of the comments is not embedded (N in S72), the process ends as impossible. If both are embedded (Y in S72), the process proceeds to the next process.

開始位置情報検出部12および終了位置情報検出部15は、それらコメントのあるエントリ関数内で、開始位置から終了位置までに関係のないソースプログラムの記述を削除する(S74)。変換指示部20は、開始位置から終了位置までの分割プログラムをコンパイラ200にコンパイルさせる(S76)。変換結果取得部22は、コンパイラ200からエラー通知を受けたか否か判定する(S78)。受けた場合(S78のY)、実行ステップ数を取得する必要がないため、処理を終了する。受けていない場合(S78のN)、コンパイラ200から実行ステップ数を取得する(S80)。変換結果取得部22は、当該分割プログラムからエントリ関数の前後にある、当該分割プログラムで使用しない関数など、不要な記述を削除し最終的な分割プログラムを分割ソースプログラムファイルとして生成する(S82)。以上で全体処理が終了する。   The start position information detection unit 12 and the end position information detection unit 15 delete the description of the source program that is not related from the start position to the end position in the entry function with the comment (S74). The conversion instruction unit 20 causes the compiler 200 to compile the divided program from the start position to the end position (S76). The conversion result acquisition unit 22 determines whether an error notification has been received from the compiler 200 (S78). If it is received (Y in S78), it is not necessary to acquire the number of execution steps, and the process is terminated. If not received (N in S78), the number of execution steps is acquired from the compiler 200 (S80). The conversion result acquisition unit 22 deletes unnecessary descriptions such as functions not used in the divided program before and after the entry function from the divided program, and generates a final divided program as a divided source program file (S82). Thus, the entire process ends.

図17は、実施の形態2に係るプログラム分割装置100で分割すべき、分割開始位置がコメントとして埋め込まれているソースプログラムを示す。図18は、図17のソースプログラムの最終的な分割プログラムを示す。図19は、図18のソースプログラムに対応するデータフローグラフを示す。   FIG. 17 shows a source program in which the division start position to be divided by the program dividing apparatus 100 according to the second embodiment is embedded as a comment. FIG. 18 shows a final divided program of the source program of FIG. FIG. 19 shows a data flow graph corresponding to the source program of FIG.

図17のソースプログラムは、上述した図4のソースプログラムと同様の演算を実行するためのプログラムである。このソースプログラム内には、「_VMSIZE_CHK_START_」および「_VMSIZE_CHK_END_」というコメントが埋め込まれている。開始位置情報検出部12は「_VMSIZE_CHK_START_」を検出すると、この行を分割開始位置に設定する。終了位置情報検出部15は「_VMSIZE_CHK_END_」を検出すると、この行を分割終了位置に設定する。図18では、エントリ関数内にて、範囲指定された演算処理、すなわち「y+=z1」および「y+=z2」以外の記述は不要な記述として削除されている。図19は、コンパイラ200により図18のソースプログラムが変換されたデータフローグラフである。ALUアレイ全体を単位実行ステップ数と規定した場合、実行ステップ数=1となり、ALUアレイの一段を単位実行ステップ数と規定した場合、実行ステップ数=3となる。   The source program of FIG. 17 is a program for executing the same calculation as the source program of FIG. 4 described above. In this source program, comments “_VMSIZE_CHK_START_” and “_VMSIZE_CHK_END_” are embedded. When the start position information detection unit 12 detects “_VMSIZE_CHK_START_”, this line is set as the division start position. When the end position information detection unit 15 detects “_VMSIZE_CHK_END_”, the end position information detection unit 15 sets this line as the division end position. In FIG. 18, in the entry function, the range-specified arithmetic processing, that is, descriptions other than “y + = z1” and “y + = z2” are deleted as unnecessary descriptions. FIG. 19 is a data flow graph in which the source program of FIG. When the entire ALU array is defined as the number of unit execution steps, the number of execution steps = 1, and when one stage of the ALU array is defined as the number of unit execution steps, the number of execution steps = 3.

以上説明したように実施の形態2によれば、分割開始位置と分割終了位置を指定するだけで、分割しようとしている分割プログラムの、コンパイル後の正確な実行ステップ数を簡単に確認することができる。また、その位置で分割した場合にエラーが発生するか否かも簡単に確認することができる。   As described above, according to the second embodiment, it is possible to easily confirm the exact number of execution steps after compilation of the divided program to be divided simply by specifying the division start position and the division end position. . It is also possible to easily confirm whether or not an error occurs when dividing at that position.

以上、本発明をいくつかの実施形態をもとに説明した。これらの実施の形態は例示であり、それらの各構成要素や各処理プロセスの組合せにいろいろな変形例が可能なこと、またそうした変形例も本発明の範囲にあることは当業者に理解されるところである。   The present invention has been described based on some embodiments. It is understood by those skilled in the art that these embodiments are exemplifications, and that various modifications can be made to combinations of the respective constituent elements and processing processes, and such modifications are also within the scope of the present invention. By the way.

たとえば、上述した実施の形態1では上記基準データ量として実行ステップ数を使用したが(ステップS26などの判定処理)、これに代えてメモリ使用量やメモリアクセス数など、ボトルネックになりうるものを基準データ量として使用してもよい。また、複数の要素に対応する複数の基準データ量を組み合わせて、少なくとも一つの要素がそれに対応する基準データ量を超えるか否かで判断してもよい。   For example, in the above-described first embodiment, the number of execution steps is used as the reference data amount (determination process such as step S26), but instead of this, what may become a bottleneck, such as the amount of memory used or the number of memory accesses, is used. It may be used as a reference data amount. Further, a plurality of reference data amounts corresponding to a plurality of elements may be combined, and determination may be made based on whether or not at least one element exceeds the reference data amount corresponding thereto.

また、図2、図14のフローチャートでは、分割開始位置がコメントとして埋め込まれていなければエラーとして終了した。この点、終了せずに分割開始位置を分割すべきソースプログラムの先頭に設定してもよい。この場合、コメントなどが付されていないことを、分割開始位置を先頭に指定する分割開始位置情報ととらえればよい。   In the flowcharts of FIGS. 2 and 14, if the division start position is not embedded as a comment, the process ends as an error. In this regard, the division start position may be set at the head of the source program to be divided without ending. In this case, the fact that no comment or the like is attached may be regarded as division start position information that designates the division start position at the head.

また、図2のフローチャートでは、暫定終了位置が開始位置より下位のネストに到達した場合、同位のネストに到達するまでコンパイルをスキップしたが、そのネストの関数をインライン展開し、逐次、コンパイルしてもよい。   In the flowchart of FIG. 2, when the temporary end position reaches a nest lower than the start position, compilation is skipped until the nest of the peer is reached. Also good.

実施の形態1に係る情報処理システムの構成を示すブロック図である。1 is a block diagram illustrating a configuration of an information processing system according to a first embodiment. 実施の形態1に係るプログラム分割装置の動作例を示すフローチャートである。4 is a flowchart illustrating an operation example of the program dividing device according to the first embodiment. 実施の形態に係る分割プログラムを実行させるべき、リコンフィギュラブル回路を搭載したプロセッサの構成を示す図である。It is a figure which shows the structure of the processor carrying the reconfigurable circuit which should run the division | segmentation program which concerns on embodiment. 実施の形態1に係るプログラム分割装置で分割すべき、分割開始位置がコメントとして埋め込まれているソースプログラムの第1例を示す図である。It is a figure which shows the 1st example of the source program with which the division | segmentation start position which should be divided | segmented with the program division | segmentation apparatus which concerns on Embodiment 1 is embedded as a comment. 図4のソースプログラムの仮分割プログラムを示す図である。It is a figure which shows the temporary division | segmentation program of the source program of FIG. 図4のソースプログラムの最終的な分割プログラムを示す図である。It is a figure which shows the final division | segmentation program of the source program of FIG. 図4のソースプログラムに対応するデータフローグラフを示す図である。It is a figure which shows the data flow graph corresponding to the source program of FIG. 図6のソースプログラムに対応するデータフローグラフを示す図である。It is a figure which shows the data flow graph corresponding to the source program of FIG. 実施の形態1に係るプログラム分割装置で分割すべき、分割開始位置がコメントとして埋め込まれているソースプログラムの第2例を示す図である。It is a figure which shows the 2nd example of the source program with which the division | segmentation start position which should be divided | segmented with the program division | segmentation apparatus which concerns on Embodiment 1 is embedded as a comment. 図9のソースプログラムの仮分割プログラムを示す図である。It is a figure which shows the temporary division | segmentation program of the source program of FIG. 図9のソースプログラムの最終的な分割プログラムを示す図である。It is a figure which shows the final division | segmentation program of the source program of FIG. 図9のソースプログラムに対応するデータフローグラフを示す図である。It is a figure which shows the data flow graph corresponding to the source program of FIG. 図11のソースプログラムに対応するデータフローグラフを示す図である。It is a figure which shows the data flow graph corresponding to the source program of FIG. 実施の形態1の変形例に係るプログラム分割装置の動作例を示すフローチャートである。10 is a flowchart showing an operation example of a program dividing apparatus according to a modification of the first embodiment. 実施の形態2に係る情報処理システムの構成を示すブロック図である。6 is a block diagram showing a configuration of an information processing system according to Embodiment 2. FIG. 実施の形態2に係るプログラム分割装置の動作例を示すフローチャートである。10 is a flowchart illustrating an operation example of the program dividing device according to the second embodiment. 実施の形態2に係るプログラム分割装置で分割すべき、分割開始位置がコメントとして埋め込まれているソースプログラムを示す図である。It is a figure which shows the source program by which the division | segmentation start position which should be divided | segmented with the program division | segmentation apparatus which concerns on Embodiment 2 is embedded as a comment. 図17のソースプログラムの最終的な分割プログラムを示す図である。It is a figure which shows the final division | segmentation program of the source program of FIG. 図18のソースプログラムに対応するデータフローグラフを示す図である。It is a figure which shows the data flow graph corresponding to the source program of FIG.

符号の説明Explanation of symbols

10 オブジェクトデータ量保持部、 12 開始位置情報検出部、 14 終了位置設定部、 15 終了位置情報検出部、 16 仮分割プログラム登録部、 18 仮分割プログラム保持部、 20 変換指示部、 22 変換結果取得部、 24 制御部、 30 設定データ保持部、 40 シーケンサ装置、 50 リコンフィギュラブル回路、 60 出力データ保持部、 100 プログラム分割装置、 200 コンパイラ、 300 情報処理システム、 500 プロセッサ。   DESCRIPTION OF SYMBOLS 10 Object data amount holding | maintenance part, 12 Start position information detection part, 14 End position setting part, 15 End position information detection part, 16 Temporary division program registration part, 18 Temporary division program holding part, 20 Conversion instruction | indication part, 22 Conversion result acquisition Unit, 24 control unit, 30 setting data holding unit, 40 sequencer device, 50 reconfigurable circuit, 60 output data holding unit, 100 program dividing device, 200 compiler, 300 information processing system, 500 processor.

Claims (10)

ソースプログラムを分割するプログラム分割装置であって、
基準とすべきオブジェクトデータ量を基準データ量として保持するオブジェクトデータ量保持部と、
前記ソースプログラム内から分割開始位置情報を検出する開始位置情報検出部と、
前記開始位置情報検出部により検出された分割開始位置情報で特定される開始位置から始まる分割プログラムの暫定終了位置を定める終了位置設定部と、
前記開始位置と、前記終了位置設定部により定められる暫定終了位置とで規定される仮分割プログラムをコンパイルするよう所定のコンパイラに指示する変換指示部と、
前記変換指示部による指示に応じた、前記コンパイラの変換結果に対応するオブジェクトデータ量を取得データ量として取得する変換結果取得部と、
前記オブジェクトデータ量保持部により保持される基準データ量と、前記変換結果取得部により取得される取得データ量とを比較し、その比較結果に応じて前記終了位置設定部を制御する制御部と、を備え、
前記制御部は、前記基準データ量と前記取得データ量とが一致または近づくように前記暫定終了位置を変更するよう、前記終了位置設定部を制御することを特徴とするプログラム分割装置。
A program dividing device for dividing a source program,
An object data amount holding unit for holding, as a reference data amount, an object data amount to be a reference;
A start position information detecting unit for detecting division start position information from within the source program;
An end position setting unit for determining a provisional end position of a division program starting from a start position specified by the division start position information detected by the start position information detection unit;
A conversion instruction unit for instructing a predetermined compiler to compile the provisional division program defined by the start position and the provisional end position determined by the end position setting unit;
A conversion result acquisition unit that acquires, as an acquisition data amount, an object data amount corresponding to the conversion result of the compiler in response to an instruction from the conversion instruction unit;
A control unit that compares the reference data amount held by the object data amount holding unit with the acquisition data amount acquired by the conversion result acquisition unit, and controls the end position setting unit according to the comparison result; With
The said control part controls the said end position setting part so that the said provisional end position may be changed so that the said reference | standard data amount and the said acquisition data amount may correspond or approach, The program division | segmentation apparatus characterized by the above-mentioned.
前記終了位置設定部は、前記ソースプログラム内において前記分割開始位置情報で特定される開始位置に対し、所定の行数進んだ行を前記暫定終了位置の初期値とし、
前記制御部は、前記取得データ量が前記基準データ量未満であり、かつ前記暫定終了位置が、前記開始位置を含む意味的または機能的にまとまった単位演算処理の最後に到達していないとき、前記暫定終了位置をn(nは自然数)行、進めるよう前記終了位置設定部に指示し、
前記暫定終了位置が前記単位演算処理の最後に到達したとき、そのときの仮分割プログラムを正式な分割プログラムとすることを特徴とする請求項1に記載のプログラム分割装置。
The end position setting unit sets a line advanced by a predetermined number of lines with respect to the start position specified by the division start position information in the source program as an initial value of the provisional end position,
The control unit, when the acquired data amount is less than the reference data amount, and the provisional end position has not reached the end of the semantically or functionally unit operation processing including the start position, Instructing the end position setting unit to advance the provisional end position by n (n is a natural number) lines,
2. The program dividing apparatus according to claim 1, wherein when the provisional end position reaches the end of the unit calculation process, the temporary dividing program at that time is an official dividing program.
前記仮分割プログラムを保持する仮分割プログラム保持部と、
前記暫定終了位置が変更されるたび、前記仮分割プログラム保持部に前記仮分割プログラムを登録する仮分割プログラム登録部をさらに備え、
前記変換指示部は、前記暫定終了位置が変更されるたび、前記仮分割プログラムをコンパイルするよう前記コンパイラに指示し、
前記制御部は、前記取得データ量が前記基準データ量を超えたとき、前記仮分割プログラム保持部に超える前の最後に登録された仮分割プログラムを正式な分割プログラムとすることを特徴とする請求項1または2に記載のプログラム分割装置。
A temporary division program holding unit for holding the temporary division program;
A temporary division program registration unit for registering the temporary division program in the temporary division program holding unit each time the provisional end position is changed;
The conversion instruction unit instructs the compiler to compile the temporary divided program every time the temporary end position is changed,
The control unit, when the acquired data amount exceeds the reference data amount, sets the temporary division program registered last before exceeding the temporary division program holding unit as a formal division program. Item 3. The program dividing device according to Item 1 or 2.
前記制御部は、前記暫定終了位置が、前記開始位置のネストより下位のネストに到達したとき、前記変換指示部に、前記仮分割プログラムのコンパイルを前記コンパイラに指示しないよう指示し、前記開始位置と同位のネストに到達するまで、前記暫定終了位置を進めるよう前記終了位置設定部に指示することを特徴とする請求項1から3のいずれかに記載のプログラム分割装置。   The control unit instructs the conversion instruction unit not to instruct the compiler to compile the temporary divided program when the provisional end position reaches a lower nest than the start position nest, and the start position 4. The program dividing device according to claim 1, wherein the end position setting unit is instructed to advance the provisional end position until the nest of the same level is reached. 5. 前記仮分割プログラムを保持する仮分割プログラム保持部と、
前記暫定終了位置が変更されるたび、前記仮分割プログラム保持部に前記仮分割プログラムを登録する仮分割プログラム登録部をさらに備え、
前記終了位置設定部は、前記ソースプログラム内において、前記分割開始位置情報で特定される開始位置の行と、その開始位置を含む意味的または機能的にまとまった単位演算処理の最終行と、の半分の位置にある行を前記暫定終了位置の初期値とし、
前記制御部は、前記取得データ量が前記基準データ量を超えるとき、初期では、前記開始位置の行から前記最終行までの1/4の行数、二回目以降では、前記暫定終了位置を前回移動した行数の半分の行数、戻すよう前記終了位置設定部に指示し、
前記取得データ量が前記基準データ量未満のとき、初期では、前記開始位置の行から前記最終行までの1/4の行数、二回目以降では、前記暫定終了位置を前回移動した行数の半分の行数、進めるよう前記終了位置設定部に指示し、
前記暫定終了位置が前回移動した行数が一のとき、前記取得データ量が前記基準データ量以下である仮分割プログラムのうち、前記仮分割プログラム保持部に最後に登録された仮分割プログラムを正式な分割プログラムとすることを特徴とする請求項1に記載のプログラム分割装置。
A temporary division program holding unit for holding the temporary division program;
A temporary division program registration unit for registering the temporary division program in the temporary division program holding unit each time the provisional end position is changed;
The end position setting unit includes, in the source program, a line of a start position specified by the division start position information and a final line of a unit operation process that is semantically or functionally grouped including the start position. The line at half the position is the initial value of the provisional end position,
When the acquired data amount exceeds the reference data amount, the control unit initially sets a quarter number of lines from the start position line to the last line, and after the second time, sets the provisional end position to the previous time. Instruct the end position setting unit to return the number of lines that is half the number of moved lines,
When the amount of acquired data is less than the reference data amount, initially, the number of lines is ¼ from the line at the start position to the last line, and after the second time, the provisional end position is the number of lines that have been moved last time. Instruct the end position setting unit to advance by half the number of lines,
When the temporary end position is the number of lines moved last time, among the temporary division programs whose acquired data amount is equal to or less than the reference data amount, the temporary division program last registered in the temporary division program holding unit is formally The program dividing apparatus according to claim 1, wherein the program dividing apparatus is a unique dividing program.
前記制御部は、前記変換結果取得部が前記コンパイラからエラーを取得したとき、そのときの仮分割プログラムを前記仮分割プログラム保持部に登録しないよう、前記仮分割プログラム登録部に指示することを特徴とする請求項3または5に記載のプログラム分割装置。   When the conversion result acquisition unit acquires an error from the compiler, the control unit instructs the temporary division program registration unit not to register the temporary division program at that time in the temporary division program holding unit. The program dividing apparatus according to claim 3 or 5. 前記オブジェクトデータ量保持部は、プロセッサの単位時間当たりの実行ステップ数、または使用メモリサイズで規定されるオブジェクトデータ量を保持することを特徴とする請求項1から6のいずれかに記載のプログラム分割装置。   7. The program division according to claim 1, wherein the object data amount holding unit holds an object data amount defined by the number of execution steps per unit time of a processor or a used memory size. apparatus. 前記オブジェクトデータ量保持部は、y(yは2以上の整数)個の演算器を含む演算器列で、またはx×y(x、yは2以上の整数)で二次元配置された複数の演算器を含む演算アレイで、m(mは自然数)サイクルに実行可能なステップ数で規定されるオブジェクトデータ量を保持することを特徴とする請求項1から6のいずれかに記載のプログラム分割装置。   The object data amount holding unit is a computing unit array including y computing units (y is an integer of 2 or more), or a plurality of two-dimensionally arranged x × y (x and y are integers of 2 or more). 7. The program dividing apparatus according to claim 1, wherein an object data amount defined by the number of steps executable in m (m is a natural number) cycle is held in an arithmetic array including an arithmetic unit. . ソースプログラムを分割する分割方法であって、
基準とすべきオブジェクトデータ量を基準データ量としてオブジェクトデータ量保持部に保持する第1ステップと、
前記ソースプログラム内から、分割開始位置情報を開始位置情報検出部により検出する第2ステップと、
前記開始位置情報検出部により検出された分割開始位置情報で特定される開始位置から始まる分割プログラムの暫定終了位置を終了位置設定部により定める第3ステップと、
前記開始位置と、前記終了位置設定部により定められる暫定終了位置とで規定される仮分割プログラムをコンパイルするよう所定のコンパイラに、変換指示部により指示する第4ステップと、
前記変換指示部による指示に応じた、前記コンパイラの変換結果に対応するオブジェクトデータ量を取得データ量として変換結果取得部により取得する第5ステップと、
前記オブジェクトデータ量保持部により保持される基準データ量と、前記変換結果取得部により取得される取得データ量とを比較し、その比較結果に応じて前記終了位置設定部を制御部により制御する第6ステップと、を備え、
前記第6ステップは、前記基準データ量と前記取得データ量とが一致または近づくように前記暫定終了位置を変更するよう、前記終了位置設定部を制御することを特徴とするプログラム分割方法。
A dividing method for dividing a source program,
A first step of holding the object data amount to be a reference as a reference data amount in the object data amount holding unit;
A second step of detecting division start position information from within the source program by a start position information detection unit;
A third step of determining a provisional end position of the division program starting from the start position specified by the division start position information detected by the start position information detection section by the end position setting section;
A fourth step of instructing a predetermined compiler to compile a provisional division program defined by the start position and the provisional end position determined by the end position setting unit by a conversion instruction unit;
A fifth step of acquiring, by the conversion result acquisition unit, an object data amount corresponding to the conversion result of the compiler in accordance with an instruction from the conversion instruction unit as an acquisition data amount;
The reference data amount held by the object data amount holding unit is compared with the acquired data amount acquired by the conversion result acquiring unit, and the end position setting unit is controlled by the control unit according to the comparison result. 6 steps,
In the sixth step, the end position setting unit is controlled so as to change the provisional end position so that the reference data amount and the acquired data amount match or approach each other.
ソースプログラムを分割するプログラム分割装置であって、
前記ソースプログラム内から分割開始位置情報を検出する開始位置情報検出部と、
前記ソースプログラム内から分割終了位置情報を検出する終了位置情報検出部と、
前記開始位置情報検出部により検出された分割開始位置情報で特定される開始位置と、前記終了位置情報検出部により検出された分割終了位置情報で特定される終了位置とで規定される分割プログラムをコンパイルするよう所定のコンパイラに指示する変換指示部と、
前記変換指示部による指示に応じた、前記コンパイラの変換結果を取得する変換結果取得部と、
を備えることを特徴とするプログラム分割装置。
A program dividing device for dividing a source program,
A start position information detecting unit for detecting division start position information from within the source program;
An end position information detection unit for detecting division end position information from within the source program;
A division program defined by a start position specified by the division start position information detected by the start position information detection unit and an end position specified by the division end position information detected by the end position information detection unit A conversion instruction section for instructing a predetermined compiler to compile,
A conversion result acquisition unit that acquires a conversion result of the compiler in response to an instruction from the conversion instruction unit;
A program dividing apparatus comprising:
JP2008037825A 2008-02-19 2008-02-19 Program dividing apparatus and method Active JP5197061B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008037825A JP5197061B2 (en) 2008-02-19 2008-02-19 Program dividing apparatus and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008037825A JP5197061B2 (en) 2008-02-19 2008-02-19 Program dividing apparatus and method

Publications (2)

Publication Number Publication Date
JP2009199175A true JP2009199175A (en) 2009-09-03
JP5197061B2 JP5197061B2 (en) 2013-05-15

Family

ID=41142629

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008037825A Active JP5197061B2 (en) 2008-02-19 2008-02-19 Program dividing apparatus and method

Country Status (1)

Country Link
JP (1) JP5197061B2 (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002123563A (en) * 2000-10-13 2002-04-26 Nec Corp Compiling method, composing device, and recording medium
WO2002099704A1 (en) * 2001-05-30 2002-12-12 Yozan Inc. System development supporting apparatus, system development supporting method, and computer-readable recorded medium
JP2006099720A (en) * 2004-08-30 2006-04-13 Sanyo Electric Co Ltd Data flow graph processing method
JP2007219586A (en) * 2006-02-14 2007-08-30 Matsushita Electric Ind Co Ltd Source code analysis device
JP2007241364A (en) * 2006-03-06 2007-09-20 Canon Software Inc Program generation device, program generation method, program and recording medium
JP2007241695A (en) * 2006-03-09 2007-09-20 Sanyo Electric Co Ltd Generation method for data flow graph and processor
JP2007286671A (en) * 2006-04-12 2007-11-01 Fujitsu Ltd Software/hardware division program and division method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002123563A (en) * 2000-10-13 2002-04-26 Nec Corp Compiling method, composing device, and recording medium
WO2002099704A1 (en) * 2001-05-30 2002-12-12 Yozan Inc. System development supporting apparatus, system development supporting method, and computer-readable recorded medium
JP2006099720A (en) * 2004-08-30 2006-04-13 Sanyo Electric Co Ltd Data flow graph processing method
JP2007219586A (en) * 2006-02-14 2007-08-30 Matsushita Electric Ind Co Ltd Source code analysis device
JP2007241364A (en) * 2006-03-06 2007-09-20 Canon Software Inc Program generation device, program generation method, program and recording medium
JP2007241695A (en) * 2006-03-09 2007-09-20 Sanyo Electric Co Ltd Generation method for data flow graph and processor
JP2007286671A (en) * 2006-04-12 2007-11-01 Fujitsu Ltd Software/hardware division program and division method

Also Published As

Publication number Publication date
JP5197061B2 (en) 2013-05-15

Similar Documents

Publication Publication Date Title
JP2921190B2 (en) Parallel execution method
US20090113404A1 (en) Optimum code generation method and compiler device for multiprocessor
KR101279179B1 (en) Parallel program generation method
US20040083468A1 (en) Instruction scheduling method, instruction scheduling device, and instruction scheduling program
JP5148674B2 (en) Program parallelization apparatus and program
US20060130012A1 (en) Program conversion device, program conversion and execution device, program conversion method, and program conversion and execution method
US9195444B2 (en) Compiler method and compiler apparatus for optimizing a code by transforming a code to another code including a parallel processing instruction
JP2004038225A (en) Compiler program and compiling method
JP2009524866A (en) System and method for parallel execution of programs
JP2015194881A (en) Compilation device, compilation program, and compilation method
US20200310766A1 (en) Generating vectorized control flow using reconverging control flow graphs
JP2006268070A (en) Parallelizing compilation method and parallel computer for executing parallelized object code
JP5197061B2 (en) Program dividing apparatus and method
KR20140131200A (en) Apparatus and Method for translating multithreaded program code
JP5504879B2 (en) Multithread processing method and multithread processing apparatus
KR102161055B1 (en) Method and Apparatus for instruction scheduling using software pipelining
US10089088B2 (en) Computer that performs compiling, compiler program, and link program
JP4535912B2 (en) Data flow graph generator
JP5385103B2 (en) Macro expansion method and preprocessor
JP6175306B2 (en) Control program dividing apparatus, control program dividing method and recording medium therefor
JPH04293150A (en) Compiling method
JP2008015665A (en) Program analysis method and program analyzer
JP2007108838A (en) Compile method and compile device
JP4084374B2 (en) Loop parallelization method and compiling device
JPH1196018A (en) Compiling device, its method and computer-readable recording medium recording compiling execution program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110128

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20121106

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20121120

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20121210

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: 20130108

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130205

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20160215

Year of fee payment: 3

R151 Written notification of patent or utility model registration

Ref document number: 5197061

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20160215

Year of fee payment: 3