JP2012113518A - Compiler device, code generation method and program - Google Patents

Compiler device, code generation method and program Download PDF

Info

Publication number
JP2012113518A
JP2012113518A JP2010262072A JP2010262072A JP2012113518A JP 2012113518 A JP2012113518 A JP 2012113518A JP 2010262072 A JP2010262072 A JP 2010262072A JP 2010262072 A JP2010262072 A JP 2010262072A JP 2012113518 A JP2012113518 A JP 2012113518A
Authority
JP
Japan
Prior art keywords
code
data area
register
program
area
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.)
Withdrawn
Application number
JP2010262072A
Other languages
Japanese (ja)
Inventor
Yo Inoue
庸 井上
Atsushi Suzuki
敦 鈴木
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.)
Renesas Electronics Corp
Original Assignee
Renesas Electronics 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 Renesas Electronics Corp filed Critical Renesas Electronics Corp
Priority to JP2010262072A priority Critical patent/JP2012113518A/en
Publication of JP2012113518A publication Critical patent/JP2012113518A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PROBLEM TO BE SOLVED: To make it possible to access all areas by using register relative access when there are multiple data areas such as a data area for each core and a shared data area shared between cores in an asymmetric multi-core processor.SOLUTION: A compiler device for a multi-core processor performs following steps if there are multiple data areas such as a data area for each core and a shared data area shared between cores: generating a code which saves a register value for register relative access at the beginning of a function in a common program area to a saving destination (such as a data area for each core); and generating a code which overwrites the register value for register relative access with the first address of the shared data area and a code which rewrites (overwrites) the register value for register relative access with the value saved in the saving destination when the function ends (right before the process to branch to an invoker of the function).

Description

本発明は、コンパイラ装置に関し、特に非対称型マルチコア・プロセッサ向けコンパイラ装置に関する。   The present invention relates to a compiler apparatus, and more particularly to a compiler apparatus for an asymmetric multi-core processor.

近年、半導体集積回路が多くの製品に搭載されて複雑な制御を行うようになり、処理能力を向上するために1つの半導体集積回路に複数のプロセッサ・コアを実装したマルチコア・プロセッサが採用されるようになってきた。   In recent years, semiconductor integrated circuits have been installed in many products to perform complex control, and a multi-core processor in which a plurality of processor cores are mounted on one semiconductor integrated circuit is adopted in order to improve processing capability. It has become like this.

マルチコア・プロセッサは、複数のプロセッサ・コアを実装することによる処理能力の向上と、複数のプロセッサを1つにすることによる省消費電力化を期待できる。   A multi-core processor can be expected to improve processing capability by mounting a plurality of processor cores and to reduce power consumption by combining a plurality of processors.

その流れの中で、マルチコア・プロセッサを制御するためのプログラムを開発するための開発ツールであるコンパイラ装置も、各PE(Proccer Element:演算ユニットの単位(ここでは、コア))間で制御できるオブジェクトコード(以下、コードと呼ぶ)の生成の必要性が高まってきた。   In that flow, a compiler device that is a development tool for developing a program for controlling a multi-core processor is also an object that can be controlled between each PE (Processor Element: a unit of arithmetic unit (here, core)). The need to generate code (hereinafter referred to as code) has increased.

特に、コア間で共有するプログラムからメモリアクセスを行う場合に、絶対アドレス参照を行うプログラムが一般的であるが、コードの効率が良いレジスタ相対アクセスも使用可能にする要求が高まっている。   In particular, when performing memory access from a program shared between cores, a program that performs absolute address reference is common, but there is an increasing demand for enabling register relative access with high code efficiency.

<特許文献1>
特許文献1(特開2006−058991号公報)には、従来のコンパイラ装置の例が開示されている。
<Patent Document 1>
Japanese Unexamined Patent Application Publication No. 2006-058991 discloses an example of a conventional compiler apparatus.

従来のコンパイラ装置は、データ領域へのデータ割り付けの最適化を目的とし、データのアクセス回数をコンパイル時に調査し、アクセス回数が多い順に並び替えてデータ領域に配置する機能を有し、データへのアクセスを可能な限り相対アクセスで行うコードを出力する。   The conventional compiler device has the function of optimizing the data allocation to the data area, checking the number of data accesses at the time of compilation, and rearranging them in the descending order of the number of accesses and placing them in the data area. Outputs code that performs relative access as much as possible.

[従来のコンパイラ装置]
図1に示すように、従来のコンパイラ装置は、構文解析処理部1と、中間言語レベル最適化部2と、コード生成処理部3と、ソースプログラム格納部4と、中間言語格納部5と、オブジェクトプログラム格納部6を備える。
[Conventional compiler equipment]
As shown in FIG. 1, a conventional compiler apparatus includes a syntax analysis processing unit 1, an intermediate language level optimization unit 2, a code generation processing unit 3, a source program storage unit 4, an intermediate language storage unit 5, An object program storage unit 6 is provided.

構文解析処理部1は、ソースプログラム格納部4に格納されている高級言語で記述されたソースプログラムを入力して構文解析を行う。構文解析処理部1は、構文解析結果を、中間言語格納部5に格納する。   The syntax analysis processing unit 1 inputs a source program described in a high-level language stored in the source program storage unit 4 and performs syntax analysis. The syntax analysis processing unit 1 stores the syntax analysis result in the intermediate language storage unit 5.

中間言語レベル最適化部2は、中間言語格納部5に格納されている構文解析処理部1による構文解析結果を入力し、コード生成時の効率を上げるための最適化を行う。中間言語レベル最適化部2は、最適化結果を、中間言語格納部5に格納する。   The intermediate language level optimization unit 2 inputs the syntax analysis result by the syntax analysis processing unit 1 stored in the intermediate language storage unit 5, and performs optimization for increasing the efficiency at the time of code generation. The intermediate language level optimization unit 2 stores the optimization result in the intermediate language storage unit 5.

コード生成処理部3は、中間言語格納部5に格納されている中間言語レベル最適化部2による最適化結果を入力してコードを生成する。コード生成処理部3は、生成されたコードを、オブジェクトプログラム格納部6に格納する。   The code generation processing unit 3 inputs the optimization result by the intermediate language level optimization unit 2 stored in the intermediate language storage unit 5 and generates a code. The code generation processing unit 3 stores the generated code in the object program storage unit 6.

[コード生成処理部]
図2に示すように、コード生成処理部3は、ノード変換処理部7と、レジスタ割り付け処理部8と、アドレス割り付け処理部9と、コード出力処理部10を備える。
[Code generation processing section]
As shown in FIG. 2, the code generation processing unit 3 includes a node conversion processing unit 7, a register allocation processing unit 8, an address allocation processing unit 9, and a code output processing unit 10.

ノード変換処理部7は、中間言語格納部5に格納されている中間言語レベル最適化部2による最適化結果を入力してノード変換処理を行う。ノード変換処理部7は、ノード変換結果を、ノード格納部11に格納する。   The node conversion processing unit 7 inputs the optimization result by the intermediate language level optimization unit 2 stored in the intermediate language storage unit 5 and performs node conversion processing. The node conversion processing unit 7 stores the node conversion result in the node storage unit 11.

レジスタ割り付け処理部8は、データのレジスタ割り付け処理を行う。レジスタ割り付け処理部8は、レジスタ割り付け結果を、ノード格納部11に格納する。   The register allocation processing unit 8 performs data register allocation processing. The register allocation processing unit 8 stores the register allocation result in the node storage unit 11.

アドレス割り付け処理部9は、レジスタが割り付かなかったデータのアドレス割り付け処理を行う。アドレス割り付け処理部9は、アドレス割り付け結果を、ノード格納部11に格納する。   The address allocation processing unit 9 performs an address allocation process for data that has not been allocated by the register. The address allocation processing unit 9 stores the address allocation result in the node storage unit 11.

コード出力処理部10は、コードの出力処理を行う。   The code output processing unit 10 performs code output processing.

[アドレス割り付け処理部]
図3に示すように、アドレス割り付け処理部9は、データ管理情報テーブル連鎖機構13と、データアクセス回数登録処理部14と、データ管理情報テーブル連鎖並べ替え処理部15と、データのアドレス割り付け処理部16を備える。
[Address assignment processing section]
As shown in FIG. 3, the address allocation processing unit 9 includes a data management information table chain mechanism 13, a data access count registration processing unit 14, a data management information table chain rearrangement processing unit 15, and a data address allocation processing unit. 16.

データ管理情報テーブル連鎖機構13は、データ毎のデータ管理情報テーブル12(12−i、i=1〜n:nはテーブル数)を有する。   The data management information table chain mechanism 13 has a data management information table 12 (12-i, i = 1 to n: n is the number of tables) for each data.

データ管理情報テーブル12(12−i、i=1〜n)の各々は、次のデータ管理情報テーブルを指すポインタを書き換え可能に保持し、当該ポインタにより連鎖の並びを有する。データ管理情報テーブル12(12−i、i=1〜n)は、次のデータ管理情報テーブルを指すポインタを書き換え可能に保持する。また、データ管理情報テーブル12(12−i、i=1〜n)には、データの管理情報や、データのアクセス回数が登録される。   Each of the data management information tables 12 (12-i, i = 1 to n) holds a pointer to the next data management information table in a rewritable manner, and has a chain sequence by the pointer. The data management information table 12 (12-i, i = 1 to n) holds a pointer indicating the next data management information table in a rewritable manner. Data management information and the number of data accesses are registered in the data management information table 12 (12-i, i = 1 to n).

データアクセス回数登録処理部14は、データ管理情報テーブル12(12−i、i=1〜n)に、データ毎のデータアクセス回数を登録する。   The data access count registration processing unit 14 registers the data access count for each data in the data management information table 12 (12-i, i = 1 to n).

データ管理情報テーブル連鎖並べ替え処理部15は、データアクセス回数登録処理部14によるデータ管理情報テーブル12(12−i、i=1〜n)へのデータアクセス回数の登録終了後、データ管理情報テーブル12(12−i、i=1〜n)の連鎖の並びをデータアクセス回数の多い順番に並べ替える。   The data management information table chain rearrangement processing unit 15 performs the data management information table after the data access frequency registration processing unit 14 finishes registering the data access frequency to the data management information table 12 (12-i, i = 1 to n). The sequence of 12 (12-i, i = 1 to n) is rearranged in descending order of the number of data accesses.

データのアドレス割り付け処理部16は、データ管理情報テーブル連鎖並べ替え処理部15によるデータ管理情報テーブル12(12−i、i=1〜n)の連鎖の並べ替え後に、データのアドレス割り付け処理を行う。   The data address allocation processing unit 16 performs data address allocation processing after the data management information table 12 (12-i, i = 1 to n) is rearranged by the data management information table chain rearrangement processing unit 15. .

[従来のコンパイラ装置の特徴]
以上のように、従来のコンパイラ装置では、データ毎のデータ管理情報テーブル12(12−i、i=1〜n)が用意され、データアクセス回数登録部14によりデータ管理情報テーブル12(12−i、i=1〜n)にデータ毎のデータアクセス回数が登録され、その後、データ管理情報テーブル連鎖並べ替え処理部15により、登録されたデータアクセス回数が多い順となるようにデータ管理情報テーブルの連鎖が並べ替えられる。
[Characteristics of conventional compiler equipment]
As described above, in the conventional compiler apparatus, the data management information table 12 (12-i, i = 1 to n) for each data is prepared, and the data management information table 12 (12-i) is registered by the data access count registration unit 14. , I = 1 to n), the number of data accesses for each data is registered, and then the data management information table chain rearrangement processing unit 15 sets the data management information table so that the number of registered data accesses is in descending order. The chain is reordered.

そして、データのアドレス割り付け処理部16により、アドレス回数が多いデータほどベースアドレスに近い位置に配置されるように、アクセス回数の多いデータ用のデータ管理情報テーブルの順にベースアドレスからの相対距離が割り付けられるので、事前のアドレス計算や相対距離のレジスタへの転送の出現回数が減少することになる。   Then, the data address assignment processing unit 16 assigns the relative distance from the base address in the order of the data management information table for the data having the higher access count so that the data with the higher address count is arranged closer to the base address. Therefore, the number of appearances of prior address calculation and transfer to the register of the relative distance is reduced.

<特許文献2>
また、関連する技術として、特許文献2(特開2000−029717号公報)には、オブジェクト生成方法及びその処理手順を記憶した媒体、及びにオブジェクト生成装置が開示されている。この関連技術では、高級言語を機械命令に翻訳する際に、変数のアドレスをそのアドレスの全体によって表現した場合と、基点のアドレスとしてのベースポインタの値をレジスタに保持し、そのレジスタの値からの相対値としての表現した場合との効率を比較し、比較結果に基づき、より効率の良い表現を採用したオブジェクトを生成する。
<Patent Document 2>
Further, as a related technique, Patent Document 2 (Japanese Patent Laid-Open No. 2000-029717) discloses an object generation method, a medium storing a processing procedure thereof, and an object generation apparatus. In this related technology, when a high-level language is translated into a machine instruction, the address of the variable is expressed by the entire address, and the value of the base pointer as the base address is held in the register. Compare the efficiency with the relative value expressed as a relative value, and generate an object that adopts a more efficient expression based on the comparison result.

特開2006−058991号公報JP 2006-058991 A 特開2000−029717号公報JP 2000-029717 A

従来のコンパイラ装置には、非対称マルチコア・プロセッサのようにコア毎のデータ領域とコア間で共有する共有データ領域等の複数のデータ領域がある場合に、全ての領域に対してレジスタ相対アクセスを使用してアクセスすることができないという問題がある。   Conventional compiler devices use register-relative access to all areas when there are multiple data areas such as a data area for each core and a shared data area shared between cores as in an asymmetric multi-core processor. And cannot be accessed.

その理由は、非対称マルチコア・プロセッサでは、コア毎のデータ領域と共有のデータ領域は、通常は連続ではない離れた領域に配置されているため、レジスタ相対アクセスでアクセスできる範囲に、これら全ての領域が収まらず、コア毎のデータ領域と共有のデータ領域の両方に対してレジスタ相対アクセスすることができないためである。   The reason for this is that in an asymmetric multi-core processor, the data area for each core and the shared data area are usually arranged in separate areas that are not continuous, so all these areas are within the range accessible by register-relative access. This is because the register relative access to both the data area for each core and the shared data area is impossible.

本発明のコンパイラ装置は、非対称型マルチコア・プロセッサ向けコンパイラ装置であって、原始プログラムの構文解析結果を基に、変数のアクセス解析を行い、変数の参照元及び参照回数の解析情報を取得する手段と、当該解析情報を基に、変数の配置を行った後、中間言語(Intermediate language)で中間コードを作成する手段と、当該中間コードからオブジェクトコードを生成する際、共通プログラムか否か判断し、共通プログラムである場合、共通プログラム領域から共有データ領域にレジスタ相対アクセスするコードを追加する手段とを具備する。   The compiler apparatus according to the present invention is a compiler apparatus for an asymmetric multi-core processor, and is a means for performing variable access analysis based on a syntax analysis result of a source program and obtaining analysis information of a variable reference source and a reference count Based on the analysis information, after arranging the variables, a means for creating intermediate code in an intermediate language and whether or not the object code is generated from the intermediate code is a common program. In the case of a common program, a means for adding a register relative access from the common program area to the shared data area is provided.

本発明のコード生成方法は、非対称型マルチコア・プロセッサ向けコンパイラ装置により実施されるコード生成方法であって、原始プログラムの構文解析結果を基に、変数のアクセス解析を行い、変数の参照元及び参照回数の解析情報を取得することと、当該解析情報を基に、変数の配置を行った後、中間言語で中間コードを作成することと、当該中間コードからオブジェクトコードを生成する際、共通プログラムか否か判断し、共通プログラムである場合、共通プログラム領域から共有データ領域にレジスタ相対アクセスするコードを追加することとを含む。   The code generation method of the present invention is a code generation method implemented by a compiler device for an asymmetric multi-core processor, and performs access analysis of a variable based on a result of syntax analysis of a source program, and a variable reference source and reference When obtaining the analysis information of the number of times, arranging the variables based on the analysis information, creating intermediate code in the intermediate language, and generating object code from the intermediate code If it is a common program, adding a code for register relative access from the common program area to the shared data area is included.

本発明のプログラムは、上記のコード生成方法における処理を、計算機に実行させるためのプログラムである。なお、本発明のプログラムは、記憶装置や記憶媒体に格納することが可能である。   The program of the present invention is a program for causing a computer to execute the processing in the above code generation method. Note that the program of the present invention can be stored in a storage device or a storage medium.

非対称マルチコア・プロセッサのようにコア毎のデータ領域とコア間で共有する共有データ領域等の複数のデータ領域がある場合に、全ての領域に対してレジスタ相対アクセスを使用してアクセスすることができる。   When there are multiple data areas such as a data area for each core and a shared data area shared between cores as in an asymmetric multi-core processor, all areas can be accessed using register relative access. .

従来のコンパイラ装置の構成図である。It is a block diagram of the conventional compiler apparatus. 従来のコンパイラ装置におけるコード生成処理部の構成図である。It is a block diagram of the code generation process part in the conventional compiler apparatus. 上記のコード生成処理部におけるアドレス割り付け処理部の構成図である。It is a block diagram of the address allocation process part in said code generation process part. 本発明のコンパイラ装置の構成図である。It is a block diagram of the compiler apparatus of this invention. 実行時のアドレス空間における目的プログラムの配置図である。It is a layout diagram of the target program in the address space at the time of execution. 従来と同じくアクセス方法を選択するコード生成処理を示すフローチャートである。It is a flowchart which shows the code | cord | chord generation process which selects an access method similarly to the past. 全ての領域に対してレジスタ相対アクセスを使用するコード生成処理を示すフローチャートである。It is a flowchart which shows the code production | generation process which uses register relative access with respect to all the areas. 全ての領域に対してレジスタ相対アクセスを使用する目的プログラムの実行処理を示すフローチャートである。It is a flowchart which shows the execution process of the object program which uses register relative access with respect to all the areas.

以下に、本発明の第1実施形態について添付図面を参照して説明する。
図4に示すように、本発明のコンパイラ装置100は、読み込み部101と、字句解析部102と、構文解析部103と、変数アクセス解析部104と、変数配置部105と、中間語作成部106と、最適化部107と、コード生成部108を備える。
Hereinafter, a first embodiment of the present invention will be described with reference to the accompanying drawings.
As shown in FIG. 4, the compiler apparatus 100 of the present invention includes a reading unit 101, a lexical analysis unit 102, a syntax analysis unit 103, a variable access analysis unit 104, a variable placement unit 105, and an intermediate language creation unit 106. And an optimization unit 107 and a code generation unit 108.

読み込み部101は、原始プログラムを読み込む。原始プログラムは、原始プログラム格納部110に格納されているソースプログラム(ソースコード)である。   The reading unit 101 reads a source program. The source program is a source program (source code) stored in the source program storage unit 110.

字句解析部102は、原始プログラムの字句解析を行い、字句(トークン)を作成する。字句解析部102は、字句(トークン)を中間データ格納部120に格納する。   The lexical analysis unit 102 performs lexical analysis of the source program and creates a lexical (token). The lexical analysis unit 102 stores the lexical (token) in the intermediate data storage unit 120.

構文解析部103は、字句解析部102で作成した字句(トークン)を基に構文解析を行い、字句(トークン)の並びが文法に照らして正しいかのエラー・チェックを行う。構文解析部103は、構文解析結果を中間データ格納部120に格納する。   The syntax analysis unit 103 performs syntax analysis based on the lexical phrase (token) created by the lexical analysis unit 102, and checks whether the sequence of the lexical phrase (token) is correct according to the grammar. The syntax analysis unit 103 stores the syntax analysis result in the intermediate data storage unit 120.

変数アクセス解析部104は、構文解析部103で得た構文解析結果を基に、変数のアクセス解析を行い、変数の参照元と参照回数の解析情報を得る。変数アクセス解析部104は、この解析情報を中間データ格納部120に格納する。   The variable access analysis unit 104 performs variable access analysis based on the syntax analysis result obtained by the syntax analysis unit 103 to obtain analysis information of the variable reference source and the reference count. The variable access analysis unit 104 stores this analysis information in the intermediate data storage unit 120.

変数配置部105は、変数アクセス解析部104で得た解析情報を基に、変数の配置を行う。変数配置部105は、変数の配置結果を中間データ格納部120に格納する。   The variable placement unit 105 performs variable placement based on the analysis information obtained by the variable access analysis unit 104. The variable placement unit 105 stores the variable placement result in the intermediate data storage unit 120.

中間語作成部106は、変数の配置が行われた後、原始プログラムを基に、中間言語(Intermediate language)で中間コードを作成する。中間語作成部106は、中間コードを中間データ格納部120に格納する。   After the variables are arranged, the intermediate language creation unit 106 creates an intermediate code in an intermediate language based on the source program. The intermediate language creation unit 106 stores the intermediate code in the intermediate data storage unit 120.

最適化部107は、中間データ格納部120に格納されている各種情報を基に、中間コードの最適化を行い、中間コードの高速化、サイズの低減を行う。最適化部107は、最適化された中間コードを中間データ格納部120に格納する。   The optimization unit 107 optimizes the intermediate code based on various types of information stored in the intermediate data storage unit 120, and increases the speed and size of the intermediate code. The optimization unit 107 stores the optimized intermediate code in the intermediate data storage unit 120.

コード生成部108は、最適化された中間コードに基づいてコードを生成し、目的プログラムが完成すると、目的プログラムを目的プログラム格納部130に格納する。目的プログラムは、実行可能な形式で記述されたオブジェクトプログラム(オブジェクトコード)である。   The code generation unit 108 generates a code based on the optimized intermediate code, and stores the target program in the target program storage unit 130 when the target program is completed. The target program is an object program (object code) described in an executable format.

[ハードウェアの例示]
コンパイラ装置100の例として、PC(パソコン)、アプライアンス(appliance)、ワークステーション、メインフレーム、スーパーコンピュータ等の計算機を想定している。なお、コンパイラ装置100は、物理マシン上に構築された仮想マシン(Virtual Machine(VM))でも良い。
[Hardware example]
As an example of the compiler apparatus 100, a computer such as a PC (personal computer), an appliance, a workstation, a main frame, or a supercomputer is assumed. The compiler apparatus 100 may be a virtual machine (Virtual Machine (VM)) constructed on a physical machine.

読み込み部101の例として、外部の入力装置や記憶装置、或いは他の計算機から情報を取得するためのインターフェース(I/F:interface)を想定している。入力装置の例として、KVM(キーボード・ビデオ・マウス)、コンソール(console)、タッチパネル(touch panel)、タブレット(tablet)、又は各種の情報伝達媒体の読取装置等が考えられる。   As an example of the reading unit 101, an interface (I / F: interface) for acquiring information from an external input device, a storage device, or another computer is assumed. As an example of the input device, a KVM (keyboard / video / mouse), a console, a touch panel, a tablet, or a reading device for various information transmission media can be considered.

字句解析部102、構文解析部103、変数アクセス解析部104、変数配置部105、中間語作成部106、最適化部107、及びコード生成部108は、プログラムに基づいて駆動し所定の処理を実行するプロセッサと、当該プログラムや各種データを記憶するメモリとによって実現される。   The lexical analysis unit 102, the syntax analysis unit 103, the variable access analysis unit 104, the variable placement unit 105, the intermediate language creation unit 106, the optimization unit 107, and the code generation unit 108 are driven based on a program and execute predetermined processing. And a memory that stores the program and various data.

上記のプロセッサの例として、CPU(Central Processing Unit)、マイクロプロセッサ(microprocessor)、マイクロコントローラ、或いは、専用の機能を有する半導体集積回路(Integrated Circuit(IC))等が考えられる。   As an example of the above processor, a CPU (Central Processing Unit), a microprocessor (microprocessor), a microcontroller, or a semiconductor integrated circuit (Integrated Circuit (IC)) having a dedicated function can be considered.

上記のメモリの例として、RAM(Random Access Memory)、ROM(Read Only Memory)、EEPROM(Electrically Erasable and Programmable Read Only Memory)やフラッシュメモリ等の半導体記憶装置、HDD(Hard Disk Drive)やSSD(Solid State Drive)等の補助記憶装置、又は、DVD(Digital Versatile Disk)等のリムーバブルディスクや、SDメモリカード(Secure Digital memory card)等の記憶媒体(メディア)等が考えられる。   Examples of the above memory include a semiconductor storage device such as a RAM (Random Access Memory), a ROM (Read Only Memory), an EEPROM (Electrically Erasable and Programmable Read Only Memory), a flash memory, and an HDD (HoldSold). An auxiliary storage device such as State Drive), a removable disk such as a DVD (Digital Versatile Disk), a storage medium such as an SD memory card (Secure Digital memory card), or the like is conceivable.

なお、上記のプロセッサ及び上記のメモリは、一体化していても良い。例えば、近年では、マイコン等の1チップ化が進んでいる。従って、計算機等に搭載される1チップマイコンが、プロセッサ及びメモリを備えている事例が考えられる。   Note that the processor and the memory may be integrated. For example, in recent years, a single chip such as a microcomputer has been developed. Therefore, a case where a one-chip microcomputer mounted on a computer or the like includes a processor and a memory can be considered.

原始プログラム格納部110、中間データ格納部120、及び目的プログラム格納部130の例として、上記のメモリや、周辺機器(外付けHDD等)及び外部のサーバ(Webサーバやファイルサーバ等)に設置された記憶装置、或いは、DAS(Direct Attached Storage)、FC−SAN(Fibre Channel − Storage Area Network)、NAS(Network Attached Storage)、IP−SAN(IP − Storage Area Network)等を用いたストレージ装置が考えられる。   Examples of the source program storage unit 110, the intermediate data storage unit 120, and the target program storage unit 130 are installed in the above memory, peripheral devices (external HDD, etc.), and external servers (Web server, file server, etc.). Storage device such as DAS (Direct Attached Storage), FC-SAN (Fibre Channel-Storage Area Network), NAS (Network Attached Storage), IP-SAN (IP-Storage Storage Device). It is done.

但し、実際には、これらの例に限定されない。   However, actually, it is not limited to these examples.

[目的プログラムの実行時のアドレス空間]
図5を参照して、非対称マルチコア・プロセッサにおいて、本発明のコンパイラ装置で生成した目的プログラムが実行される際に、プログラム及びデータが配置されるアドレス空間について説明する。
[Address space when executing the target program]
With reference to FIG. 5, an address space in which a program and data are arranged when an object program generated by the compiler apparatus of the present invention is executed in an asymmetric multi-core processor will be described.

当該アドレス空間200は、PE1用プログラム領域201と、PE2用プログラム領域202と、共通プログラム領域203と、PE1用データ領域204と、PE2用データ領域205と、共有データ領域206を有する。   The address space 200 includes a PE1 program area 201, a PE2 program area 202, a common program area 203, a PE1 data area 204, a PE2 data area 205, and a shared data area 206.

PE1用プログラム領域201及びPE2用プログラム領域202は、コア毎のプログラム領域である。   The PE1 program area 201 and the PE2 program area 202 are program areas for each core.

共通プログラム領域203は、コア間で共有する共通プログラム領域である。   The common program area 203 is a common program area shared between cores.

PE1用データ領域204及びPE2用データ領域205は、コア毎のデータ領域である。   The PE1 data area 204 and the PE2 data area 205 are data areas for each core.

共有データ領域206は、コア間で共有する共有データ領域である。   The shared data area 206 is a shared data area shared between cores.

PE1用プログラム領域201、PE2用プログラム領域202、及び共通プログラム領域203と、PE1用データ領域204と、PE2用データ領域205と、共有データ領域206は、離れたアドレスに配置されている。   The PE1 program area 201, the PE2 program area 202, the common program area 203, the PE1 data area 204, the PE2 data area 205, and the shared data area 206 are arranged at separate addresses.

図5では、「0x」で始まる表記を16進数とする。   In FIG. 5, the notation starting with “0x” is a hexadecimal number.

PE1用プログラム領域201は、「0x000000」番地から「0x003FFF」番地までとする。   The program area 201 for PE1 is from “0x000000” to “0x003FFF”.

PE2用プログラム領域202は、「0x004000」番地から「0x007FFF」番地までとする。   The PE2 program area 202 extends from “0x004000” to “0x007FFF”.

共通プログラム領域203は、「0x008000」番地から「0x009FFF」番地までとする。   The common program area 203 extends from “0x008000” to “0x009FFF”.

PE1用データ領域204は、「0x100000」番地から「0x13FFFF」番地までとする。   The PE1 data area 204 is from the address “0x100000” to the address “0x13FFFF”.

PE2用データ領域205は、「0x200000」番地から「0x23FFFF」番地までとする。   The PE2 data area 205 extends from “0x200000” to “0x23FFFF”.

共有データ領域206は、「0x300000」番地から「0x33FFFF」番地までとする。   The shared data area 206 is from “0x300000” to “0x33FFFF”.

[アクセス方法を選択するコード生成処理]
図6を参照して、従来のようにアクセス方法を選択するコード生成処理について説明する。
[Code generation process to select access method]
With reference to FIG. 6, a code generation process for selecting an access method as in the prior art will be described.

(1)ステップS101
読み込み部101は、原始プログラムを読み込む。
(1) Step S101
The reading unit 101 reads a source program.

(2)ステップS102
字句解析部102は、原始プログラムの字句解析を行う。
(2) Step S102
The lexical analysis unit 102 performs lexical analysis of the source program.

(3)ステップS103
構文解析部103は、原始プログラムの構文解析を行う。
(3) Step S103
The syntax analysis unit 103 performs syntax analysis of the source program.

(4)ステップS104
変数アクセス解析部104は、構文解析結果を基に、変数のアクセス解析を行い、変数の参照元と参照回数の解析情報を取得する。
(4) Step S104
The variable access analysis unit 104 performs variable access analysis based on the syntax analysis result, and acquires analysis information of the variable reference source and the reference count.

(5)ステップS105
変数配置部105は、上記の解析情報を基に、変数の配置を行う。
(5) Step S105
The variable placement unit 105 places variables based on the above analysis information.

(6)ステップS106
中間語作成部106は、変数の配置が行われた後、中間言語で、原始プログラムの中間コードを作成する。
(6) Step S106
After the variables are arranged, the intermediate language creating unit 106 creates an intermediate code of the source program in the intermediate language.

(7)ステップS107
最適化部107は、中間コードの最適化を行う。
(7) Step S107
The optimization unit 107 optimizes the intermediate code.

(8)ステップS108
コード生成部108は、最適化された中間コードに基づいてコード生成を行う際に、共通プログラムであるか否かを判断する。なお、共通プログラムとは、コア間で共有する共通領域のプログラム(共通プログラム領域に格納されたプログラム)である。共通プログラムは、いずれのコアからも実行可能である。ここでは、共通プログラムは、共通プログラム領域に格納されるものとする。
(8) Step S108
The code generation unit 108 determines whether the program is a common program when generating code based on the optimized intermediate code. The common program is a common area program shared between cores (a program stored in the common program area). The common program can be executed from any core. Here, the common program is stored in the common program area.

(9)ステップS109
コード生成部108は、共通プログラムである場合、変数のアクセス方法を絶対アドレス参照に決定する。
(9) Step S109
In the case of a common program, the code generation unit 108 determines the variable access method to be an absolute address reference.

(10)ステップS110
コード生成部108は、共通プログラムでない場合、変数のアクセス方法をレジスタ相対アクセスに決定する。
(10) Step S110
If the code generation unit 108 is not a common program, the code generation unit 108 determines that the variable access method is register relative access.

(11)ステップS111
コード生成部108は、決定した変数のアクセス方法に従ってコードの生成を行い、目的プログラムが完成すると、処理を終了する。
(11) Step S111
The code generation unit 108 generates a code in accordance with the determined variable access method, and ends the process when the target program is completed.

[全ての領域に対してレジスタ相対アクセスを使用するコード生成処理]
図7を参照して、全ての領域に対してレジスタ相対アクセスを使用するコード生成処理について説明する。
[Code generation process using register relative access for all areas]
With reference to FIG. 7, a code generation process using register relative access to all areas will be described.

(1)ステップS201
読み込み部101は、原始プログラムを読み込む。
(1) Step S201
The reading unit 101 reads a source program.

(2)ステップS202
字句解析部102は、原始プログラムの字句解析を行う。
(2) Step S202
The lexical analysis unit 102 performs lexical analysis of the source program.

(3)ステップS203
構文解析部103は、原始プログラムの構文解析を行う。
(3) Step S203
The syntax analysis unit 103 performs syntax analysis of the source program.

(4)ステップS204
変数アクセス解析部104は、構文解析結果を基に、変数のアクセス解析を行い、変数の参照元と参照回数の解析情報を取得する。
(4) Step S204
The variable access analysis unit 104 performs variable access analysis based on the syntax analysis result, and acquires analysis information of the variable reference source and the reference count.

(5)ステップS205
変数配置部105は、上記の解析情報を基に、変数の配置を行う。
(5) Step S205
The variable placement unit 105 places variables based on the above analysis information.

(6)ステップS206
中間語作成部106は、変数の配置が行われた後、中間言語で、原始プログラムの中間コードを作成する。
(6) Step S206
After the variables are arranged, the intermediate language creating unit 106 creates an intermediate code of the source program in the intermediate language.

(7)ステップS207
最適化部107は、中間コードの最適化を行う。
(7) Step S207
The optimization unit 107 optimizes the intermediate code.

(8)ステップS208
コード生成部108は、最適化された中間コードに基づいてコード生成を行う際に、コア間で共有する共通プログラムであるか否かを判断する。ここでは、共通プログラムの場合はステップS209に進み、共通プログラム以外の場合はステップS213に進む。
(8) Step S208
When generating code based on the optimized intermediate code, the code generation unit 108 determines whether or not it is a common program shared between cores. Here, if the program is a common program, the process proceeds to step S209. If the program is not a common program, the process proceeds to step S213.

(9)ステップS209
コード生成部108は、共通プログラムである場合、共通データ領域の先頭アドレスをデータとして保持するシンボルを生成する。
(9) Step S209
In the case of a common program, the code generation unit 108 generates a symbol that holds the start address of the common data area as data.

(10)ステップS210
コード生成部108は、共通プログラム領域203に配置された関数の先頭アドレスに、レジスタ相対アクセス用レジスタの値を退避先(コア毎のデータ領域等)に退避させるコードを追加する。
(10) Step S210
The code generation unit 108 adds a code for saving the value of the register relative access register to the save destination (data area for each core, etc.) at the start address of the function arranged in the common program area 203.

(11)ステップS211
コード生成部108は、レジスタ相対アクセス用レジスタの値に、共有データ領域の先頭アドレスをデータとして保持したシンボル(ステップS209で生成されたシンボル)を上書きするコードを追加する。
(11) Step S211
The code generation unit 108 adds a code for overwriting the symbol (the symbol generated in step S209) holding the start address of the shared data area as data to the register relative access register value.

(12)ステップS212
コード生成部108は、共通プログラム領域に配置された関数の呼び出し元に分岐する処理の直前に、レジスタ相対アクセス用レジスタの値を退避先から復帰させる(退避させた値に書き戻す)コードを追加する。
(12) Step S212
The code generation unit 108 adds a code for restoring the register relative access register value from the save destination (writing back to the saved value) immediately before branching to the caller of the function arranged in the common program area. To do.

(13)ステップS213
コード生成部108は、上記のコード追加処理が終了した場合、又は共通プログラム以外の場合、レジスタ相対アクセスのコードを生成する。コード生成部108は、全ての中間コードをコードとして生成し、目的プログラムが完成すると、処理を終了する。
(13) Step S213
The code generation unit 108 generates a register relative access code when the above-described code addition processing is completed or when the code addition processing is not a common program. The code generation unit 108 generates all intermediate codes as codes, and ends the process when the target program is completed.

[全ての領域に対してレジスタ相対アクセスを使用する目的プログラムの実行処理]
図8を参照して、非対称マルチコア・プロセッサが、上記の目的プログラムを実行した際の動作について説明する。
[Execution processing of target program using register relative access to all areas]
With reference to FIG. 8, an operation when the asymmetric multi-core processor executes the above-described target program will be described.

(1)ステップS301
非対称マルチコア・プロセッサは、PE1用プログラム領域201又はPE2用プログラム領域202の処理から、共通プログラム領域203の処理に分岐する。ここでは、非対称マルチコア・プロセッサは、コアの1つであるPE1において、PE1用プログラム領域201の「0x000500」番地に配置されたPE1のメイン関数を実行して、共通プログラム領域203の「0x008500」番地に配置されたサブ関数を呼び出す。
(1) Step S301
The asymmetric multi-core processor branches from processing in the PE1 program area 201 or PE2 program area 202 to processing in the common program area 203. Here, the asymmetric multi-core processor executes the main function of PE1 arranged at address “0x000500” of the PE1 program area 201 in the PE1, which is one of the cores, and addresses “0x008500” in the common program area 203. Call the subfunction located at.

(2)ステップS302
非対称マルチコア・プロセッサは、サブ関数を実行して、レジスタ相対アクセス用レジスタの値「0x100000」を、退避先であるPE1用データ領域204の「0x10F000」番地に退避させる。これにより、非対称マルチコア・プロセッサは、PE1用データ領域204の「0x10F000」番地において、レジスタ相対アクセス用レジスタの値「0x100000」を保持する。
(2) Step S302
The asymmetric multi-core processor executes the subfunction to save the register relative access register value “0x100000” to the address “0x10F000” in the PE1 data area 204 as the save destination. As a result, the asymmetric multi-core processor holds the register relative access register value “0x100000” at the address “0x10F000” in the PE1 data area 204.

(3)ステップS303
非対称マルチコア・プロセッサは、サブ関数を実行して、レジスタ相対アクセス用レジスタの値「0x100000」を、共有データ領域206の先頭アドレス「0x300000」に書き換える(上書きする)。すなわち、非対称マルチコア・プロセッサは、共有データ領域206の先頭アドレス「0x300000」をデータとして保持するシンボルを生成し、レジスタ相対アクセス用レジスタの値に、このシンボル(共有データ領域206の先頭アドレス)を上書きする。
(3) Step S303
The asymmetric multi-core processor executes the subfunction and rewrites (overwrites) the register relative access register value “0x100000” to the start address “0x300000” of the shared data area 206. In other words, the asymmetric multi-core processor generates a symbol that holds the start address “0x300000” of the shared data area 206 as data, and overwrites this symbol (the start address of the shared data area 206) in the register relative access register value. To do.

(4)ステップS304
非対称マルチコア・プロセッサは、サブ関数を実行して、共通プログラム領域203の「0x008600」番地の命令のレジスタ相対メモリアクセス命令を実行し、共有データ領域206の「0x300100」番地に配置されたデータにアクセスする。
(4) Step S304
The asymmetric multi-core processor executes the subfunction, executes the register relative memory access instruction of the instruction at address “0x008600” in the common program area 203, and accesses the data allocated to the address “0x300100” in the shared data area 206 To do.

(5)ステップS305
非対称マルチコア・プロセッサは、サブ関数を実行して、退避先であるPE1用データ領域204の「0x10F000」番地に退避させた値「0x100000」を、レジスタ相対アクセス用レジスタの値に書き戻す(上書きする)。これにより、非対称マルチコア・プロセッサは、PE1用データ領域204の「0x10F000」番地において保持していたレジスタ相対アクセス用レジスタの値「0x100000」を復帰させる。
(5) Step S305
The asymmetric multi-core processor executes the subfunction to write back (overwrite) the value “0x100000” saved in the “0x10F000” address of the PE1 data area 204 as the save destination to the register relative access register value. ). As a result, the asymmetric multi-core processor restores the register relative access register value “0x100000” held at the address “0x10F000” in the PE1 data area 204.

(6)ステップS306
非対称マルチコア・プロセッサは、サブ関数を実行して、共通プログラム領域203の「0x008800」番地から、PE1の「0x000504」番地のメイン関数に戻る。
(6) Step S306
The asymmetric multi-core processor executes the subfunction and returns from the address “0x008800” of the common program area 203 to the main function of the address “0x000504” of PE1.

上記のように、共通プログラム領域のプログラム実行時に、レジスタ相対アクセス用レジスタが保持するアドレスを共有データ領域の先頭アドレスに配置できるため、レジスタ相対アクセスにて共有データ領域にアクセスすることができ、共通プログラム領域のプログラム実行時にレジスタ相対アクセスにて共有データ領域にアクセスすることができる効果がある。   As mentioned above, when executing a program in the common program area, the address held by the register relative access register can be placed at the start address of the shared data area, so the shared data area can be accessed by register relative access, There is an effect that the shared data area can be accessed by register relative access when executing the program in the program area.

また、レジスタ相対アクセスを使用することにより、コード数を削減することができ、生成したコードの実行を高速化することができる効果もある。   In addition, by using register relative access, the number of codes can be reduced, and the generated code can be executed more quickly.

<本発明の特徴>
本発明のコンパイラ装置は、非対称型マルチコア・プロセッサ用のコンパイラ装置であって、中間コードからオブジェクトコードを生成する際、共通プログラムか否か判断し、共通プログラムである場合、共通プログラム領域から共有データ領域にレジスタ相対アクセスするコードを生成することを特徴とする。
<Features of the present invention>
The compiler apparatus of the present invention is a compiler apparatus for an asymmetric multi-core processor, and determines whether or not a common program is used when generating object code from intermediate code. A code for register-relative access to an area is generated.

具体的には、本発明のコンパイラ装置は、非対称型マルチコア・プロセッサ向けコンパイラ装置であって、コア毎のデータ領域とコア間で共有する共有データ領域等の複数のデータ領域がある場合に、共有データ領域の先頭アドレスをデータとして保持するシンボルを生成する手段と、共通プログラム領域の関数の先頭アドレスに、レジスタ相対アクセス用レジスタの値を、退避先(コア毎のデータ領域等)に退避させるコードを追加し、レジスタ相対アクセス用レジスタの値に、生成されたシンボル(共有データ領域の先頭アドレス)を上書きするコードを追加する手段と、共通プログラムの関数呼び出し元に分岐する処理の直前に、レジスタ相対アクセス用レジスタの値に、退避先に退避させた値を書き戻す(上書きする)コードを追加する手段とを具備する。   Specifically, the compiler apparatus of the present invention is a compiler apparatus for an asymmetric multi-core processor, and is shared when there are a plurality of data areas such as a data area for each core and a shared data area shared between the cores. A means for generating a symbol that holds the start address of the data area as data, and a code for saving the value of the register relative access register to the save destination (data area for each core, etc.) at the start address of the function in the common program area To add a code that overwrites the generated symbol (the start address of the shared data area) to the register relative access register value, and immediately before processing to branch to the function call source of the common program Added code to write back (overwrite) the value saved in the save destination to the relative access register value ; And a that means.

また、本発明のコード生成方法は、非対称型マルチコア・プロセッサ用コンパイラ装置のコード生成方法であって、共有データ領域の先頭アドレスをデータとして保持するシンボルを生成する工程と、共通プログラム領域の関数の先頭アドレスに、レジスタ相対アクセス用レジスタの値を、退避先(コア毎のデータ領域等)に退避させるコードを追加する工程と、レジスタ相対アクセス用レジスタの値に、当該シンボル(共有データ領域の先頭アドレス)を上書きするコードを追加する工程と、共通プログラムの関数呼び出し元に分岐する処理の直前に、レジスタ相対アクセス用レジスタの値に、退避先に退避させた値を書き戻す(上書きする)コードを追加する工程とを有することを特徴とする。   The code generation method of the present invention is a code generation method for a compiler device for an asymmetric multi-core processor, which includes a step of generating a symbol that holds the start address of a shared data area as data, and a function of a common program area. Adding a code that saves the register-relative access register value to the save address (data area for each core, etc.) at the start address, and the register-relative access register value to the symbol (the head of the shared data area) Code that overwrites the value saved in the save destination in the register relative access register value immediately before the process of adding the code that overwrites the address) and the process that branches to the function call source of the common program And a step of adding.

これにより、全ての領域に対してレジスタ相対アクセスができる。   This allows register relative access to all areas.

以上、本発明の実施形態を詳述してきたが、実際には、上記の実施形態に限られるものではなく、本発明の要旨を逸脱しない範囲の変更があっても本発明に含まれる。   As mentioned above, although embodiment of this invention was explained in full detail, actually, it is not restricted to said embodiment, Even if there is a change of the range which does not deviate from the summary of this invention, it is included in this invention.

1… 構文解析処理部
2… 中間言語レベル最適化部
3… コード生成処理部
4… ソースプログラム格納部
5… 中間言語格納部
6… オブジェクトプログラム格納部
7… ノード変換処理部
8… レジスタ割り付け処理部
9… アドレス割り付け処理部
10… コード出力処理部
11… ノード格納部
12(12−i、i=1〜n)… データ管理情報テーブル
13… データ管理情報テーブル連鎖機構
14… データアクセス回数登録部
15… データ管理情報テーブル連鎖並べ替え処理部
16… データのアドレス割り付け処理部
100… コンパイラ装置
101… 読み込み部
102… 字句解析部
103… 変数アクセス解析部
104… 構文解析部
105… 変数配置部
106… 中間語作成部
107… 最適化部
108… コード生成部
110… 原始プログラム格納部
120… 中間データ格納部
130… 目的プログラム格納部
200… アドレス空間
201… PE1用プログラム領域
202… PE2用プログラム領域
203… 共通プログラム領域
204… PE1用データ領域
205… PE2用データ領域
206… 共有データ領域
DESCRIPTION OF SYMBOLS 1 ... Parsing processing part 2 ... Intermediate language level optimization part 3 ... Code generation processing part 4 ... Source program storage part 5 ... Intermediate language storage part 6 ... Object program storage part 7 ... Node conversion processing part 8 ... Register allocation processing part DESCRIPTION OF SYMBOLS 9 ... Address allocation process part 10 ... Code output process part 11 ... Node storage part 12 (12-i, i = 1-n) ... Data management information table 13 ... Data management information table chain mechanism 14 ... Data access frequency registration part 15 Data management information table chain rearrangement processing unit 16 Data address allocation processing unit 100 Compiler device 101 Reading unit 102 Lexical analysis unit 103 Variable access analysis unit 104 Syntactic analysis unit 105 Variable allocation unit 106 Intermediate Word creation unit 107 ... optimization unit 108 ... code generation unit 11 Primitive program storage unit 120 ... Intermediate data storage unit 130 ... Target program storage unit 200 ... Address space 201 ... PE1 program area 202 ... PE2 program area 203 ... Common program area 204 ... PE1 data area 205 ... PE2 data area 206 ... Shared data area

Claims (5)

非対称型マルチコア・プロセッサ向けコンパイラ装置であって、
原始プログラムの構文解析結果を基に、変数のアクセス解析を行い、変数の参照元及び参照回数の解析情報を取得する手段と、
前記解析情報を基に、変数の配置を行った後、中間言語で中間コードを作成する手段と、
前記中間コードからオブジェクトコードを生成する際、共通プログラムか否か判断し、共通プログラムである場合、共通プログラム領域から共有データ領域にレジスタ相対アクセスするコードを追加する手段と
を具備する
コンパイラ装置。
A compiler device for an asymmetric multi-core processor,
Based on the syntax analysis result of the source program, a means for performing variable access analysis and obtaining analysis information of the variable reference source and the reference count;
Means for creating an intermediate code in an intermediate language after arranging variables based on the analysis information;
A compiler apparatus comprising: means for determining whether or not the object code is a common program when generating the object code from the intermediate code, and in the case of the common program, adding a code for register relative access from the common program area to the shared data area.
請求項1に記載のコンパイラ装置であって、
コア毎のデータ領域とコア間で共有する共有データ領域との複数のデータ領域がある場合に、前記共有データ領域の先頭アドレスをデータとして保持するシンボルを生成する手段と、
共通プログラム領域の関数の先頭アドレスに、レジスタ相対アクセス用レジスタの値を前記コア毎のデータ領域に退避させるコードを追加する手段と、
前記レジスタ相対アクセス用レジスタの値に、前記シンボルを上書きするコードを追加する手段と、
前記関数の呼び出し元に分岐する処理の直前に、前記レジスタ相対アクセス用レジスタの値を、前記コア毎のデータ領域に退避させた値に書き戻すコードを追加する手段と
を更に具備する
コンパイラ装置。
The compiler apparatus according to claim 1,
Means for generating a symbol that retains the start address of the shared data area as data when there is a plurality of data areas of a data area for each core and a shared data area shared between the cores;
Means for adding a code for saving the value of the register relative access register to the data area for each core at the start address of the function of the common program area;
Means for adding a code for overwriting the symbol to a value of the register relative access register;
A compiler apparatus further comprising means for adding a code for rewriting the value of the register relative access register to the value saved in the data area for each core immediately before the process of branching to the function caller.
非対称型マルチコア・プロセッサ向けコンパイラ装置により実施されるコード生成方法であって、
原始プログラムの構文解析結果を基に、変数のアクセス解析を行い、変数の参照元及び参照回数の解析情報を取得することと、
前記解析情報を基に、変数の配置を行った後、中間言語で中間コードを作成することと、
前記中間コードからオブジェクトコードを生成する際、共通プログラムか否か判断し、共通プログラムである場合、共通プログラム領域から共有データ領域にレジスタ相対アクセスするコードを追加することと
を含む
コード生成方法。
A code generation method implemented by a compiler device for an asymmetric multi-core processor,
Based on the syntax analysis result of the source program, access analysis of the variable is performed, and analysis information of the variable reference source and the reference count is obtained.
Based on the analysis information, after arranging variables, creating intermediate code in an intermediate language;
A code generation method comprising: determining whether a common program is generated when generating an object code from the intermediate code, and adding a code for register relative access from a common program area to a shared data area if the program is a common program.
請求項3に記載のコード生成方法であって、
コア毎のデータ領域とコア間で共有する共有データ領域との複数のデータ領域がある場合に、前記共有データ領域の先頭アドレスをデータとして保持するシンボルを生成することと、
共通プログラム領域の関数の先頭アドレスに、レジスタ相対アクセス用レジスタの値を前記コア毎のデータ領域に退避させるコードを追加することと、
前記レジスタ相対アクセス用レジスタの値に、前記シンボルを上書きするコードを追加することと、
前記関数の呼び出し元に分岐する処理の直前に、前記レジスタ相対アクセス用レジスタの値を、前記コア毎のデータ領域に退避させた値に書き戻すコードを追加することと
を更に含む
コード生成方法。
The code generation method according to claim 3,
When there are a plurality of data areas including a data area for each core and a shared data area shared between the cores, generating a symbol that holds the start address of the shared data area as data;
Adding a code for saving the value of the register relative access register to the data area for each core at the start address of the function of the common program area;
Adding a code to overwrite the symbol to the register relative access register value;
A code generation method further comprising adding a code for rewriting the value of the register relative access register to a value saved in the data area for each core immediately before the process of branching to the function caller.
請求項3又は4に記載のコード生成方法を、計算機に実行させるためのプログラム。   A program for causing a computer to execute the code generation method according to claim 3 or 4.
JP2010262072A 2010-11-25 2010-11-25 Compiler device, code generation method and program Withdrawn JP2012113518A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010262072A JP2012113518A (en) 2010-11-25 2010-11-25 Compiler device, code generation method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010262072A JP2012113518A (en) 2010-11-25 2010-11-25 Compiler device, code generation method and program

Publications (1)

Publication Number Publication Date
JP2012113518A true JP2012113518A (en) 2012-06-14

Family

ID=46497667

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010262072A Withdrawn JP2012113518A (en) 2010-11-25 2010-11-25 Compiler device, code generation method and program

Country Status (1)

Country Link
JP (1) JP2012113518A (en)

Similar Documents

Publication Publication Date Title
Lin et al. ASTRO: Synthesizing application-specific reconfigurable hardware traces to exploit memory-level parallelism
TWI691898B (en) Simulation device, simulation method and storage medium for storing simulation program
JP7088897B2 (en) Data access methods, data access devices, equipment and storage media
US8266416B2 (en) Dynamic reconfiguration supporting method, dynamic reconfiguration supporting apparatus, and dynamic reconfiguration system
JP2020500368A (en) Data prefetching method, apparatus, and system
US8949777B2 (en) Methods and systems for mapping a function pointer to the device code
US20080244221A1 (en) Exposing system topology to the execution environment
US20080077930A1 (en) Workload Partitioning in a Parallel System with Hetergeneous Alignment Constraints
Halstead et al. Compiling irregular applications for reconfigurable systems
JP5936135B2 (en) Information processing apparatus, information processing method, and program
JP3863544B1 (en) Arithmetic processing device and arithmetic processing method
JP2012103923A (en) Compiler device, compiling method and compiler program
JP2012113518A (en) Compiler device, code generation method and program
Yuan et al. Automatic enhanced CDFG generation based on runtime instrumentation
JP2010140233A (en) Emulation system and emulation method
JP2017091070A (en) Executable code generation program and executable code generation device
Che et al. Scheduling of synchronous data flow models onto scratchpad memory-based embedded processors
KR102457183B1 (en) Multi-core simulation system and method based on shared translation block cache
JP6217386B2 (en) Program generation method for multiprocessor
JP2020140284A (en) Vector arithmetic processing device, array variable initialization method by vector arithmetic processing device, and array variable initialization program using vector arithmetic processing device
Maccarone et al. Fuzzy mathematical morphology to analyse astronomical images
JP2018151827A (en) Information processing device, control method for information processing device and control program for information processing device
TW201317780A (en) Method for identifying memory of virtual machine and computer system using the same
Yilmazer-Metin Graph-Waving architecture: Efficient execution of graph applications on GPUs
Balasundaram et al. Reducing Energy Consumption by Code Repositioning for Memory Levels

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20140204