JP2006286027A - Compiler device and compiling method - Google Patents

Compiler device and compiling method Download PDF

Info

Publication number
JP2006286027A
JP2006286027A JP2006207058A JP2006207058A JP2006286027A JP 2006286027 A JP2006286027 A JP 2006286027A JP 2006207058 A JP2006207058 A JP 2006207058A JP 2006207058 A JP2006207058 A JP 2006207058A JP 2006286027 A JP2006286027 A JP 2006286027A
Authority
JP
Japan
Prior art keywords
instruction
register
unit
cycle
instructions
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
JP2006207058A
Other languages
Japanese (ja)
Other versions
JP4721975B2 (en
Inventor
Takehito Heiji
岳人 瓶子
Hajime Ogawa
一 小川
Takenobu Tani
丈暢 谷
Yukihiro Sasagawa
幸宏 笹川
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP2006207058A priority Critical patent/JP4721975B2/en
Publication of JP2006286027A publication Critical patent/JP2006286027A/en
Application granted granted Critical
Publication of JP4721975B2 publication Critical patent/JP4721975B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30145Instruction analysis, e.g. decoding, instruction word fields
    • G06F9/30156Special purpose encoding of instructions, e.g. Gray coding

Abstract

<P>PROBLEM TO BE SOLVED: To provide a compiler capable of creating a string of instructions by which a processor capable of parallel processing can be operated with low power consumption. <P>SOLUTION: Three instructions of a cycle of concern are rearranged to create six sequences of instructions (S61). For the slot of each of the instruction sequences, a humming distance between the bit patterns of operational codes between the instruction of concern and the instruction of the previous cycle is calculated (S64). This process is carried out for all the instructions of the three slots (S63-S65) and the sum of the humming distances is calculated (S66). The above processes are carried out for all of the six sequences of instructions (S62-S67). The sequence of instructions with which the sum of the six humming distances assumes a minimum value is selected and the instructions are rearranged so that the sequence corresponding to the minimum value is provided (S68). The above processes are repeated from the second cycle to the final cycle (S60-S69). <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は、C/C++言語等の高級言語で記述されたソースプログラムを機械語プログラムに変換するコンパイラに関し、特に、プログラム実行時の消費電力が少ない機械語プログラムを出力可能なコンパイラに関する。   The present invention relates to a compiler that converts a source program written in a high-level language such as a C / C ++ language into a machine language program, and more particularly to a compiler that can output a machine language program with low power consumption during program execution.

近年普及している携帯電話、情報携帯端末等の携帯型の情報処理装置では、消費電力の低減が要求されている。このため、このような情報処理装置で利用されるプロセッサが備える高い機能を有効に引き出しつつ、低消費電力で動作可能な機械語命令を生成可能なコンパイラが求められている。   In portable information processing apparatuses such as mobile phones and information portable terminals that have become popular in recent years, reduction of power consumption is required. Therefore, there is a need for a compiler that can generate machine language instructions that can operate with low power consumption while effectively extracting the high functions of a processor used in such an information processing apparatus.

従来のコンパイラとして、命令の実行順序を変更することによりプロセッサの消費電力の低減を図った命令列最適化装置がある(たとえば、特許文献1参照。)。   As a conventional compiler, there is an instruction sequence optimizing device that reduces the power consumption of a processor by changing the execution order of instructions (see, for example, Patent Document 1).

この命令列最適化装置では、命令の依存関係に影響を与えることなく、命令のビットパターン間のハミング距離を低減させるように命令の配置変更を行なう。これにより、プロセッサの消費電力を低減させることができる命令列の最適化を行なうことができる。
特開平8−101777号公報
In this instruction sequence optimizing apparatus, the instruction arrangement is changed so as to reduce the Hamming distance between the bit patterns of the instructions without affecting the dependency relation of the instructions. Thereby, it is possible to optimize the instruction sequence that can reduce the power consumption of the processor.
JP-A-8-101777

しかしながら、従来の命令列最適化装置では、並列処理可能なプロセッサを前提としていない。このため、従来の最適化処理を並列処理可能なプロセッサにそのまま適用しても、最適な命令列の最適化を得ることができないという問題がある。   However, the conventional instruction sequence optimization device does not assume a processor capable of parallel processing. For this reason, there is a problem that even if the conventional optimization processing is directly applied to a processor capable of parallel processing, the optimization of the optimum instruction sequence cannot be obtained.

そこで、本発明は、このような状況に鑑みてなされたものであり、並列処理可能なプロセッサを低消費電力で動作させることができる命令列を生成可能なコンパイラを提供することを目的とする。   Therefore, the present invention has been made in view of such a situation, and an object thereof is to provide a compiler capable of generating an instruction sequence that can operate a processor capable of parallel processing with low power consumption.

上記目的を達成するために、本発明に係るコンパイラ装置は、ソースプログラムを、並列処理可能な複数の実行ユニットと、前記複数の実行ユニットで実行される命令を各々発行する複数の命令発行ユニットとを有するプロセッサ用の機械語プログラムに翻訳するコンパイラ装置であって、前記ソースプログラムを構文解析するパーサー手段と、解析された前記ソースプログラムを中間コードに変換する中間コード変換手段と、前記中間コードに対応する命令の依存関係を崩すことなく、直前の命令サイクルの同一の命令発行ユニットに対応する位置に配置された命令とのハミング距離が小さくなる命令を優先して、前記複数の命令発行ユニットの各々の対応する位置に当該命令を配置し、前記中間コードを最適化する最適化手段と、最適化された前記中間コードを機械語命令に変換するコード生成手段とを備えることを特徴とする。   In order to achieve the above object, a compiler apparatus according to the present invention includes a plurality of execution units that can process a source program in parallel, and a plurality of instruction issuance units that respectively issue instructions executed by the plurality of execution units. A compiler device for translating the machine program into a machine language program for a processor, the parser means for parsing the source program, the intermediate code conversion means for converting the analyzed source program into intermediate code, and the intermediate code Priority is given to an instruction having a reduced Hamming distance from an instruction placed at a position corresponding to the same instruction issuing unit in the immediately preceding instruction cycle without breaking the dependency relation of the corresponding instruction. Optimization means for optimizing the intermediate code by placing the instruction at each corresponding position, and optimization Characterized in that it comprises a code generating means for converting the machine instructions the intermediate code.

これにより、各命令発行ユニットで実行される命令のビットパターンの変化を抑えることができるので、プロセッサの命令レジスタに保持される値のビット変化が小さく、プロセッサを低消費電力で動作させることができる命令列が生成される。   As a result, it is possible to suppress changes in the bit pattern of instructions executed by each instruction issuing unit, so that bit changes in values held in the instruction register of the processor are small, and the processor can be operated with low power consumption. An instruction sequence is generated.

また、本発明に係るコンパイラ装置は、ソースプログラムを、並列処理可能な複数の実行ユニットと、前記複数の実行ユニットで実行される命令を各々発行する複数の命令発行ユニットとを有するプロセッサ用の機械語プログラムに翻訳するコンパイラ装置であって、前記ソースプログラムを構文解析するパーサー手段と、解析された前記ソースプログラムを中間コードに変換する中間コード変換手段と、前記中間コードに対応する命令の依存関係を崩すことなく、直前の命令サイクルの同一の命令発行ユニットに対応する位置に配置された命令のレジスタと同一のレジスタをアクセスする命令を優先して、前記複数の命令発行ユニットの各々の対応する位置に当該命令を配置し、前記中間コードを最適化する最適化手段と、最適化された前記中間コードを機械語命令に変換するコード生成手段とを備えることを特徴とする。   In addition, a compiler apparatus according to the present invention provides a machine for a processor having a plurality of execution units that can process a source program in parallel and a plurality of instruction issue units that respectively issue instructions executed by the plurality of execution units. A compiler apparatus for translating into a word program, a parser means for parsing the source program, an intermediate code conversion means for converting the analyzed source program into an intermediate code, and an instruction dependency corresponding to the intermediate code The instruction that accesses the same register as the register of the instruction arranged at the position corresponding to the same instruction issuing unit in the immediately preceding instruction cycle is prioritized without damaging the instruction cycle. An optimization means for allocating the instruction at a location and optimizing the intermediate code; Characterized in that it comprises a code generating means for converting the intermediate code into machine language instructions.

これにより、同一のレジスタへのアクセスが連続し、レジスタを選択するための制御信号の変化が少なくなり、プロセッサを低消費電力で動作させることができる命令列が生成される。   As a result, access to the same register continues, the change in the control signal for selecting the register is reduced, and an instruction sequence that can operate the processor with low power consumption is generated.

さらに、本発明に係るコンパイラ装置は、ソースプログラムを、並列処理可能な複数の実行ユニットと、前記複数の実行ユニットで実行される命令を各々発行する複数の命令発行ユニットとを有するプロセッサ用の機械語プログラムに翻訳するコンパイラ装置であって、前記複数の命令発行ユニットの各々には、あらかじめ優先的に発行される命令が規定されており、前記ソースプログラムを構文解析するパーサー手段と、解析された前記ソースプログラムを中間コードに変換する中間コード変換手段と、前記中間コードに対応する命令の依存関係を崩すことなく、前記複数の命令発行ユニットの各々で優先発行される命令を優先して、前記複数の命令発行ユニットの各々に対応する位置に当該命令を配置し、前記中間コードを最適化する最適化手段と、最適化された前記中間コードを機械語命令に変換するコード生成手段とを備えることを特徴とする。   Furthermore, a compiler apparatus according to the present invention provides a machine for a processor having a plurality of execution units that can process a source program in parallel and a plurality of instruction issue units that issue instructions executed by the plurality of execution units. A compiler apparatus for translating into a word program, wherein each of the plurality of instruction issuing units is preliminarily specified with an instruction that is preferentially issued, and is analyzed by parser means for parsing the source program The intermediate code conversion means for converting the source program into an intermediate code and the instruction issued preferentially in each of the plurality of instruction issue units without breaking the dependency relationship between the instructions corresponding to the intermediate code, The instruction is arranged at a position corresponding to each of the plurality of instruction issuing units, and the intermediate code is optimized. And means, characterized in that it comprises a code generating means for converting the machine instructions the intermediate code optimized.

これにより、同じ命令発行ユニットで優先発行される命令として、プロセッサの同じ構成要素を利用する命令を割り当てれば、同一の命令発行ユニットでは、同じ構成要素を利用する命令が連続して実行されることになるため、プロセッサを低消費電力で動作させることができる命令列が生成される。   Thus, if an instruction that uses the same component of the processor is assigned as an instruction that is preferentially issued by the same instruction issuing unit, instructions that use the same component are continuously executed in the same instruction issuing unit. Therefore, an instruction string that can operate the processor with low power consumption is generated.

さらにまた、本発明に係るコンパイラ装置は、ソースプログラムを、並列処理可能な複数の実行ユニットと、前記複数の実行ユニットで実行される命令を各々発行する複数の命令発行ユニットとを有するプロセッサ用の機械語プログラムに翻訳するコンパイラ装置であって、前記ソースプログラムを構文解析するパーサー手段と、解析された前記ソースプログラムを中間コードに変換する中間コード変換手段と、前記複数の命令発行ユニットにそれぞれ対応する複数の命令の配置位置について、同一数の命令の未配置位置があらかじめ定められた命令サイクル数以上連続する区間を検出する区間検出手段と、前記区間の直前に、前記命令の未配置位置に対応する命令発行ユニットの動作を停止させるための命令を挿入する第1の命令挿入手段と、当該命令が挿入された前記中間コードを機械語命令に変換するコード生成手段とを備えることを特徴とする。   Furthermore, a compiler apparatus according to the present invention is for a processor having a plurality of execution units that can process a source program in parallel and a plurality of instruction issue units that issue instructions executed by the plurality of execution units. A compiler device that translates into a machine language program, which corresponds to parser means for parsing the source program, intermediate code conversion means for converting the analyzed source program into intermediate code, and the plurality of instruction issuing units, respectively. And a section detecting means for detecting a section in which unplaced positions of the same number of instructions continue for more than a predetermined number of instruction cycles, and the unplaced position of the instructions immediately before the section. First instruction insertion means for inserting an instruction for stopping the operation of the corresponding instruction issuing unit Characterized by comprising a code generating means for converting the intermediate code to which the instruction is inserted into machine instructions.

これにより、命令発行ユニットに対応する位置に命令が連続して配置されていない場合には、その間、その命令発行ユニットへの電力の供給を停止させることができため、プロセッサを低消費電力で動作させることができる命令列が生成される。   As a result, when instructions are not continuously arranged at the position corresponding to the instruction issuing unit, the supply of power to the instruction issuing unit can be stopped during that time, so that the processor operates with low power consumption. An instruction sequence that can be generated is generated.

さらにまた、本発明に係るコンパイラ装置は、ソースプログラムを、並列処理可能な複数の実行ユニットと、前記複数の実行ユニットで実行される命令を各々発行する複数の命令発行ユニットとを有するプロセッサ用の機械語プログラムに翻訳するコンパイラ装置であって、前記ソースプログラムは、前記プロセッサが使用する命令発行ユニットの個数を指定可能な個数指定情報を含み、前記ソースプログラムを構文解析するパーサー手段と、解析された前記ソースプログラムを中間コードに変換する中間コード変換手段と、前記中間コードに対応する命令の依存関係を崩すことなく、前記個数指定情報で指定された個数の命令発行ユニットのみを動作させるように命令を配置し、前記中間コードを最適化する最適化手段と、最適化された前記中間コードを機械語命令に変換するコード生成手段とを備えることを特徴とする。   Furthermore, a compiler apparatus according to the present invention is for a processor having a plurality of execution units that can process a source program in parallel and a plurality of instruction issue units that issue instructions executed by the plurality of execution units. A compiler apparatus for translating into a machine language program, wherein the source program includes number specifying information that can specify the number of instruction issuing units used by the processor, and is analyzed by parser means for parsing the source program. In addition, the intermediate code converting means for converting the source program into the intermediate code and the instruction issuing unit of the number specified by the number specifying information are operated without breaking the dependency relationship between the instructions corresponding to the intermediate code. An optimization means for allocating instructions and optimizing the intermediate code; Characterized in that it comprises a code generating means for converting the intermediate code into machine language instructions.

これにより、個数指定情報で指定された箇所の命令に関しては、命令が供給されない命令発行ユニットを発生させることができ、その命令発行ユニットへの電力の供給を停止させることができるため、プロセッサを低消費電力で動作させることができる命令列が生成される。   As a result, regarding the instruction at the location specified by the number specification information, an instruction issuing unit to which no instruction is supplied can be generated and power supply to the instruction issuing unit can be stopped. An instruction sequence that can be operated with power consumption is generated.

さらにまた、本発明に係るコンパイラ装置は、ソースプログラムを、並列処理可能な複数の実行ユニットと、前記複数の実行ユニットで実行される命令を各々発行する複数の命令発行ユニットとを有するプロセッサ用の機械語プログラムに翻訳するコンパイラ装置であって、前記プロセッサが使用する命令発行ユニットの個数を受付ける受付け手段と、前記ソースプログラムを構文解析するパーサー手段と、解析された前記ソースプログラムを中間コードに変換する中間コード変換手段と、前記中間コードに対応する命令の依存関係を崩すことなく、前記受付け手段が受付けた前記個数の命令発行ユニットのみを動作させるように命令を配置し、前記中間コードを最適化する最適化手段と、最適化された前記中間コードを機械語命令に変換するコード生成手段とを備えることを特徴とする。   Furthermore, a compiler apparatus according to the present invention is for a processor having a plurality of execution units that can process a source program in parallel and a plurality of instruction issue units that issue instructions executed by the plurality of execution units. A compiler device that translates into a machine language program, receiving means for receiving the number of instruction issuing units used by the processor, parser means for parsing the source program, and converting the analyzed source program into intermediate code The intermediate code converting means and the instructions corresponding to the intermediate code are arranged so as to operate only the number of instruction issuing units received by the receiving means without breaking the dependency relationship between the instructions. Optimization means for converting the intermediate code into machine language instructions Characterized in that it comprises a code generating means.

これにより、受付け手段で受付けた個数の命令発行ユニットのみを動作させ、その他の命令発行ユニットへの電力の供給を停止させることができるため、プロセッサを低消費電力で動作させることができる命令例が生成される。   As a result, only the number of instruction issuing units received by the receiving means can be operated and the supply of power to the other instruction issuing units can be stopped, so that there are instruction examples that can operate the processor with low power consumption. Generated.

なお、本発明は、このようなコンパイラ装置として実現することができるだけでなく、このようなプログラムに含まれる手段をステップとするコンパイル方法として実現したり、このような特徴的なコンパイラ用のプログラムまたはコンピュータ読取可能な記録媒体として実現したりすることもできる。そして、そのようなプログラムやデータファイルは、CD−ROM(Compact Disk-Read Only Memory)等の記録媒体やインターネット等の伝送媒体を介して広く流通させることができるのは言うまでもない。   The present invention can be realized not only as such a compiler apparatus but also as a compiling method using steps included in such a program as a step, or a characteristic compiler program or It can also be realized as a computer-readable recording medium. Needless to say, such a program or data file can be widely distributed via a recording medium such as a CD-ROM (Compact Disk-Read Only Memory) or a transmission medium such as the Internet.

以上の説明から明らかように、本発明に係るコンパイラ装置によると、プロセッサの命令レジスタに保持される値のビット変化が小さく、プロセッサを低消費電力で動作させることができる命令列が生成される。   As can be seen from the above description, according to the compiler apparatus of the present invention, an instruction sequence is generated in which the bit change of the value held in the instruction register of the processor is small and the processor can be operated with low power consumption.

また、同一のレジスタへのアクセスが連続し、レジスタを選択するための制御信号の変化が少なくなり、プロセッサを低消費電力で動作させることができる命令列が生成される。   In addition, an access to the same register is continued, a change in a control signal for selecting the register is reduced, and an instruction sequence that can operate the processor with low power consumption is generated.

さらに、同一スロットで同じ構成要素を利用する命を連続して実行させることができるため、プロセッサを低消費電力で動作させることができる命令列が生成される。   Furthermore, since instructions that use the same component in the same slot can be continuously executed, an instruction sequence that can operate the processor with low power consumption is generated.

さらにまた、空きスロットへの電力の供給を停止させることができるため、プロセッサを低消費電力で動作させることができる命令列が生成される。   Furthermore, since the power supply to the empty slot can be stopped, an instruction sequence that can operate the processor with low power consumption is generated.

以上のように、本発明に係るコンパイラにより、並列処理可能なプロセッサを低消費電力で動作させることが可能となる。特に、携帯電話、情報携帯端末等の携帯型の情報処理装置のように、低消費電力での動作が求められる装置で用いられるプロセッサ向きの命令列(機械語プログラム)を生成することができ、その実用的価値は極めて高い。   As described above, the compiler according to the present invention makes it possible to operate a processor capable of parallel processing with low power consumption. In particular, it is possible to generate a processor-oriented instruction sequence (machine language program) used in a device that requires operation with low power consumption, such as a portable information processing device such as a mobile phone or an information portable terminal, Its practical value is extremely high.

以下、本発明に係るコンパイラの実施の形態について図面を用いて詳細に説明する。
本実施の形態におけるコンパイラは、C/C++言語等の高級言語で記述されたソースプログラムを特定のプロセッサ(ターゲット)が実行できる機械語プログラムに翻訳するクロスコンパイラであり、プロセッサの消費電力を低減させることができるという特徴を有する。
Hereinafter, embodiments of a compiler according to the present invention will be described in detail with reference to the drawings.
The compiler in this embodiment is a cross compiler that translates a source program written in a high-level language such as C / C ++ into a machine language program that can be executed by a specific processor (target), and reduces the power consumption of the processor. It has the feature that it can be.

[プロセッサ]
まず、本実施の形態におけるコンパイラの対象となるプロセッサの一例について、図1〜図11を用いて説明する。
[Processor]
First, an example of a processor that is a target of a compiler according to the present embodiment will be described with reference to FIGS.

本実施の形態におけるコンパイラの対象となるプロセッサは、例えば、通常のマイコンに比べて実行可能な命令の並列性が高く、複数の命令を並列して処理できるようにパイプライン方式が採用されている。   The processor that is the target of the compiler in this embodiment, for example, has higher parallelism of instructions that can be executed than a normal microcomputer, and adopts a pipeline system so that a plurality of instructions can be processed in parallel. .

図1は、本実施の形態に係るプロセッサが解読実行する命令の構造を示す図である。
図1(a)〜図1(d)を参照して、本プロセッサの各命令は、32ビットの固定長である。各命令の0ビット目は、並列実行境界情報を示す。並列実行境界情報が“1”のときは、その命令と後続命令との間に並列実行の境界が存在し、並列実行境界情報が“0”のときは、並列実行の境界が存在しないことになる。並列実行境界情報の利用方法については、後述する。
FIG. 1 is a diagram showing a structure of an instruction that is decoded and executed by the processor according to the present embodiment.
1A to 1D, each instruction of the processor has a fixed length of 32 bits. The 0th bit of each instruction indicates parallel execution boundary information. When the parallel execution boundary information is “1”, there is a parallel execution boundary between the instruction and the succeeding instruction, and when the parallel execution boundary information is “0”, there is no parallel execution boundary. Become. A method of using the parallel execution boundary information will be described later.

各命令の命令長から並列実行境界情報を除いた31ビットの部分においてオペレーションを決定する。具体的には、フィールド“Op1”、“Op2”、“Op3”および“Op4”では、オペレーションの種類を示すオペコードを指定する。レジスタフィールド“Rs”、“Rs1”および“Rs2”では、ソースオペランドとなるレジスタのレジスタ番号を指定する。レジスタフィールド“Rd”では、ディスティネーションオペランドとなるレジスタのレジスタ番号を指定する。フィールド“Imm”では、演算用定数オペランドを指定する。フィールド“Disp”では、変位(ディスプレースメント)を指定する。   The operation is determined in the 31-bit portion obtained by removing the parallel execution boundary information from the instruction length of each instruction. Specifically, in the fields “Op1”, “Op2”, “Op3”, and “Op4”, an operation code indicating the type of operation is designated. In the register fields “Rs”, “Rs1”, and “Rs2”, the register number of the register that becomes the source operand is designated. In the register field “Rd”, the register number of the register serving as the destination operand is designated. In the field “Imm”, a constant operand for calculation is designated. In the field “Disp”, a displacement is specified.

オペコードの先頭2ビット(30および31ビット目)は、オペレーションの種類(オペレーション群)を指定するために用いられる。その詳細については、後述する。   The first 2 bits (30th and 31st bits) of the opcode are used to specify the type of operation (operation group). Details thereof will be described later.

オペコードOp2〜Op4は、16ビット長のデータであるが、オペコードOp1は21ビット長のデータである。したがって、便宜的に、オペコードOp1の前半部分(16〜31ビット目)をオペコードOp1−1と呼び、後半部分(11〜15ビット目)をオペコードOp1−2と呼ぶ。   The opcodes Op2 to Op4 are 16-bit data, while the opcode Op1 is 21-bit data. Therefore, for the sake of convenience, the first half (16th to 31st bits) of the opcode Op1 is called an opcode Op1-1, and the second half (11th to 15th bits) is called an opcode Op1-2.

図2は、本実施の形態に係るプロセッサの概略構成を示すブロック図である。プロセッサ30は、VLIW(Very Long Instruction Word)方式に従って記述された命令群(以下「パケット」と呼ぶ。)を記憶する命令メモリ40と、命令供給発行部50と、解読部60と、実行部70と、データメモリ100とを含む。各部の詳細については後述する。   FIG. 2 is a block diagram showing a schematic configuration of the processor according to the present embodiment. The processor 30 includes an instruction memory 40 that stores a group of instructions (hereinafter referred to as “packets”) described in accordance with a VLIW (Very Long Instruction Word) system, an instruction supply issue unit 50, a decoding unit 60, and an execution unit 70. And a data memory 100. Details of each part will be described later.

図3は、パケットの一例を示す図である。1パケットは、命令フェッチの単位であり、4命令から構成されるものと定義する。上述のように、1命令は32ビット長である。このため、1パケットは、128(=32×4)ビット長である。   FIG. 3 is a diagram illustrating an example of a packet. One packet is a unit of instruction fetch and is defined to be composed of four instructions. As described above, one instruction is 32 bits long. Therefore, one packet is 128 (= 32 × 4) bits long.

再度図2を参照して、命令供給発行部50は、命令メモリ40、解読部60および実行部70に接続され、実行部70より供給されるPC(プログラムカウンタ)の値に基づいて、命令メモリ40よりパケットを受信し、解読部60に並列して最高3つの命令を供給する。   Referring again to FIG. 2, the instruction supply / issuance unit 50 is connected to the instruction memory 40, the decoding unit 60 and the execution unit 70, and is based on the value of the PC (program counter) supplied from the execution unit 70. A packet is received from 40 and up to three instructions are supplied in parallel to the decoding unit 60.

解読部60は、命令供給発行部50および実行部70に接続され、命令供給発行部50から供給された命令を解読し、実行部70に供給する。   The decoding unit 60 is connected to the instruction supply issuing unit 50 and the execution unit 70, decodes the instruction supplied from the instruction supply issuing unit 50, and supplies the decoded instruction to the execution unit 70.

実行部70は、命令供給発行部50、解読部60およびデータメモリ100に接続され、解読部60より供給される解読結果に基づいて、必要に応じデータメモリ100に記憶されたデータアクセスを行ない、命令に基づいた処理を実行する。また、処理が実行されるごとに、実行部70はPCの値を1つずつインクリメントする。   The execution unit 70 is connected to the instruction supply / issuance unit 50, the decryption unit 60, and the data memory 100. Based on the decryption result supplied from the decryption unit 60, the execution unit 70 accesses the data stored in the data memory 100 as necessary. Performs processing based on the instruction. Each time the process is executed, the execution unit 70 increments the PC value by one.

命令供給発行部50は、命令メモリ40および実行部70内の後述するPC部に接続され、PC部に保持されたプログラムカウンタで示される命令メモリ40のアドレスにアクセスし、命令メモリ40よりパケットを受信する命令フェッチ部52と、命令フェッチ部52に接続され、パケットを一時的に保持する命令バッファ54と、命令バッファ54に接続され、パケットに含まれる命令を最大3つ保持する命令レジスタ部56とを含む。   The instruction supply / issuance unit 50 is connected to the instruction memory 40 and a later-described PC unit in the execution unit 70, accesses the address of the instruction memory 40 indicated by the program counter held in the PC unit, and receives packets from the instruction memory 40. An instruction fetch unit 52 for receiving, an instruction buffer 54 connected to the instruction fetch unit 52 and temporarily holding a packet, and an instruction register unit 56 connected to the instruction buffer 54 and holding up to three instructions included in the packet Including.

命令フェッチ部52および命令メモリ40は、IA(Instruction Address)バス42およびID(Instruction Data)バス44により接続されている。IAバス42は32ビット幅であり、IDバス44は128ビット幅である。命令フェッチ部52から命令メモリ40へのアドレス供給は、IAバス42を介して行われる。命令メモリ40から命令フェッチ部52へのパケットの供給は、IDバス44を解して行われる。   The instruction fetch unit 52 and the instruction memory 40 are connected by an IA (Instruction Address) bus 42 and an ID (Instruction Data) bus 44. The IA bus 42 is 32 bits wide and the ID bus 44 is 128 bits wide. Address supply from the instruction fetch unit 52 to the instruction memory 40 is performed via the IA bus 42. Packets are supplied from the instruction memory 40 to the instruction fetch unit 52 through the ID bus 44.

命令レジスタ部56は、各々命令バッファ54に接続され、それぞれ1つの命令を保持する命令レジスタ56a〜56cを含む。   The instruction register unit 56 includes instruction registers 56a to 56c each connected to the instruction buffer 54 and holding one instruction.

解読部60は、命令レジスタ部56内の3つの命令レジスタ56a〜56cに保持された命令の発行に関する制御を行う命令発行制御部62と、命令発行制御部62および命令レジスタ部56に接続され、命令発行制御部62の制御に基づいて、命令レジスタ部56から供給される命令をデコードするデコード部64とを含む。   The decoding unit 60 is connected to an instruction issuance control unit 62 that controls the issuance of instructions held in the three instruction registers 56 a to 56 c in the instruction register unit 56, an instruction issuance control unit 62, and the instruction register unit 56. And a decoding unit 64 that decodes an instruction supplied from the instruction register unit 56 based on the control of the instruction issue control unit 62.

デコード部64は、命令レジスタ56a〜56cにそれぞれ接続され、基本的に1サイクルに1つの命令を解読し、制御信号を出力する命令デコーダ64a〜64cを含む。   The decode unit 64 includes instruction decoders 64a to 64c connected to the instruction registers 56a to 56c, respectively, which basically decode one instruction per cycle and output a control signal.

実行部70は、デコード部64に接続され、デコード部64内の3つの命令デコーダ64a〜64cより出力される制御信号に基づいて、実行部70内の後述する各構成要素を制御する実行制御部72と、次に実行すべきパケットのアドレスを保持するPC部74と、32個の32ビットレジスタR0〜R31から構成されるレジスタファイル76と、各々、SIMD(Single Instruction Multiple Data)型命令の演算を実行する算術論理・比較演算部78a〜78cと、算術論理・比較演算部78a〜78cと同様、SIMD型命令の実行が可能であり、ビット精度を落とさないように、最長で65ビットで累算する乗算・積和演算部80aおよび80bとを含む。   The execution unit 70 is connected to the decoding unit 64, and controls an after-mentioned component in the execution unit 70 based on control signals output from the three instruction decoders 64 a to 64 c in the decoding unit 64. 72, a PC section 74 that holds the address of the packet to be executed next, a register file 76 composed of 32 32-bit registers R0 to R31, and a SIMD (Single Instruction Multiple Data) type operation, respectively. Similar to the arithmetic logic / comparison arithmetic units 78a to 78c and the arithmetic logic / comparison arithmetic units 78a to 78c, SIMD type instructions can be executed, and can be accumulated up to 65 bits so as not to degrade the bit precision. Multiply / multiply-accumulate units 80a and 80b for calculation.

実行部70は、さらに、各々、データの算術シフト(2の補数体系のシフト)または論理シフト(符号なしシフト)を実行するバレルシフタ82a〜82bと、除算器84と、データメモリ100に接続され、データメモリ100との間でデータの受渡しを行うオペランドアクセス部88と、32ビット幅のデータバス90(L1バス、R1バス、L2バス、R2バス、L3バス、R3バス)と、32ビット幅のデータバス92(D1バス、D2バス、D3バス)とを含む。   The execution unit 70 is further connected to a barrel shifters 82a to 82b for performing an arithmetic shift (shift of two's complement system) or a logical shift (unsigned shift), a divider 84, and the data memory 100, respectively. An operand access unit 88 for transferring data to and from the data memory 100, a 32-bit wide data bus 90 (L1 bus, R1 bus, L2 bus, R2 bus, L3 bus, R3 bus), and a 32-bit wide data bus Data bus 92 (D1 bus, D2 bus, D3 bus).

レジスタファイル76は、32個の32ビットレジスタR0〜R31を含む。L1バス、R1バス、L2バス、R2バス、L3バスおよびR3バスにデータを出力するレジスタファイル76内のレジスタの選択は、実行制御部72よりレジスタファイル76に供給される制御信号CL1、CR1、CL2、CR2、CL3およびCR3によりそれぞれ行なわれる。また、D1バス、D2バスおよびD3バスを流れるデータが書き込まれるレジスタの選択は、実行制御部72よりレジスタファイル76に供給される制御信号CD1、CD2およびCD3によりそれぞれ行なわれる。   The register file 76 includes 32 32-bit registers R0 to R31. Selection of a register in the register file 76 that outputs data to the L1 bus, R1 bus, L2 bus, R2 bus, L3 bus, and R3 bus is performed by the control signals CL1, CR1, Performed by CL2, CR2, CL3 and CR3, respectively. In addition, selection of a register to which data flowing through the D1 bus, D2 bus, and D3 bus is written is performed by control signals CD1, CD2, and CD3 supplied from the execution control unit 72 to the register file 76, respectively.

算術論理・比較演算部78aの2つの入力ポートは、L1バスおよびR1バスにそれぞれ接続され、その出力ポートは、D1バスに接続されている。算術論理・比較演算部78bの2つの入力ポートは、L2バスおよびR2バスにそれぞれ接続され、その出力ポートは、D2バスに接続されている。算術論理・比較演算部78cの2つの入力ポートは、L3バスおよびR3バスにそれぞれ接続され、その出力ポートは、D3バスに接続されている。   Two input ports of the arithmetic logic / comparison unit 78a are connected to the L1 bus and the R1 bus, respectively, and their output ports are connected to the D1 bus. Two input ports of the arithmetic logic / comparison operation unit 78b are connected to the L2 bus and the R2 bus, respectively, and their output ports are connected to the D2 bus. Two input ports of the arithmetic logic / comparison unit 78c are connected to the L3 bus and the R3 bus, respectively, and their output ports are connected to the D3 bus.

乗算・積和演算部80aの4つの入力ポートは、L1バス、R1バス、L2バスおよびR2バスにそれぞれ接続され、その2つの出力ポートは、D1バスおよびD2バスにそれぞれ接続されている。乗算・積和演算部80bの4つの入力ポートは、L2バス、R2バス、L3バスおよびR3バスにそれぞれ接続され、その2つの出力ポートは、D2バスおよびD3バスにそれぞれ接続されている。   The four input ports of the multiplication / product-sum operation unit 80a are connected to the L1 bus, the R1 bus, the L2 bus, and the R2 bus, respectively, and the two output ports are connected to the D1 bus and the D2 bus, respectively. The four input ports of the multiplication / product-sum operation unit 80b are connected to the L2 bus, the R2 bus, the L3 bus, and the R3 bus, respectively, and the two output ports are connected to the D2 bus and the D3 bus, respectively.

バレルシフタ82aの2つの入力ポートは、L1バスおよびR1バスにそれぞれ接続され、その出力ポートは、D1バスに接続されている。バレルシフタ82bの2つの入力ポートは、L2バスおよびR2バスにそれぞれ接続され、その出力ポートは、D2バスに接続されている。バレルシフタ82cの2つの入力ポートは、L3バスおよびR3バスにそれぞれ接続され、その出力ポートは、D3バスに接続されている。   Two input ports of the barrel shifter 82a are connected to the L1 bus and the R1 bus, respectively, and their output ports are connected to the D1 bus. Two input ports of the barrel shifter 82b are connected to the L2 bus and the R2 bus, respectively, and their output ports are connected to the D2 bus. Two input ports of the barrel shifter 82c are connected to the L3 bus and the R3 bus, respectively, and their output ports are connected to the D3 bus.

除算器84の2つの入力ポートは、L1バスおよびR1バスにそれぞれ接続され、その出力ポートは、D1バスに接続されている。   Two input ports of the divider 84 are connected to the L1 bus and the R1 bus, respectively, and their output ports are connected to the D1 bus.

オペランドアクセス部88およびデータメモリ100は、OA(Operand Address)バス96およびOD(OperandData)バス94により接続されている。OAバス96およびODバス94はそれぞれ32ビット幅である。また、オペランドアクセス部88は、OAバス96を介してデータメモリ100のアドレスを指定し、ODバス94を介して、当該アドレスのデータの読み書きを行なう。   The operand access unit 88 and the data memory 100 are connected by an OA (Operand Address) bus 96 and an OD (OperandData) bus 94. The OA bus 96 and the OD bus 94 are each 32 bits wide. The operand access unit 88 designates the address of the data memory 100 via the OA bus 96 and reads / writes data at the address via the OD bus 94.

また、オペランドアクセス部88は、D1バス、D2バス、D3バス、L1バスおよびR1バスに接続され、いずれかのバスとの間でデータの受渡しを行なう。   Operand access unit 88 is connected to the D1 bus, D2 bus, D3 bus, L1 bus, and R1 bus, and exchanges data with any of the buses.

プロセッサ30は、3命令を並列実行可能であるが、後述するように、パイプライン動作のうち、並列実行可能な命令割り当てステージ、デコードステージ、実行ステージおよび書き込みステージからなる1組のパイプライン処理を実行させうる回路の集合を本明細書中で「スロット」と定義する。したがって、プロセッサ30は、第1〜第3スロットの3つのスロットを有する。命令レジスタ56aおよび命令デコーダ64aの組は第1スロット、命令レジスタ56bおよび命令デコーダ64bの組は第2スロット、命令レジスタ56cおよび命令デコーダ64cの組は第3スロットにそれぞれ属するものとする。   Although the processor 30 can execute three instructions in parallel, as will be described later, in the pipeline operation, a set of pipeline processing including an instruction allocation stage, a decode stage, an execution stage, and a write stage that can be executed in parallel is performed. A set of circuits that can be executed is defined herein as a “slot”. Therefore, the processor 30 has three slots of the first to third slots. Assume that the instruction register 56a and instruction decoder 64a belong to the first slot, the instruction register 56b and instruction decoder 64b belongs to the second slot, and the instruction register 56c and instruction decoder 64c belongs to the third slot.

各スロットには、デフォルト論理と呼ばれる命令が割り当てられており、同一のスロットでは極力同一の命令が実行されるように、命令スケジューリングが行なわれる。例えば、第1スロットにはメモリアクセスに関する命令(デフォルト論理)、第2スロットには乗算に関するデフォルト論理、第3スロットにはその他のデフォルト論理が割り当てられている。なお、デフォルト論理は、図1を参照して説明したオペレーション群と一対一に対応している。すなわち、先頭2ビットが“01”、“10”および“11”の命令は、それぞれ第1スロット、第2スロットおよび第3スロットのデフォルト論理である。   Each slot is assigned an instruction called default logic, and instruction scheduling is performed so that the same instruction is executed as much as possible in the same slot. For example, an instruction relating to memory access (default logic) is assigned to the first slot, a default logic relating to multiplication is assigned to the second slot, and other default logic is assigned to the third slot. Note that the default logic has a one-to-one correspondence with the operation group described with reference to FIG. That is, instructions whose first 2 bits are “01”, “10”, and “11” are the default logic of the first slot, the second slot, and the third slot, respectively.

第1スロットのデフォルト論理としては、ld(ロード命令)、st(ストア命令)などがある。第2スロットのデフォルト論理としては、mul1,mul2(乗算命令)などがある。第3スロットのデフォルト論理としては、add1,add2(加算命令)、sub1,sub2(減算命令)、mov1,mov2(レジスタ間の転送命令)などがある。   The default logic of the first slot includes ld (load instruction), st (store instruction), and the like. The default logic of the second slot includes mul1, mul2 (multiplication instruction) and the like. The default logic of the third slot includes add1, add2 (addition instruction), sub1, sub2 (subtraction instruction), mov1, mov2 (transfer instruction between registers), and the like.

図4は、パケットに含まれる並列実行境界情報について説明するための図である。命令メモリ40には、パケット112および114の順でパケットが記憶されているものとする。このうち、パケット112の命令2およびパケット114の命令5の並列実行境界情報は“1”であるものとし、それ以外の命令の並列実行境界情報は“0”であるものとする。   FIG. 4 is a diagram for explaining parallel execution boundary information included in a packet. Assume that packets are stored in the instruction memory 40 in the order of packets 112 and 114. Among these, the parallel execution boundary information of the instruction 2 of the packet 112 and the instruction 5 of the packet 114 is “1”, and the parallel execution boundary information of the other instructions is “0”.

命令フェッチ部52は、PC部74のプログラムカウンタの値に基づいて、パケット112、パケット114の順でパケットを読み込み、順次、命令バッファ54に供給する。実行部70では並列実行境界情報が“1”までの命令が並列実行される。   The instruction fetch unit 52 reads the packets in the order of the packet 112 and the packet 114 based on the value of the program counter of the PC unit 74 and sequentially supplies the packets to the instruction buffer 54. In the execution unit 70, instructions up to the parallel execution boundary information “1” are executed in parallel.

図5は、パケットの並列実行境界情報に基づいて作成された並列実行される命令の実行単位の一例を示す図である。図4および図5を参照して、パケット112および114を並列実行境界情報が“1”の命令の部分で区切ると、実行単位122〜126が生成される。したがって、命令バッファ54から命令レジスタ部56には、実行単位122〜126の順で命令が供給されることとなる。これらの、命令の供給に関する制御は、命令発行制御部62が行なう。   FIG. 5 is a diagram illustrating an example of an execution unit of instructions executed in parallel created based on parallel execution boundary information of packets. Referring to FIGS. 4 and 5, when packets 112 and 114 are separated by an instruction portion whose parallel execution boundary information is “1”, execution units 122 to 126 are generated. Therefore, instructions are supplied from the instruction buffer 54 to the instruction register unit 56 in the order of the execution units 122 to 126. The command issue control unit 62 performs control related to the supply of commands.

命令デコーダ64a〜64cは、命令レジスタ56a〜56cに保持された命令のオペコードをそれぞれ解読し、制御信号を実行制御部72に出力する。実行制御部72は、命令デコーダ64a〜64cでの解析結果に基づいて、実行部70の構成要素の各種制御を行なう。   The instruction decoders 64 a to 64 c decode the operation codes of the instructions held in the instruction registers 56 a to 56 c, respectively, and output control signals to the execution control unit 72. The execution control unit 72 performs various controls of the components of the execution unit 70 based on the analysis results of the instruction decoders 64a to 64c.

例えば、命令“add1 R3,R0”について考える。この命令の意味は、レジスタR3の値とレジスタR0の値とを加算し、結果をレジスタR0に書き込むというものであるが、この場合、実行制御部72は、以下のような制御を一例として行なう。実行制御部72は、レジスタR3に保持された値をL1バスに出力するための制御信号CL1をレジスタファイル76に供給する。また、実行制御部72は、レジスタR0に保持された値をR1バスに出力するための制御信号CR1をレジスタファイル76に供給する。   For example, consider the instruction “add1 R3, R0”. The meaning of this instruction is to add the value of the register R3 and the value of the register R0 and write the result to the register R0. In this case, the execution control unit 72 performs the following control as an example. . The execution control unit 72 supplies the register file 76 with a control signal CL1 for outputting the value held in the register R3 to the L1 bus. In addition, the execution control unit 72 supplies the register file 76 with a control signal CR1 for outputting the value held in the register R0 to the R1 bus.

さらに、実行制御部72は、D1バスを介して得られる実行結果をレジスタR0に書き込むための制御信号CD1をレジスタファイル76に供給する。さらにまた、実行制御部72は算術論理・比較演算部78aを制御し、L1バスおよびL2バスを介してレジスタR3およびR0の値を受け取り、加算した後、加算結果をD1バスを介してレジスタR0に書き込む。   Further, the execution control unit 72 supplies a control signal CD1 for writing the execution result obtained through the D1 bus to the register R0 to the register file 76. Furthermore, the execution control unit 72 controls the arithmetic logic / comparison operation unit 78a, receives the values of the registers R3 and R0 via the L1 bus and the L2 bus, adds them, and then adds the addition result to the register R0 via the D1 bus. Write to.

図6は、算術論理・比較演算部78a〜78cの概略構成を示すブロック図である。図6および図2を参照して、算術論理・比較演算部78a〜78cの各々は、データバス90を介してレジスタファイル76に接続されたALU(Arithmetic and Logical Unit)部132と、ALU部132およびデータバス92を介してレジスタファイル76に接続され、飽和、最大・最小値検出、絶対値生成処理を行なう飽和処理部134と、ALU部132に接続され、オーバーフローの検出とコンディションフラグの生成を行なうフラグ部136とを含む。   FIG. 6 is a block diagram showing a schematic configuration of the arithmetic logic / comparison arithmetic units 78a to 78c. Referring to FIGS. 6 and 2, each of arithmetic logic / comparison operation units 78 a to 78 c includes an ALU (Arithmetic and Logical Unit) unit 132 connected to a register file 76 via a data bus 90, and an ALU unit 132. And connected to the register file 76 via the data bus 92 and connected to the saturation processing unit 134 for performing saturation, maximum / minimum value detection and absolute value generation processing, and the ALU unit 132 for detecting overflow and generating a condition flag. And a flag section 136 to be executed.

図7は、バレルシフタ82a〜82cの概略構成を示すブロック図である。図7および図2を参照して、バレルシフタ82a〜82cの各々は、32ビットのデータを保持するアキュムレータM0およびM1を有するアキュムレータ部142と、アキュムレータM0およびデータバス90を介してレジスタファイル76に接続され、アキュムレータM0またはレジスタの値を受けるセレクタ146と、アキュムレータM1およびデータバス90を介してレジスタファイル76に接続され、アキュムレータM1およびレジスタの値を受けるセレクタ148と、セレクタ146の出力に接続された上位バレルシフタ150と、セレクタ148の出力に接続された下位バレルシフタ152と、上位バレルシフタ150および下位バレルシフタ152の出力に接続された飽和処理部154とを含む。   FIG. 7 is a block diagram illustrating a schematic configuration of the barrel shifters 82a to 82c. 7 and 2, each of barrel shifters 82a to 82c is connected to accumulator unit 142 having accumulators M0 and M1 for holding 32-bit data, and to register file 76 via accumulator M0 and data bus 90. Connected to the register file 76 via the accumulator M1 and the data bus 90, and connected to the output of the selector 146 and the selector 148 that receives the values of the accumulator M1 and the register. Upper barrel shifter 150, lower barrel shifter 152 connected to the output of selector 148, and saturation processing unit 154 connected to the outputs of upper barrel shifter 150 and lower barrel shifter 152.

飽和処理部154の出力は、アキュムレータ部142とデータバス92を介してレジスタファイル76とに接続されている。   The output of the saturation processing unit 154 is connected to the register file 76 via the accumulator unit 142 and the data bus 92.

バレルシフタ82a〜82cの各々は、構成部品を動作させることにより、データの算術シフト(2の補数体系のシフト)または論理シフト(符号なしシフト)を実行する。通常は、32ビットもしくは、64ビットのデータを入出力としている。レジスタファイル76内のレジスタまたはアキュムレータ部142内のアキュムレータに格納された被シフトデータに対して、別のレジスタまたは即値でシフト量が指定される。データは、左63ビット〜右63ビットの算術または論理シフトが行われ、入力ビット長で出力される。   Each of the barrel shifters 82a to 82c performs an arithmetic shift of data (shift of two's complement system) or logical shift (unsigned shift) by operating a component. Normally, 32-bit or 64-bit data is input / output. For the data to be shifted stored in the register in the register file 76 or the accumulator in the accumulator unit 142, the shift amount is designated by another register or an immediate value. The data is arithmetically or logically shifted from the left 63 bits to the right 63 bits and output with an input bit length.

また、バレルシフタ82a〜82cの各々は、SIMD型命令に対して、8、16、32、64ビットのデータをシフトすることができる。例えば、8ビットデータのシフトを4並列で処理することができる。   Further, each of the barrel shifters 82a to 82c can shift data of 8, 16, 32, and 64 bits with respect to the SIMD type instruction. For example, a shift of 8-bit data can be processed in 4 parallel.

算術シフトは、2の補数体系のシフトであり、加算や減算時の小数点の位置合わせや、2のべき乗の乗算(2、2の2乗、2の(−1)乗、2の(−2)乗倍など)等のために行われる。   Arithmetic shift is a shift of 2's complement system, and alignment of decimal point at the time of addition or subtraction, multiplication by power of 2 (2, 2 squared, 2 (-1) power, 2 (-2) Etc.) etc.

図8は、除算器84の概略構成を示すブロック図である。図8および図2を参照して、除算器84は、32ビットのデータを保持するアキュムレータM0およびM1を有するアキュムレータ部162と、アキュムレータ部162ならびにデータバス90および92を介してレジスタファイル76に接続された除算部164とを含む。   FIG. 8 is a block diagram showing a schematic configuration of the divider 84. Referring to FIGS. 8 and 2, divider 84 is connected to register file 76 via accumulator unit 162 having accumulators M0 and M1 holding 32-bit data, and accumulator unit 162 and data buses 90 and 92. Divided division unit 164.

除算器84は、被除数を64ビット、除数を32ビットとし、商と剰余を32ビットずつ出力する。商と剰余を求めるまでに34サイクルを必要とする。符号付き、符号なし、両方のデータを扱うことが可能である。ただし、被除数と除数において符号の有無の設定は共通とする。その他、オーバーフローフラグ、0除算フラグを出力する機能を有する。   Divider 84 sets the dividend to 64 bits and the divisor to 32 bits, and outputs the quotient and remainder each 32 bits. 34 cycles are required to find the quotient and the remainder. Both signed and unsigned data can be handled. However, the setting of the presence / absence of a sign is common to the dividend and the divisor. In addition, it has a function of outputting an overflow flag and a division by zero flag.

図9は、乗算・積和演算部80aおよび80bの概略構成を示すブロック図である。図9および図2を参照して、乗算・積和演算部80aおよび80bの各々は、64ビットのデータを保持するアキュムレータM0およびM1を有するアキュムレータ部172と、各々データバス90を介してレジスタファイル76に接続された2入力の32ビット乗算器(MUL)174aおよび174bとを含む。   FIG. 9 is a block diagram showing a schematic configuration of the multiplication / product-sum operation units 80a and 80b. Referring to FIGS. 9 and 2, each of multiplication / product-sum operation units 80a and 80b includes an accumulator unit 172 having accumulators M0 and M1 for holding 64-bit data, and a register file via data bus 90, respectively. 2-input 32-bit multipliers (MUL) 174a and 174b connected to 76.

乗算・積和演算部80aおよび80bの各々は、さらに、乗算器174aの出力およびアキュムレータ部172に接続された64ビット加算器(Adder)176aと、乗算器174bの出力およびアキュムレータ部172に接続された64ビット加算器176bと、64ビット加算器176aおよび64ビット加算器176bの出力に接続された64ビット加算器176cと、64ビット加算器176bおよび176cの出力に接続されたセレクタ178と、加算器176aの出力、セレクタ178の出力、アキュムレータ部172およびデータバス92を介してレジスタファイル76に接続された飽和処理部(Saturation)180とを含む。   Each of multiplication / product-sum operation units 80a and 80b is further connected to an output and accumulator unit 172 of a multiplier 174b, and a 64-bit adder (Adder) 176a connected to the output and accumulator unit 172 of multiplier 174a. 64-bit adder 176b, 64-bit adder 176c connected to the outputs of 64-bit adder 176a and 64-bit adder 176b, selector 178 connected to the outputs of 64-bit adders 176b and 176c, And an output of the selector 178, an accumulator unit 172, and a saturation processing unit (Saturation) 180 connected to the register file 76 via the data bus 92.

乗算・積和演算部80aおよび80bの各々は、以下の乗算、積和演算を行う。
・32×32ビットのsignedの乗算、積和、積差演算
・32×32ビットのunsignedの乗算
・16×16ビットの2並列のsignedの乗算、積和、積差演算
・32×16ビットの2並列のsignedの乗算、積和、積差演算
Each of the multiplication / product-sum operation units 80a and 80b performs the following multiplication and product-sum operation.
32 × 32 bit signed multiplication, product sum, product difference operation 32 × 32 bit unsigned multiplication 16 × 16 bit 2-parallel signed multiplication, product sum, product difference operation 32 × 16 bit 2 parallel signed multiplication, product sum, product difference operation

これらの演算を整数、固定小数点フォーマットのデータに対して行う。また、これらの演算に対し、丸め、飽和を行う。   These operations are performed on data in integer and fixed-point format. Also, rounding and saturation are performed for these operations.

図10は、このようなプロセッサ30による命令実行時の各パイプライン動作を示すタイミング図である。図2および図10を参照して、命令フェッチステージでは、命令フェッチ部52が、PC部74に保持されたプログラムカウンタで指定されるアドレスの命令メモリ40をアクセスし、パケットを命令バッファ54に転送する。命令割り当てステージでは、命令バッファ54に保持された命令が命令レジスタ56a〜56cに割り当てられる。デコードステージでは、命令レジスタ56a〜56cに割り当てられた命令が、命令発行制御部62からの制御に従い、命令デコーダ64a〜64cでそれぞれデコードされる。実行ステージでは、命令デコーダ64a〜64cでのデコード結果に基づいて、実行制御部72が実行部70の構成部品を動作させ、各種演算を実行する。書き込みステージでは、演算結果をデータメモリ100またはレジスタファイル76に格納する。これらの処理により、最高3並列のパイプライン処理が実行可能になる。   FIG. 10 is a timing chart showing each pipeline operation when an instruction is executed by the processor 30. 2 and 10, in the instruction fetch stage, the instruction fetch unit 52 accesses the instruction memory 40 at the address specified by the program counter held in the PC unit 74 and transfers the packet to the instruction buffer 54. To do. In the instruction assignment stage, instructions held in the instruction buffer 54 are assigned to the instruction registers 56a to 56c. In the decode stage, the instructions assigned to the instruction registers 56a to 56c are decoded by the instruction decoders 64a to 64c, respectively, according to the control from the instruction issue control unit 62. In the execution stage, the execution control unit 72 operates the components of the execution unit 70 based on the decoding results from the instruction decoders 64a to 64c, and executes various calculations. In the write stage, the calculation result is stored in the data memory 100 or the register file 76. With these processes, up to three parallel pipeline processes can be executed.

図11は、プロセッサ30で実行される命令、処理の内容およびそのビットパターンを示す図である。命令“ld Rs,Rd”は、データメモリ100の、図1で示したオペレーションのRsフィールドで指定されるレジスタ(以下「レジスタRs」という。以下同様である。)の値の番地のデータメモリ100に記憶されたデータを、レジスタRdにロードする処理を示す。そのビットパターンは、図11で図示したとおりである。   FIG. 11 is a diagram illustrating instructions executed by the processor 30, processing contents, and bit patterns thereof. The instruction “ld Rs, Rd” is the data memory 100 of the address of the value of the register (hereinafter referred to as “register Rs”; hereinafter the same) designated in the Rs field of the operation shown in FIG. Shows a process of loading the data stored in the register Rd. The bit pattern is as shown in FIG.

なお、図11のビットパターンのうち、先頭2ビット(30および31ビット目)は、オペレーション群を指定するために用いられ、0ビット目は、並列実行境界情報を指定するために用いられる。上述の先頭2ビットが“01”のオペレーションは、メモリアクセスに関するものである。先頭2ビットが“10”のオペレーションは、乗算に関するものである。先頭2ビットが“11”のオペレーションは、その他の演算に関するものである。   In the bit pattern of FIG. 11, the first 2 bits (30th and 31st bits) are used to specify an operation group, and the 0th bit is used to specify parallel execution boundary information. The above-described operation in which the first two bits are “01” relates to memory access. An operation whose first 2 bits are “10” relates to multiplication. The operation having the first two bits of “11” relates to other operations.

命令“st Rs,Rd”は、レジスタRsの値を、データメモリ100のレジスタRdで指定される番地にストアする処理を示す。   The instruction “st Rs, Rd” indicates a process of storing the value of the register Rs at the address specified by the register Rd of the data memory 100.

命令“mul1 Rs,Rd”は、レジスタRsの値とレジスタRdの値との積をレジスタRdに書き込む処理を示す。命令“mul2 Rs1,Rs2、Rd”は、レジスタRs1の値とレジスタRs2の値との積をレジスタRdに書き込む処理を示す。   The instruction “mul1 Rs, Rd” indicates a process of writing the product of the value of the register Rs and the value of the register Rd to the register Rd. The instruction “mul2 Rs1, Rs2, Rd” indicates a process of writing the product of the value of the register Rs1 and the value of the register Rs2 to the register Rd.

命令“add1 Rs,Rd”は、レジスタRsの値とレジスタRdの値との和をレジスタRdに書き込む処理を示す。命令“add2 Rs1,Rs2,Rd”は、レジスタRs1の値とレジスタRs2の値との和をレジスタRdに書き込む処理を示す。   The instruction “add1 Rs, Rd” indicates a process of writing the sum of the value of the register Rs and the value of the register Rd to the register Rd. The instruction “add2 Rs1, Rs2, Rd” indicates a process of writing the sum of the value of the register Rs1 and the value of the register Rs2 to the register Rd.

命令“sub1 Rs,Rd”は、レジスタRsの値とレジスタRdの値との差をレジスタRdに書き込む処理を示す。命令“sub2 Rs1,Rs2,Rd”は、レジスタRs1の値とレジスタRs2の値との差をレジスタRdに書き込む処理を示す。   The instruction “sub1 Rs, Rd” indicates a process of writing the difference between the value of the register Rs and the value of the register Rd into the register Rd. The instruction “sub2 Rs1, Rs2, Rd” indicates a process of writing the difference between the value of the register Rs1 and the value of the register Rs2 to the register Rd.

命令“mov1 Rs,Rd”は、レジスタRsの値をレジスタRdに書き込む処理を示す。命令“mov2 Imm,Rd”は、Immフィールドの値をレジスタRdに書き込む処理を示す。   The instruction “mov1 Rs, Rd” indicates a process of writing the value of the register Rs to the register Rd. The instruction “mov2 Imm, Rd” indicates a process of writing the value of the Imm field into the register Rd.

命令“div Rs,Rd”は、レジスタRsの値をレジスタRdの値で除した商をレジスタRdに書き込む処理を示す。命令“mod Rs,Rd”は、レジスタRsの値をレジスタRdの値で除した剰余をレジスタRdに書き込む処理を示す。   The instruction “div Rs, Rd” indicates a process of writing a quotient obtained by dividing the value of the register Rs by the value of the register Rd into the register Rd. The instruction “mod Rs, Rd” indicates a process of writing a remainder obtained by dividing the value of the register Rs by the value of the register Rd into the register Rd.

[コンパイラ]
次に、上述のプロセッサ30をターゲットとする本実施の形態に係るコンパイラの一例について図12〜図38を用いて説明する。
[compiler]
Next, an example of a compiler according to the present embodiment targeting the above-described processor 30 will be described with reference to FIGS.

[コンパイラの全体構成]
図12は、本実施の形態に係るコンパイラ200の構成を示す機能ブロック図である。このコンパイラ200は、C/C++言語等の高級言語で記述されたソースプログラム202を、上述のプロセッサ30をターゲットプロセッサとする機械語プログラム204に変換するクロスコンパイラであり、パーソナルコンピュータ等のコンピュータ上で実行されるプログラムによって実現され、大きく分けて、パーサー部210と、中間コード変換部220と、最適化部230と、コード生成部240とから構成される。
[Compiler overall configuration]
FIG. 12 is a functional block diagram showing a configuration of the compiler 200 according to the present embodiment. The compiler 200 is a cross compiler that converts a source program 202 described in a high-level language such as a C / C ++ language into a machine language program 204 using the processor 30 as a target processor, and is executed on a computer such as a personal computer. The program is implemented by a program to be executed, and roughly includes a parser unit 210, an intermediate code conversion unit 220, an optimization unit 230, and a code generation unit 240.

パーサー部210は、コンパイルの対象となるソースプログラム202(インクルードされるヘッダファイルを含む)に対して、予約語(キーワード)等を抽出して字句解析する前置処理部であり、通常のコンパイラが備える解析機能を有する。   The parser unit 210 is a preprocessing unit that extracts reserved words (keywords) and the like from a source program 202 (including an included header file) to be compiled, and performs lexical analysis. It has an analysis function.

中間コード変換部220は、パーサー部210に接続され、パーサー部210から渡されたソースプログラム202の各ステートメントを一定規則に基づいて中間コードに変換する処理部である。ここで、中間コードは、典型的には、関数呼び出しの形式で表現されるコード(例えば、「+(int a, int b)」を示すコード;「整数aに整数bを加算する」ことを示す。)である。   The intermediate code conversion unit 220 is a processing unit that is connected to the parser unit 210 and converts each statement of the source program 202 passed from the parser unit 210 into an intermediate code based on a certain rule. Here, the intermediate code is typically a code expressed in the form of a function call (for example, a code indicating “+ (int a, int b)”; “adding an integer b to an integer a” It is shown.)

最適化部230は、中間コード変換部220に接続され、中間コード変換部220から出力された中間コードについて、命令のオペコードに着目し、命令間の依存関係を崩すことなくプロセッサ30の消費電力が小さくなるように、命令の配置を行なう命令スケジューリング部232と、命令スケジューリング部232に接続され、命令スケジューリング部232でのスケジュール結果について、命令のレジスタフィールドに着目して、プロセッサ30の消費電力が小さくなるようにレジスタを割り付けるレジスタ割付部234とを含む。   The optimization unit 230 is connected to the intermediate code conversion unit 220. With regard to the intermediate code output from the intermediate code conversion unit 220, the optimization unit 230 focuses on the operation code of the instruction, and the power consumption of the processor 30 is reduced without breaking the dependency between instructions. The instruction scheduling unit 232 that arranges instructions so as to be smaller, and the instruction scheduling unit 232 are connected to the instruction scheduling unit 232. Regarding the schedule result in the instruction scheduling unit 232, the power consumption of the processor 30 is reduced by focusing on the register field of the instruction. A register allocation unit 234 for allocating registers.

最適化部230は、さらに、レジスタ割付部234に接続され、レジスタが割り付けられたスケジュール結果について、命令のビットパターンに着目し、命令の依存関係を崩すことなくプロセッサ30の消費電力が小さくなるように、命令の再配置を行なう命令再スケジューリング部236と、命令再スケジューリング部236に接続され、命令再スケジューリング部236のスケジュール結果について、一定サイクル以上停止しているスロットを検出し、その前後に、当該スロットを停止および復帰させる命令を挿入するスロット停止・復帰命令生成部238とを含む。   The optimization unit 230 is further connected to the register allocation unit 234, and pays attention to the bit pattern of the instruction for the schedule result to which the register is allocated so that the power consumption of the processor 30 is reduced without breaking the instruction dependency. In addition, an instruction rescheduling unit 236 that performs instruction relocation, and a slot that is connected to the instruction rescheduling unit 236 and that is stopped for a predetermined cycle or more from the schedule result of the instruction rescheduling unit 236, A slot stop / return command generation unit 238 for inserting a command for stopping and returning the slot.

最適化部230は、さらに、スロット停止・復帰命令生成部238に接続され、スケジュール結果に基づいて、配置された命令の並列実行境界情報を設定する並列実行境界情報設定部239と、命令スケジューリング部232、レジスタ割付部234および命令再スケジューリング部236に接続され、スケジュール結果を各サイクルごとに消費電力が小さくなるように配置しなおすサイクル内配置調整処理部237とを含む。   The optimization unit 230 is further connected to the slot stop / return instruction generation unit 238, and sets a parallel execution boundary information setting unit 239 for setting parallel execution boundary information of the arranged instruction based on the schedule result, and an instruction scheduling unit 232, a register allocation unit 234, and an instruction rescheduling unit 236, and an in-cycle arrangement adjustment processing unit 237 that rearranges the schedule results so that the power consumption decreases for each cycle.

なお、後述する最適化部230での処理は、基本ブロック単位に行なわれる。基本ブロックとは、たとえば式や代入文の並びのような、途中から外部への分岐が起こらず、また、外部から途中への分岐も起こらないプログラムの単位を言う。   Note that processing in the optimization unit 230 described later is performed in units of basic blocks. A basic block is a unit of a program that does not branch from the middle to the outside, such as a sequence of expressions or assignment statements, and does not branch from the middle to the middle.

コード生成部240は、最適化部230の並列実行境界情報設定部239に接続され、並列実行境界情報設定部239から出力された中間コードに対して、内部に保持する変換テーブル等を参照することで、全ての中間コードを機械語命令に置き換えることで、機械語プログラム204を生成する。   The code generation unit 240 is connected to the parallel execution boundary information setting unit 239 of the optimization unit 230, and refers to a conversion table or the like held internally for the intermediate code output from the parallel execution boundary information setting unit 239. Thus, the machine language program 204 is generated by replacing all intermediate codes with machine language instructions.

次に、以上のように構成されたコンパイラ200の特徴的な動作について、具体的な例を示しながら説明する。   Next, a characteristic operation of the compiler 200 configured as described above will be described with a specific example.

[命令スケジューリング部]
図13は、命令スケジューリング部232の動作を示すフローチャートである。命令スケジューリング部232の処理では、レジスタのスケジューリングは行なわず、レジスタの個数は無限にあると想定して処理が行なわれる。したがって、以下の説明では、命令スケジューリング部232でスケジューリングされるレジスタにはVr(Virtual Register)0、Vr1など、先頭にVrが付されるものとする。
[Instruction scheduling section]
FIG. 13 is a flowchart showing the operation of the instruction scheduling unit 232. In the process of the instruction scheduling unit 232, the register scheduling is not performed, and the process is performed assuming that the number of registers is infinite. Therefore, in the following description, it is assumed that a register scheduled by the instruction scheduling unit 232 is prefixed with Vr such as Vr (Virtual Register) 0 and Vr1.

命令スケジューリング部232は、中間コード変換部220で生成された中間コードに基づいて、命令の依存グラフを作成する(ステップS2(以下「ステップ」を省略する。))。依存グラフとは、命令間の依存関係を示したグラフであり、命令ごとにノードを割り付け、依存関係のある命令をエッジで結んだ有向グラフである。依存グラフに関しては、周知の技術である。したがって、その詳細な説明はここでは繰返さない。たとえば、ここでは、図14(a)に示されるような3つの有向グラフからなる依存グラフが作成されるものとする。   The instruction scheduling unit 232 creates an instruction dependency graph based on the intermediate code generated by the intermediate code conversion unit 220 (step S2 (hereinafter, “step” is omitted)). The dependency graph is a graph showing a dependency relationship between instructions, and is a directed graph in which a node is allocated for each instruction and instructions having a dependency relationship are connected by an edge. The dependency graph is a well-known technique. Therefore, detailed description thereof will not be repeated here. For example, here, it is assumed that a dependency graph composed of three directed graphs as shown in FIG.

命令スケジューリング部232は、依存グラフの中から実行可能な命令(ノード)を選択し、そのうち、各スロットのデフォルト論理に合致するように1サイクル目の命令をスケジューリングする(S4)。例えば、図14(a)の依存グラフでは、ノードN1、N6、N7、N11およびN12の命令のノードがスケジューリング可能であるが、そのうち、ノードN1がメモリアクセスに関する命令であり、ノードN11が乗算命令であり、ノードN6がシフト命令であるとする。この場合、ノードN1、N11およびN6がそれぞれ1サイクル目の第1〜第3スロットにそれぞれ配置される。配置済みのノードにはフラグが付され、依存グラフは図14(b)のように更新される。1サイクル目の命令スケジューリング(S4)の後、図15に示されるような命令のスケジュール結果が得られる。   The instruction scheduling unit 232 selects an executable instruction (node) from the dependency graph, and schedules the instruction in the first cycle so as to match the default logic of each slot (S4). For example, in the dependency graph of FIG. 14A, the nodes of the instructions of the nodes N1, N6, N7, N11, and N12 can be scheduled. Of these, the node N1 is an instruction related to memory access, and the node N11 is a multiplication instruction. And node N6 is a shift instruction. In this case, nodes N1, N11, and N6 are arranged in the first to third slots of the first cycle, respectively. A flag is attached to the arranged node, and the dependency graph is updated as shown in FIG. After instruction scheduling (S4) in the first cycle, an instruction scheduling result as shown in FIG. 15 is obtained.

命令スケジューリング部232は、依存グラフを参照し、配置候補命令集合を生成する(S8)。すなわち、図14(b)の例では、ノードN2、N7、N8およびN12で示される命令が配置候補命令集合となる。   The instruction scheduling unit 232 generates a placement candidate instruction set with reference to the dependency graph (S8). That is, in the example of FIG. 14B, the instructions indicated by the nodes N2, N7, N8, and N12 are the arrangement candidate instruction set.

命令スケジューリング部232は、配置候補命令集合の中から後述するアルゴリズムに従い、最適な命令を1つ取り出す(S12)。   The instruction scheduling unit 232 extracts one optimum instruction from the arrangement candidate instruction set according to an algorithm described later (S12).

命令スケジューリング部232は、取り出された最適命令が実際に配置可能か否かを判断する(S14)。配置可能か否かの判断は、最適命令を配置したと仮定した場合の着目サイクルの命令数が、1つ前のサイクルに配置された命令数を超えないか否かにより判断される。これにより、同一数の命令が配置されたサイクルが連続することとなる。   The instruction scheduling unit 232 determines whether or not the extracted optimum instruction can actually be arranged (S14). Judgment as to whether or not placement is possible is made based on whether or not the number of instructions in the target cycle assuming that the optimum instruction has been placed does not exceed the number of instructions placed in the previous cycle. As a result, a cycle in which the same number of instructions are arranged continues.

配置可能と判断した場合には(S14でYES)、その最適命令を仮配置し、配置候補命令集合から削除する(S16)。その後、命令スケジューリング部232は、さらに命令を配置することが可能か否かを、上述の判断処理(S14)と同様にして判断する(S18)。配置可能と判断した場合には(S18でYES)、依存グラフを参照し、新たな配置候補命令が生じた場合には、それを配置候補命令集合に追加する(S20)。以上の着目サイクルに対する命令仮配置処理を、配置候補命令がなくなるまで繰返す(S10〜S22)。   If it is determined that placement is possible (YES in S14), the optimum instruction is provisionally placed and deleted from the placement candidate instruction set (S16). Thereafter, the instruction scheduling unit 232 determines whether or not further instructions can be arranged in the same manner as the above-described determination process (S14) (S18). If it is determined that placement is possible (YES in S18), the dependency graph is referred to, and if a new placement candidate instruction is generated, it is added to the placement candidate instruction set (S20). The instruction temporary arrangement process for the above target cycle is repeated until there are no arrangement candidate instructions (S10 to S22).

なお、最適命令の仮配置処理(S16)の後、これ以上、着目サイクルに命令を配置することができないと判断した場合には(S18でNO)、命令の仮配置処理(S10〜S22)のループを抜ける。   If it is determined that the instruction cannot be arranged in the target cycle after the optimum instruction temporary arrangement process (S16) (NO in S18), the instruction temporary arrangement process (S10 to S22) is performed. Exit the loop.

命令の仮配置処理(S10〜S22)の後、命令スケジューリング部232は、仮配置された命令を確定させ、配置候補命令集合に対するスケジューリングを終了する(S24)。その後、配置済みの命令に関しては、依存グラフの対応するノードに配置済みのフラグが付され、依存グラフの更新が行なわれる(S26)。   After the instruction temporary placement process (S10 to S22), the instruction scheduling unit 232 determines the temporarily placed instruction and ends the scheduling for the placement candidate instruction set (S24). Thereafter, for the arranged instruction, the arranged flag is attached to the corresponding node of the dependency graph, and the dependency graph is updated (S26).

命令スケジューリング部232は、一定サイクル以上、同一数の命令が連続配置されているか否かを判断する(S27)。一定サイクル以上、同一数の命令が連続配置されていると判断した場合(たとえば、20サイクル以上2命令が連続配置されている場合や、10サイクル以上1命令が連続配置されている場合)には(S27でYES)、命令スケジューリング部232は、1サイクルに配置可能な命令の最大数(以下「最大配置可能命令数」という。)を3に設定し(S28)、以降のサイクルでは、なるべく、1サイクルに3命令が配置されるようにする。以上の処理を、未配置命令がなくなるまで繰返す(S6〜S29)。   The instruction scheduling unit 232 determines whether or not the same number of instructions are continuously arranged for a predetermined cycle or more (S27). When it is determined that the same number of instructions are continuously arranged over a certain cycle (for example, when 2 instructions are continuously arranged for 20 cycles or more, or 1 instruction is continuously arranged for 10 cycles or more) (YES in S27), the instruction scheduling unit 232 sets the maximum number of instructions that can be arranged in one cycle (hereinafter referred to as “the maximum number of instructions that can be arranged”) to 3 (S28), and in the subsequent cycles, as much as possible. Three instructions are arranged in one cycle. The above processing is repeated until there are no unplaced instructions (S6 to S29).

図16は、図13の最適命令取出し処理(S12)の動作を示すフローチャートである。   FIG. 16 is a flowchart showing the operation of the optimum instruction fetch process (S12) of FIG.

命令スケジューリング部232は、配置候補命令の各々について、着目サイクルの1つ前のサイクルで配置された命令の各々との間で、オペコードのビットパターン間のハミング距離を求める(S42)。   The instruction scheduling unit 232 obtains the Hamming distance between the bit patterns of the opcode between each of the placement candidate instructions and each of the instructions placed in the cycle immediately before the target cycle (S42).

たとえば、図14(b)を参照して、2サイクル目のスケジューリングの開始当初は、ノードN2、N7、N8およびN12が配置可能である。1サイクル目では、ノードN1、N6およびN11が配置されている。このため、ノードN1、N6およびN11とノードN2、N7、N8およびN12との間のすべての組み合わせについて、オペコードのビットパターン間のハミング距離が求められることになる。   For example, referring to FIG. 14B, nodes N2, N7, N8, and N12 can be arranged at the beginning of the scheduling of the second cycle. In the first cycle, nodes N1, N6 and N11 are arranged. For this reason, the Hamming distance between the bit patterns of the opcodes is obtained for all combinations between the nodes N1, N6 and N11 and the nodes N2, N7, N8 and N12.

図17は、オペコードのビットパターン間のハミング距離の算出方法を説明するための図である。Nサイクル目にはすでに、命令“ld Vr11,Vr12”が配置済みであり、N+1サイクル目の配置候補命令は、“st Vr13,Vr14”および“add1 Vr13,Vr14”であるとする。図17(a)を参照して、オペコード“ld”および“st”は、12、16、17、24および25ビット目のビットパターンが異なる。このため、ハミング距離は5である。同様にして、図17(b)を参照して、オペコード“ld”および“add1”は、16、17、18、20、25、26、28および31ビット目のビットパターンが異なる。このため、ハミング距離は8である。   FIG. 17 is a diagram for explaining a method of calculating the Hamming distance between the bit patterns of the operation code. It is assumed that the instruction “ld Vr11, Vr12” has already been arranged in the Nth cycle, and the arrangement candidate instructions in the N + 1th cycle are “st Vr13, Vr14” and “add1 Vr13, Vr14”. Referring to FIG. 17A, the operation codes “ld” and “st” have different bit patterns of the 12, 16, 17, 24, and 25th bits. For this reason, the Hamming distance is 5. Similarly, referring to FIG. 17B, the operation codes “ld” and “add1” have different bit patterns of the 16, 17, 18, 20, 25, 26, 28, and 31 bits. For this reason, the Hamming distance is 8.

図18は、ビット長が異なるオペコード間でのハミング距離の算出方法を説明するための図である。Nサイクル目にはすでに、命令“ld Vr11,Vr12”が配置済みであり、N+1サイクル目の配置候補命令は、“mul2 Vr13,Vr14,Vr15”および“st Vr13,Vr14”であるとする。図18(a)を参照して、オペコード“ld”および“mul2”のように、ビット長が異なるオペコード間では、オペコードの重複部分のビットパターンについてハミング距離が計算される。したがって、オペコードの16ビット目から31ビット目までの値に基づいてハミング距離が算出される。オペコード“ld”および“mul2”は、16、18、19、22、23、25、26、27、28、30および31ビット目が異なる。このため、ハミング距離は11である。図18(b)を参照して、その他の配置候補命令“st Vr13,Vr14”についても、図18(a)の例との整合性を確保するため、オペコードの16ビット目から31ビット目までの値に基づいてハミング距離が算出される。オペコード“ld”および“st”は、16、17、24および25ビット目が異なる。このため、ハミング距離は4である。   FIG. 18 is a diagram for explaining a method of calculating a Hamming distance between operation codes having different bit lengths. It is assumed that the instruction “ld Vr11, Vr12” has already been arranged in the Nth cycle, and the arrangement candidate instructions in the N + 1th cycle are “mul2 Vr13, Vr14, Vr15” and “st Vr13, Vr14”. Referring to FIG. 18A, the hamming distance is calculated for the bit pattern of the overlapped portion of the operation code between the operation codes having different bit lengths such as the operation codes “ld” and “mul2”. Therefore, the Hamming distance is calculated based on the values from the 16th bit to the 31st bit of the operation code. The opcodes “ld” and “mul2” are different in the 16, 18, 19, 22, 23, 25, 26, 27, 28, 30 and 31st bits. For this reason, the Hamming distance is 11. Referring to FIG. 18 (b), the other arrangement candidate instructions “st Vr13, Vr14” are also from the 16th bit to the 31st bit of the opcode in order to ensure consistency with the example of FIG. 18 (a). The Hamming distance is calculated based on the value of. The opcodes “ld” and “st” differ in the 16th, 17th, 24th and 25th bits. For this reason, the Hamming distance is 4.

再度図16を参照して、命令スケジューリング部232は、最小ハミング距離を有する配置候補命令を特定する(S43)。図17および図18の例では、命令“st Vr13,Vr14”がともに配置候補命令として特定される。   Referring to FIG. 16 again, the instruction scheduling unit 232 identifies an arrangement candidate instruction having the minimum Hamming distance (S43). In the example of FIGS. 17 and 18, both the instructions “st Vr13, Vr14” are specified as the arrangement candidate instructions.

命令スケジューリング部232は、最小ハミング距離を有する配置候補命令が2以上あるか否かを判断する(S44)。最小ハミング距離を有する配置候補命令が1つの場合には(S44でNO)、その命令を最適命令とする(S56)。   The instruction scheduling unit 232 determines whether there are two or more placement candidate instructions having the minimum Hamming distance (S44). If there is one placement candidate instruction having the minimum Hamming distance (NO in S44), that instruction is determined as the optimum instruction (S56).

最小ハミング距離を有する配置候補命令が2つ以上ある場合には、(S44でYES)、それらの配置候補命令のうち命令が配置されていない空きスロットのデフォルト論理に合致するものがあるか否かを判断する(S46)。   If there are two or more placement candidate instructions having the minimum Hamming distance (YES in S44), whether or not any of these placement candidate instructions matches the default logic of an empty slot in which no instruction is placed. Is determined (S46).

デフォルト論理に合致する配置候補命令がなければ(S46でNO)、最小ハミング距離を有する2以上の配置候補命令のいずれかを任意に選択し、最適命令とする(S54)。   If there is no placement candidate instruction that matches the default logic (NO in S46), any one of two or more placement candidate instructions having the minimum Hamming distance is arbitrarily selected and set as the optimum instruction (S54).

デフォルト論理に合致する配置候補命令があり、かつその個数が1つであれば(S46でYES、S48でNO)、デフォルト論理に合致する配置候補命令を最適命令とする(S52)。   If there is a placement candidate instruction that matches the default logic and the number is one (YES in S46, NO in S48), the placement candidate instruction that matches the default logic is determined as the optimum instruction (S52).

デフォルト論理に合致する配置候補命令があり、かつその個数が2つ以上であれば(S46でYES、S48でYES)、デフォルト論理に合致する2以上の配置可能命令のうちのいずれかを任意に選択して最適命令とする(S50)。   If there is an arrangement candidate instruction that matches the default logic and the number is two or more (YES in S46, YES in S48), any one of two or more arrangementable instructions that match the default logic is arbitrarily selected. The optimum instruction is selected (S50).

[サイクル内配置調整処理部]
図19は、サイクル内配置調整処理部237の動作を示すフローチャートである。サイクル内配置調整処理部237は、命令スケジューリング部232でのスケジュール結果に基づいて、各サイクル内での命令の配置の調整を行なう。
[In-cycle placement adjustment processing section]
FIG. 19 is a flowchart showing the operation of the in-cycle arrangement adjustment processing unit 237. The in-cycle arrangement adjustment processing unit 237 adjusts instruction arrangement in each cycle based on the schedule result in the instruction scheduling unit 232.

サイクル内配置調整処理部237は、スケジュール結果の2サイクル目から最終サイクルまでのうち、着目しているサイクルの3つの命令について並べ替えを行ない、6通りの命令並びを作成する(S61)。図20は、このようにして作成された6通りの命令並びの一例を示す図である。   The in-cycle arrangement adjustment processing unit 237 rearranges the three instructions in the target cycle from the second cycle to the last cycle of the schedule result, and creates six instruction sequences (S61). FIG. 20 is a diagram showing an example of the six instruction sequences created in this way.

サイクル内配置調整処理部237は、後述する6通りの命令並びの各々についてハミング距離の和を求める処理(S62〜S67)を実行する。6通りの命令並びの各々について求められたハミング距離の和のうち最小のハミング距離の和をとる命令並びを選択し、その命令並びの並びになるように命令の並べ替えを行なう(S68)。以上の処理を、2サイクル目から最終サイクルまで繰返す(S60〜S69)。   The in-cycle arrangement adjustment processing unit 237 executes processing (S62 to S67) for obtaining the sum of the Hamming distances for each of six instruction sequences to be described later. From among the sum of the hamming distances obtained for each of the six instruction sequences, an instruction sequence that takes the minimum sum of the Hamming distances is selected, and the instructions are rearranged so that they are arranged in sequence (S68). The above processing is repeated from the second cycle to the final cycle (S60 to S69).

次に、6通りの命令並びの各々についてハミング距離の和を求める処理(S62〜S67)について説明する。サイクル内配置調整処理部237は、各命令並びの各スロットについて、着目命令と1つ前のサイクルの命令とのオペコードのビットパターン間のハミング距離を求める(S64)。ハミング距離を求める処理(S64)を3つのスロットの命令のすべてについて行ない(S63〜S65)、3つのスロットの命令の各々についてハミング距離の和を求める(S66)。以上の処理を、6通りの命令並びのすべてについて行なう(S62〜S67)。   Next, processing for obtaining the sum of the Hamming distances for each of the six instruction sequences (S62 to S67) will be described. The in-cycle arrangement adjustment processing unit 237 obtains the Hamming distance between the bit patterns of the operation code of the instruction of interest and the instruction of the previous cycle for each slot of each instruction sequence (S64). The processing for obtaining the Hamming distance (S64) is performed for all the instructions in the three slots (S63 to S65), and the sum of the Hamming distances is obtained for each of the instructions in the three slots (S66). The above processing is performed for all six instruction sequences (S62 to S67).

図21は、配置された命令の一例を示す図である。Nサイクル目には、第1スロット、第2スロットおよび第3スロットで実行される命令として、“ld Vr10,Vr11”、“sub1 Vr12,Vr13”および“add1 Vr14,Vr15”がそれぞれ配置されているものとする。N+1サイクル目には、第1スロット、第2スロットおよび第3スロットで実行される命令として、“st Vr16,Vr17”、“mul Vr18,Vr19”および“mod Vr20,Vr21”がそれぞれ配置されているものとする。   FIG. 21 is a diagram illustrating an example of arranged instructions. In the Nth cycle, “ld Vr10, Vr11”, “sub1 Vr12, Vr13”, and “add1 Vr14, Vr15” are arranged as instructions executed in the first slot, the second slot, and the third slot, respectively. Shall. In the (N + 1) th cycle, “st Vr16, Vr17”, “mul Vr18, Vr19” and “mod Vr20, Vr21” are arranged as instructions executed in the first slot, the second slot, and the third slot, respectively. Shall.

図22は、命令並び作成処理(S61)を説明するための図である。たとえば、図21に示すN+1サイクル目に配置された3つの命令より、図22(a)〜(f)に示す6つの命令並びが作成される。   FIG. 22 is a diagram for explaining the instruction arrangement creating process (S61). For example, six instruction sequences shown in FIGS. 22A to 22F are created from three instructions arranged in the (N + 1) th cycle shown in FIG.

図23は、オペコードのハミング距離算出処理(S64)を説明するための図である。たとえば、図21に示すNサイクル目の命令並びと、図22(c)に示すN+1サイクル目の命令並びとの間で、スロットごとにオペコードのハミング距離を算出すると、第1スロット、第2スロットおよび第3スロットにおけるハミング距離は、それぞれ10、9および5となる。   FIG. 23 is a diagram for explaining the operation code Hamming distance calculation processing (S64). For example, when the Hamming distance of the opcode is calculated for each slot between the Nth cycle instruction sequence shown in FIG. 21 and the N + 1th cycle instruction sequence shown in FIG. 22C, the first slot and the second slot are calculated. And the Hamming distances in the third slot are 10, 9 and 5, respectively.

したがって、図23の例におけるハミング距離の和は24となる。ハミング距離和算出処理(S66)では、このようにして、図21に示すNサイクル目の命令並びと、図22(a)〜(f)に示す6通りの命令並びの各々との間でハミング距離の和が求められ、それぞれ、14、16、24、22、24および20となる。命令並び選択処理(S68)では、6通りの命令並びのうち、最小のハミング距離の和をとる図22(a)の命令並びが選択される。   Therefore, the sum of the Hamming distances in the example of FIG. In the Hamming distance sum calculation process (S66), Hamming is performed between the instruction sequence at the Nth cycle shown in FIG. 21 and each of the six instruction sequences shown in FIGS. 22 (a) to (f). The sum of distances is determined to be 14, 16, 24, 22, 24, and 20, respectively. In the instruction arrangement selection process (S68), the instruction arrangement shown in FIG. 22A, which takes the sum of the minimum Hamming distances, is selected from the six instruction arrangements.

[レジスタ割付部]
図24は、レジスタ割付部234の動作を示すフローチャートである。レジスタ割付部234では、命令スケジューリング部232およびサイクル内配置調整処理部237でのスケジュール結果に基づいて、実際にレジスタの割付を行なっていく。
[Register allocation section]
FIG. 24 is a flowchart showing the operation of the register allocation unit 234. The register allocation unit 234 actually performs register allocation based on the schedule results in the instruction scheduling unit 232 and the in-cycle arrangement adjustment processing unit 237.

レジスタ割付部234は、ソースプログラム202から割付対象(変数)を抜き出し、各割付対象の生存区間およびその優先度を求める(S72)。生存区間とは、プログラム中で、変数が定義されてから、その参照が終了するまでの区間を言う。したがって、同一の変数であっても、複数の生存区間が存在する場合がある。優先度とは、割付対象の生存区間長およびその参照頻度で決定される。その詳細な説明は、本発明の本質的事項ではないため、省略する。   The register allocation unit 234 extracts allocation targets (variables) from the source program 202, and obtains the life spans and priority levels of the allocation targets (S72). The life interval is an interval from when a variable is defined in the program until the reference ends. Accordingly, there may be a plurality of life intervals even for the same variable. The priority is determined by the life span length to be assigned and its reference frequency. Since the detailed description is not an essential matter of the present invention, it will be omitted.

レジスタ割付部234は、割付対象より干渉グラフを作成する(S74)。干渉グラフとは、同一のレジスタを割り付けることができない割付対象の条件を示したグラフである。次に、干渉グラフの作成方法について説明する。   The register allocator 234 creates an interference graph from the allocation target (S74). The interference graph is a graph showing conditions to be allocated that cannot allocate the same register. Next, a method for creating an interference graph will be described.

図25は、割付対象となる変数の生存区間を示す図である。ここでは、変数I、JおよびKの3つの変数を割付対象とした例を示す。   FIG. 25 is a diagram illustrating a life span of a variable to be assigned. Here, an example is shown in which three variables of variables I, J, and K are assigned.

変数Iは、ステップT1で定義されて、ステップT5で最終参照される。また、変数Iは、ステップT8で定義されて、ステップT10で最終参照される。したがって、変数Iは、2つの生存区間を有することとなる。先の生存区間での変数Iを変数I1と定義し、後の生存区間での変数を変数I2と定義することとする。変数Jは、ステップT2で定義されて、ステップT4で最終参照される。   Variable I is defined in step T1 and is finally referenced in step T5. The variable I is defined at step T8 and finally referred to at step T10. Therefore, the variable I has two life spans. The variable I in the previous life interval is defined as the variable I1, and the variable in the later life interval is defined as the variable I2. Variable J is defined in step T2 and is finally referenced in step T4.

変数Kは、ステップT3で定義されて、ステップT6で最終参照される。また、変数Kは、ステップT7で定義されてステップT9で最終参照される。したがって、変数Iと同様、変数Kは2つの生存区間を有することとなる。先の生存区間での変数Kを変数K1と定義し、後の生存区間での変数Kを変数K2と定義する。   The variable K is defined in step T3 and finally referred to in step T6. The variable K is defined in step T7 and is finally referred to in step T9. Therefore, like the variable I, the variable K has two life spans. The variable K in the previous life interval is defined as the variable K1, and the variable K in the later life interval is defined as the variable K2.

変数I1、I2、J、K1およびK2には、以下に示すような生存区間の重なりが生じる。すなわち、変数I1およびJの生存区間は、ステップT2〜T4で重なりを有する。変数JおよびK1の生存区間は、ステップT3〜T4で重なりを有する。変数I1およびK1の生存区間は、ステップT3〜T5で重なりを有する。変数I2およびK2は、ステップT8〜T9で重なりを有する。このように、生存区間が重なる変数同士は、同一のレジスタに割り付けることはできない。このため、割付対象となる変数をノードとし、生存区間が重なる変数同士をエッジで結んだものが干渉グラフとなる。   In the variables I1, I2, J, K1, and K2, there are overlaps of life spans as shown below. That is, the life spans of the variables I1 and J have an overlap at steps T2 to T4. The life spans of variables J and K1 have overlap at steps T3 to T4. The life spans of variables I1 and K1 have overlap at steps T3 to T5. Variables I2 and K2 have overlap in steps T8-T9. In this way, variables with overlapping life intervals cannot be assigned to the same register. For this reason, the variable to be allocated is a node, and the variables in which the live ranges overlap are connected by an edge is an interference graph.

図26は、図25の例に基づいて作成された変数の干渉グラフを示す図である。ノードI1、K1およびJは相互にエッジにより接続されている。このため、変数I1、K1およびJの間には相互に生存区間が重なる区間があり、これら3つの変数に同じレジスタを割り付けることはできないことがわかる。同様に、ノードI2およびK2はエッジにより接続されている。このため、変数I2およびK2に同じレジスタを割り付けることはできないことがわかる。   FIG. 26 is a diagram illustrating an interference graph of variables created based on the example of FIG. Nodes I1, K1 and J are connected to each other by edges. For this reason, it can be seen that there are sections in which the survival periods overlap between the variables I1, K1, and J, and the same register cannot be assigned to these three variables. Similarly, nodes I2 and K2 are connected by an edge. For this reason, it can be seen that the same register cannot be assigned to the variables I2 and K2.

しかし、エッジにより接続されていないノード間には依存関係が存在しない。たとえば、ノードJおよびK2はエッジにより接続されていない。このため、変数JおよびK2には生存区間の重なりがなく、同じレジスタを割り付けることができることがわかる。   However, there is no dependency between nodes that are not connected by an edge. For example, nodes J and K2 are not connected by an edge. For this reason, it can be seen that the variables J and K2 do not overlap the live ranges and can be assigned the same register.

再度図24を参照して、レジスタ割付部234は、レジスタ割付を行なっていない割付対象のうち、優先度が最も高い割付対象を選択する(S80)。命令スケジューリング部232は、割付対象を割り付けるレジスタとして、同一スロットで割付対象を参照する命令の直前に実行される命令のうち、同一フィールドのレジスタ番号と同一番号のレジスタが割り付け可能か否かを判断する(S82)。割り付け可能か否かの判断は、上述した干渉グラフを参照することにより行なわれる。   Referring to FIG. 24 again, the register allocation unit 234 selects an allocation target with the highest priority among allocation targets for which register allocation is not performed (S80). The instruction scheduling unit 232 determines whether or not a register having the same number as the register number in the same field can be allocated among the instructions executed immediately before the instruction that refers to the allocation target in the same slot as the allocation target. (S82). Judgment as to whether allocation is possible is performed by referring to the above-described interference graph.

図27は、命令スケジューリングの途中結果を示す図である。たとえば、図27(a)を参照して、現在の割付対象は、第1スロットの(N+1)番目のサイクルのソースオペランド(レジスタVr5)に割り付けられるものとする。レジスタVr5は、上述したように仮に設けられたレジスタである。このため、図24のレジスタ割付可能判断処理(S82)では、割付対象として、N番目のサイクルの同一フィールドで使用されるレジスタ(ここでは、レジスタR0)が割付可能か否かを判断することになる。図27(b)は、Vr5にレジスタR0を割付けた場合の命令のビットパターンを示している。このように、連続するサイクル間で同一のレジスタをアクセスすると、レジスタの特性により消費電力を削減することができる。   FIG. 27 is a diagram illustrating a result of instruction scheduling. For example, referring to FIG. 27A, it is assumed that the current allocation target is allocated to the source operand (register Vr5) of the (N + 1) th cycle of the first slot. The register Vr5 is a provisionally provided register as described above. Therefore, in the register allocation possibility determination process (S82) of FIG. 24, it is determined whether or not the register (here, register R0) used in the same field of the Nth cycle can be allocated. Become. FIG. 27B shows a bit pattern of an instruction when register R0 is assigned to Vr5. Thus, when the same register is accessed between successive cycles, power consumption can be reduced due to the characteristics of the register.

同一番号のレジスタが割り付け可能と判断された場合には(S82でYES)、レジスタ割付部234は、割付対象に、上述の同一番号のレジスタを割り付ける(S84)。同一番号のレジスタを割り付けることができないと判断された場合には(S82でNO)、レジスタ割付部234は、割付可能なレジスタのレジスタ番号(2進表現)の中で、先行サイクルの同一スロットの同一フィールドのレジスタ番号との間のハミング距離が最小となるものを求める(S86)。図27(c)は、レジスタR0のレジスタ番号(00000)とのハミング距離が最小となるレジスタ番号(00001)を有するレジスタR1が、使用可能なレジスタの中から選択された例を示している。   If it is determined that the register with the same number can be allocated (YES in S82), the register allocation unit 234 allocates the register with the same number to the allocation target (S84). When it is determined that the register with the same number cannot be allocated (NO in S82), the register allocation unit 234 determines the register of the same slot in the preceding cycle among the register numbers (binary representation) of the register that can be allocated. A value that minimizes the Hamming distance between the register numbers in the same field is obtained (S86). FIG. 27C shows an example in which the register R1 having the register number (00001) that minimizes the Hamming distance from the register number (00000) of the register R0 is selected from the available registers.

ハミング距離が最小となる割付可能なレジスタが1つしかない場合には(S88でNO)、割付対象に当該レジスタを割り付ける(S92)。ハミング距離が最小となる割付可能なレジスタが2つ以上ある場合には(S88でYES)、2つ以上の割付可能なレジスタのいずれかを任意に選択し、割付対象に割り付ける(S90)。以上の処理を、割付対象がなくなるまで行なう(S78〜S94)。   If there is only one register that can be allocated with the minimum Hamming distance (NO in S88), the register is allocated to the allocation target (S92). If there are two or more assignable registers with the minimum Hamming distance (YES in S88), any of the two or more assignable registers is arbitrarily selected and assigned to the assignment target (S90). The above processing is performed until there are no more allocation targets (S78 to S94).

レジスタ割付部234での処理の後、サイクル内配置調整処理部237は、レジスタ割付部234でのスケジュール結果に基づいて、各サイクル内での命令の配置の調整を行なう。サイクル内配置調整処理部237で実行される処理は、図19および図20を参照して説明したものと同様である。このため、その詳細な説明はここでは繰返さない。   After the processing in the register allocation unit 234, the in-cycle arrangement adjustment processing unit 237 adjusts the arrangement of instructions in each cycle based on the schedule result in the register allocation unit 234. The processing executed by the in-cycle arrangement adjustment processing unit 237 is the same as that described with reference to FIGS. 19 and 20. Therefore, detailed description thereof will not be repeated here.

[命令再スケジューリング部]
図28は、命令再スケジューリング部236の動作を示すフローチャートである。命令再スケジューリング部236は、命令スケジューリング部232、レジスタ割付部234およびサイクル内配置調整処理部237で実行された処理により、プロセッサ30で動作可能にスケジューリングされた命令のスケジュール結果を、再度スケジューリングしなおす処理を行なう。すなわち、命令再スケジューリング部236は、レジスタ割付部234にて実レジスタが確定した命令列に対して、再度スケジューリングを行なうものである。
[Instruction rescheduling section]
FIG. 28 is a flowchart showing the operation of the instruction rescheduling unit 236. The instruction rescheduling unit 236 reschedules the schedule result of the instruction scheduled to be operable by the processor 30 by the processing executed by the instruction scheduling unit 232, the register allocation unit 234, and the in-cycle arrangement adjustment processing unit 237. Perform processing. That is, the instruction rescheduling unit 236 performs scheduling again on the instruction sequence whose actual register is determined by the register allocation unit 234.

命令再スケジューリング部236は、スケジュール結果の中から冗長な命令を削除する(S112)。たとえば、命令“mov1 R0,R0”は、レジスタR0の内容をレジスタR0に書き込む処理であるため、冗長な命令である。また、同一サイクルの第1スロットの命令が“mov2 4,R1”であり、第2スロットの命令が“mov2 5,R1”である場合には、それぞれ4および5をレジスタR1に書き込む命令である。本実施の形態では、番号の大きいほうのスロットの命令が優先的に実行されることとする。このため、第1スロットの命令“mov2 4,R1”は、冗長な命令である。   The instruction rescheduling unit 236 deletes redundant instructions from the schedule result (S112). For example, the instruction “mov1 R0, R0” is a redundant instruction because it is a process of writing the contents of the register R0 into the register R0. Further, when the instruction in the first slot of the same cycle is “mov2 4, R1” and the instruction in the second slot is “mov2 5, R1”, these are instructions that write 4 and 5 to the register R1 respectively. . In the present embodiment, it is assumed that the instruction in the slot with the larger number is preferentially executed. Therefore, the instruction “mov2 4, R1” in the first slot is a redundant instruction.

冗長な命令を削除すると、命令の依存関係が変化する場合がある。このため、命令再スケジューリング部236は、依存グラフの再構築を行なう(S114)。命令再スケジューリング部236は、依存グラフの中から実行可能な命令(ノード)を選択し、そのうち、各スロットのデフォルト論理に合致するように1サイクル目の命令をスケジューリングする(S115)。1サイクル目の命令に対応する依存グラフのノードには、配置済みのフラグが付される。   When redundant instructions are deleted, the dependency of instructions may change. Therefore, the instruction rescheduling unit 236 reconstructs the dependency graph (S114). The instruction rescheduling unit 236 selects an executable instruction (node) from the dependency graph, and schedules the instruction in the first cycle so as to match the default logic of each slot (S115). A placed flag is attached to the node of the dependency graph corresponding to the instruction in the first cycle.

命令再スケジューリング部236は、依存グラフを参照し、配置候補命令集合を生成する(S118)。命令再スケジューリング部236は、配置候補命令集合の中から後述するアルゴリズムに従い、最適な命令を1つ取り出す(S122)。   The instruction rescheduling unit 236 refers to the dependency graph and generates a placement candidate instruction set (S118). The instruction rescheduling unit 236 extracts one optimum instruction from the arrangement candidate instruction set according to an algorithm described later (S122).

命令再スケジューリング部236は、取り出された最適命令が実際に配置可能か否かを判断する(S124)。配置可能か否かの判断は、図13のS14の判断と同様である。このため、その詳細な説明はここでは繰返さない。   The instruction rescheduling unit 236 determines whether or not the fetched optimum instruction can actually be arranged (S124). The determination as to whether or not the arrangement is possible is the same as the determination in S14 of FIG. Therefore, detailed description thereof will not be repeated here.

配置可能と判断した場合には(S124でYES)、その最適命令を仮配置し、配置候補命令集合から削除する(S126)。その後、命令再スケジューリング部236は、さらに命令を配置することが可能か否かを、上述の配置可能判断(S124)と同様にして判断する(S128)。配置可能と判断した場合には(S128でYES)、依存グラフを参照し、新たな配置候補命令が生じた場合には、それを配置候補命令集合に追加する(S130)。以上の処理を、配置候補命令がなくなるまで繰返す(S120〜S132)。   If it is determined that placement is possible (YES in S124), the optimum instruction is temporarily placed and deleted from the placement candidate instruction set (S126). Thereafter, the instruction rescheduling unit 236 determines whether or not further instructions can be arranged in the same manner as the above-described arrangement possibility determination (S124) (S128). If it is determined that placement is possible (YES in S128), the dependency graph is referred to, and if a new placement candidate instruction is generated, it is added to the placement candidate instruction set (S130). The above processing is repeated until there is no arrangement candidate instruction (S120 to S132).

なお、最適命令の仮配置処理(S126)の後、これ以上、着目サイクルに命令を配置することができないと判断した場合には(S128でNO)、最適命令の仮配置処理(S120〜S132)のループを抜ける。   If it is determined that the instruction cannot be arranged in the target cycle after the optimum instruction temporary arrangement process (S126) (NO in S128), the optimum instruction temporary arrangement process (S120 to S132). Exit the loop.

最適命令の仮配置処理(S120〜S132)の後、命令再スケジューリング部236は、仮配置された命令を確定させ、配置候補命令集合に対するスケジューリングを終了する(S134)。その後、配置済みの命令に関しては、依存グラフの対応するノードに配置済みのフラグが付され、依存グラフの更新が行なわれる(S136)。   After the optimal instruction temporary placement process (S120 to S132), the instruction rescheduling unit 236 determines the temporarily placed instruction and ends the scheduling for the placement candidate instruction set (S134). Thereafter, for the arranged instruction, the arranged flag is attached to the corresponding node of the dependency graph, and the dependency graph is updated (S136).

命令再スケジューリング部236は、一定サイクル以上、同一数の命令が連続配置されているか否かを判断する(S137)。一定サイクル以上、同一数の命令が連続配置されていると判断した場合には(S137でYES)、命令再スケジューリング部236は、最大配置可能命令数を3に設定し(S138)、以降のサイクルでは、なるべく、1サイクルに3命令が配置されるようにする。以上の処理を、未配置命令がなくなるまで繰返す(S116〜S139)。   The instruction rescheduling unit 236 determines whether or not the same number of instructions are continuously arranged for a predetermined cycle or more (S137). If it is determined that the same number of instructions are continuously arranged for a certain cycle or more (YES in S137), the instruction rescheduling unit 236 sets the maximum number of instructions that can be arranged to 3 (S138), and the subsequent cycles Then, as much as possible, three instructions are arranged in one cycle. The above processing is repeated until there are no unplaced instructions (S116 to S139).

図29は、図28の最適命令取出し処理(S122)の動作を示すフローチャートである。命令再スケジューリング部236は、配置候補命令のうち、着目サイクルの1つ前のサイクルの同一スロットで実行される命令と比較して、同一のレジスタ番号を有するフィールドの個数を求め、当該個数が最大の配置候補命令を特定する(S152)。   FIG. 29 is a flowchart showing the operation of the optimum instruction fetch process (S122) of FIG. The instruction rescheduling unit 236 obtains the number of fields having the same register number by comparing with the instruction executed in the same slot of the cycle immediately before the target cycle among the arrangement candidate instructions, and the number is the maximum. Is determined (S152).

図30は、配置候補命令特定処理(S152)を説明するための図である。Nサイクル目の第1スロットで実行される命令として“add1 R0,R2”が配置されているものとし、N+1サイクル目の第1スロットに配置可能な命令として、図30(a)に示す“sub1 R0,R1”と、図30(b)に示す“div R0,R2”とがあるものとする。図30(a)に示すように、当該配置位置に命令“sub1 R0,R1”を配置した場合には、同一のレジスタ番号を有するフィールドは、レジスタR0(レジスタ番号00000)が配置されたフィールドのみである。このため、同一のレジスタ番号を有するフィールドの個数は1つである。図30(b)に示すように、当該配置位置に命令“div R0,R2”を配置した場合には、レジスタR0(レジスタ番号00000)およびレジスタR2(00010)がそれぞれ配置された2つのフィールドが同一のレジスタ番号を有する。このため、同一のレジスタ番号を有するフィールドの個数は2つである。   FIG. 30 is a diagram for explaining the arrangement candidate instruction specifying process (S152). Assume that “add1 R0, R2” is arranged as an instruction to be executed in the first slot of the Nth cycle, and “sub1” shown in FIG. 30A is an instruction that can be arranged in the first slot of the (N + 1) th cycle. Assume that there are R0, R1 "and" div R0, R2 "shown in FIG. As shown in FIG. 30A, when the instruction “sub1 R0, R1” is arranged at the arrangement position, the field having the same register number is only the field in which the register R0 (register number 00000) is arranged. It is. For this reason, the number of fields having the same register number is one. As shown in FIG. 30 (b), when the instruction “div R0, R2” is arranged at the arrangement position, two fields in which the register R0 (register number 00000) and the register R2 (00010) are arranged are respectively displayed. Have the same register number. For this reason, the number of fields having the same register number is two.

当該個数が最大の配置候補命令が1つしかない場合には(S154でNO)、その配置候補命令を最適命令とする(S174)。   If there is only one placement candidate instruction with the maximum number (NO in S154), the placement candidate instruction is determined as the optimum instruction (S174).

当該個数が最大の配置候補命令がないか、または2つ以上ある場合には(S154でYES)、命令再スケジューリング部236は、配置候補命令の各々について、1つ前のサイクルの同一スロットで実行される命令と比較して、命令のビットパターンのハミング距離が最小のものを求める(S156)。   If there is no placement candidate instruction with the maximum number or there are two or more placement candidate instructions (YES in S154), the instruction rescheduling unit 236 executes each placement candidate instruction in the same slot of the previous cycle. Compared with the instruction to be executed, the instruction having the minimum Hamming distance of the bit pattern of the instruction is obtained (S156).

図31は、配置候補命令特定処理(S156)を説明するための図である。Nサイクル目の第1スロットで実行される命令として“mul1 R3,R10”が配置されているものとし、N+1サイクル目の第1スロットに配置可能な命令として、図31(a)に示す“add1 R2,R4”と、図30(b)に示す“sub2 R11,R0,R2”とがあるものとする。それぞれの命令のビットパターンは図示するとおりである。図31(a)に示すように、当該配置位置に命令“add1 R2,R4”を配置した場合には、命令“mul1 R3,R10”とのハミング距離は10である。図31(b)に示すように、当該配置位置に命令“sub2 R11,R0,R2”を配置した場合には、命令“mul1 R3,R10”とのハミング距離は8である。このため、配置候補命令として“sub2 R11,R0,R2”が特定される。   FIG. 31 is a diagram for explaining the arrangement candidate instruction specifying process (S156). Assume that “mul1 R3, R10” is arranged as an instruction to be executed in the first slot of the Nth cycle, and “add1” shown in FIG. 31A is shown as an instruction that can be arranged in the first slot of the (N + 1) th cycle. Assume that there are R2, R4 "and" sub2 R11, R0, R2 "shown in FIG. The bit pattern of each instruction is as shown in the figure. As shown in FIG. 31A, when the instruction “add1 R2, R4” is arranged at the arrangement position, the Hamming distance to the instruction “mul1 R3, R10” is 10. As shown in FIG. 31B, when the instruction “sub2 R11, R0, R2” is arranged at the arrangement position, the Hamming distance to the instruction “mul1 R3, R10” is 8. Therefore, “sub2 R11, R0, R2” is specified as the arrangement candidate instruction.

最小ハミング距離を有する配置候補命令が1つの場合には(S158でNO),当該配置候補命令を最適命令とする(S172)。   If there is one placement candidate instruction having the minimum Hamming distance (NO in S158), the placement candidate instruction is set as the optimum instruction (S172).

最小ハミング距離を有する配置候補命令が2つ以上ある場合には(S158でYES)、2つ以上の配置候補命令のうち、当該配置候補命令が実行されるスロットのデフォルト論理に合致する配置候補命令を特定する(S160)。   If there are two or more placement candidate instructions having the minimum Hamming distance (YES in S158), a placement candidate instruction that matches the default logic of the slot in which the placement candidate instruction is executed out of the two or more placement candidate instructions. Is identified (S160).

図32は、配置候補命令特定処理(S160)を説明するための図である。Nサイクル目の第1スロットで実行される命令として“st R1,R13”が配置されているものとし、N+1サイクル目の第1スロットに配置可能な命令として、図32(a)に示す“ld R30,R18”と、図32(b)に示す“sub1 R8,R2”とがあるものとする。それぞれの命令のビットパターンは図示するとおりである。第1スロットのデフォルト論理は、上述したようにメモリアクセスに関する命令である。これは、命令の先頭2ビットが“01”であることより判別可能である。命令“ld R30,R18”の先頭2ビットは“01”であるため、第1スロットのデフォルト論理に合致するが、命令“sub1 R8,R2”の先頭2ビットは“11”であるため、第1スロットのデフォルト論理には合致しない。このため、配置候補命令として“ld R30,R18”が特定される。   FIG. 32 is a diagram for explaining the arrangement candidate instruction specifying process (S160). Assume that “st R1, R13” is arranged as an instruction to be executed in the first slot of the Nth cycle, and “ld” shown in FIG. 32A is given as an instruction that can be arranged in the first slot of the (N + 1) th cycle. Assume that there are “R30, R18” and “sub1 R8, R2” shown in FIG. The bit pattern of each instruction is as shown in the figure. The default logic of the first slot is a command related to memory access as described above. This can be distinguished from the fact that the first two bits of the instruction are “01”. Since the first 2 bits of the instruction “ld R30, R18” are “01”, it matches the default logic of the first slot, but the first 2 bits of the instruction “sub1 R8, R2” is “11”. It does not match the default logic of 1 slot. For this reason, “ld R30, R18” is specified as the placement candidate instruction.

デフォルト論理に合致する配置候補命令がなければ(S162でNO)、最小ハミング距離を有する配置候補命令のうちのいずれかを任意に選択し、最適命令とする(S170)。   If there is no placement candidate instruction that matches the default logic (NO in S162), one of the placement candidate instructions having the minimum Hamming distance is arbitrarily selected and set as the optimum instruction (S170).

デフォルト論理に合致する配置候補命令があり、かつその個数が1つであれば(S162でYES、S164でNO)、デフォルト論理に合致する配置候補命令を最適命令とする(S168)。   If there is a placement candidate instruction that matches the default logic and the number is one (YES in S162, NO in S164), the placement candidate instruction that matches the default logic is determined as the optimum instruction (S168).

デフォルト論理に合致する配置候補命令があり、かつその個数が2つ以上であれば(S162でYES、S164でYES)、デフォルト論理に合致する配置候補命令のうちのいずれかを任意に選択し、最適命令とする(S166)。   If there is a placement candidate instruction that matches the default logic and the number is two or more (YES in S162, YES in S164), any one of the placement candidate instructions that matches the default logic is arbitrarily selected, The optimum instruction is selected (S166).

命令再スケジューリング部236での処理の後、サイクル内配置調整処理部237は、命令再スケジューリング部236でのスケジュール結果に基づいて、各サイクル内での命令の配置の調整を行なう。サイクル内配置調整処理部237で実行される処理は、図19および図20を参照して説明したものと同様である。このため、その詳細な説明はここでは繰返さない。   After the processing in the instruction rescheduling unit 236, the in-cycle arrangement adjustment processing unit 237 adjusts the arrangement of instructions in each cycle based on the schedule result in the instruction rescheduling unit 236. The processing executed by the in-cycle arrangement adjustment processing unit 237 is the same as that described with reference to FIGS. 19 and 20. Therefore, detailed description thereof will not be repeated here.

以上、命令再スケジューリング部236の動作について説明を行なったが、コンパイル時のオプションまたはソースプログラム中に記述されたプラグマに従って、1つのサイクルで使用するスロットの個数の制限を行なってもよい。プラグマとは、プログラムの意味を変更することなくコンパイラへの最適化の指針を与える記述のことを言う。たとえば、例1に示すように、C言語で記述されたソースプログラムをコンパイルする際のオプションとして“−para”を設け、その後に続く数字でスロットの数を規定する。例1では、ソースプログラム“foo.c”がCコンパイラによりコンパイルされるが、スケジュール結果の各サイクルには、必ず2命令が配置されることとなる。   The operation of the instruction rescheduling unit 236 has been described above. However, the number of slots used in one cycle may be limited according to the compile option or pragma described in the source program. A pragma is a description that gives optimization guidelines for a compiler without changing the meaning of a program. For example, as shown in Example 1, “-para” is provided as an option when compiling a source program written in C language, and the number of slots is defined by the subsequent numbers. In Example 1, the source program “foo.c” is compiled by the C compiler, but two instructions are necessarily arranged in each cycle of the schedule result.

また、例2に示すように、ソースプログラム中に記述された各関数について、使用されるスロットの個数をプラグマで定義してもよい。例2では、関数funcを実行する際に使用されるスロットの個数が1つと規定されている。このため、スケジュール結果のうち、関数funcを実行するサイクルの各々には、必ず1命令のみが配置されることとなる。   Further, as shown in Example 2, the number of slots used for each function described in the source program may be defined by a pragma. In Example 2, the number of slots used when executing the function func is defined as one. For this reason, in the schedule result, only one instruction is necessarily arranged in each cycle for executing the function func.

(例1)
cc −para 2 foo.c
(例2)
#pragma para=1 func
int func(void){
・・・・・・
(Example 1)
cc-para 2 foo. c
(Example 2)
#Pragma para = 1 func
int func (void) {
・ ・ ・ ・ ・ ・
}

なお、オプションとプラグマとが同時に設定された場合には、値の小さいほうが優先されるようにしてもよい。たとえば、例1に示すソースプログラム“foo.c”中に、例2に示す関数funcおよびそのプラグマが指定されている場合には、原則として、2スロットの並列処理が実行されるが、関数funcを実行するサイクルでは1スロットのみで処理が実行されるように、スケジュール結果が作成される。   When options and pragmas are set at the same time, the smaller value may be given priority. For example, when the function func and its pragma shown in Example 2 are specified in the source program “foo.c” shown in Example 1, two-slot parallel processing is executed in principle, but the function func In the cycle in which the process is executed, the schedule result is created so that the process is executed in only one slot.

また、オプションおよびプラグマに関しては、命令再スケジューリング部236のみならず、命令スケジューリング部232またはレジスタ割付部234での動作で考慮されるようにしてもよい。   Further, options and pragmas may be considered not only in the instruction rescheduling unit 236 but also in the operation of the instruction scheduling unit 232 or the register allocation unit 234.

[スロット停止・復帰命令生成部]
図33は、スロット停止・復帰命令生成部238の動作を示すフローチャートである。スロット停止・復帰命令生成部238は、命令再スケジューリング部236でのスケジュール結果から一定サイクル(たとえば4サイクル)以上、特定の1つのスロットのみが連続使用されている区間を検出する(S182)。スロット停止・復帰命令生成部238は、上記区間の1サイクル前の空きスロット位置に残りの2つのスロットを停止させる命令を挿入する(S184)。1サイクル前に命令を挿入する空きスロット位置がない場合には、1サイクル追加し、上記命令を挿入する。
[Slot stop / return instruction generator]
FIG. 33 is a flowchart showing the operation of the slot stop / return command generation unit 238. The slot stop / return instruction generation unit 238 detects a section in which only one specific slot is continuously used for a predetermined cycle (for example, four cycles) or more from the schedule result in the instruction rescheduling unit 236 (S182). The slot stop / return instruction generation unit 238 inserts an instruction to stop the remaining two slots at the empty slot position one cycle before the above section (S184). If there is no empty slot position to insert an instruction one cycle before, one cycle is added and the instruction is inserted.

次に、スロット停止・復帰命令生成部238は、上記区間の1サイクル後の空きスロット位置に停止させておいた2つのスロットを復帰させる命令を挿入する(S186)。サイクル後に命令を挿入する空きスロット位置がない場合には、1サイクル追加し、上記命令を追加する。   Next, the slot stop / return command generation unit 238 inserts a command for returning the two slots stopped at the empty slot position after one cycle of the section (S186). If there is no empty slot position to insert an instruction after the cycle, one cycle is added and the above instruction is added.

図34は、命令が配置されたスケジュール結果の一例を示す図である。10サイクル目から18サイクル目までの9サイクルは第1スロットのみが連続使用されている。このため、9サイクル目の空きスロットに、第1スロットのみを動作させ残りの2つのスロットを停止させる命令(“set1 1”)が書き込まれる。また、19サイクル目の空きスロットに、残りの2つのスロットを復帰させる命令(“clear1 1”)が書き込まれる。図35は、図33の特定の1スロットのみが連続使用されている場合の処理(S182〜S186)で命令が書き込まれたスケジュール結果の一例を示す図である。   FIG. 34 is a diagram illustrating an example of a schedule result in which instructions are arranged. In the 9th cycle from the 10th cycle to the 18th cycle, only the first slot is continuously used. Therefore, an instruction (“set1 1”) for operating only the first slot and stopping the remaining two slots is written in the empty slot of the ninth cycle. In addition, an instruction (“clear1 1”) for restoring the remaining two slots is written in the empty slot of the 19th cycle. FIG. 35 is a diagram showing an example of a schedule result in which an instruction is written in the processing (S182 to S186) when only one specific slot in FIG. 33 is continuously used.

再度図33を参照して、スロット停止・復帰命令生成部238は、スケジュール結果から一定サイクル(たとえば4サイクル)以上、特定の2つのスロットのみが連続使用されている区間を検出する(S188)。スロット停止・復帰命令生成部238は、上記区間の1サイクル前の空きスロット位置に残りの1つのスロットを停止させる命令を挿入する(S190)。1サイクル前に命令を挿入する空きスロット位置がない場合には、1サイクル追加し、上記命令を挿入する。   Referring to FIG. 33 again, slot stop / return instruction generation unit 238 detects a section in which only two specific slots are continuously used for a predetermined cycle (for example, four cycles) or more from the schedule result (S188). The slot stop / return instruction generation unit 238 inserts an instruction to stop the remaining one slot at the empty slot position one cycle before the above section (S190). If there is no empty slot position to insert an instruction one cycle before, one cycle is added and the instruction is inserted.

次に、スロット停止・復帰命令生成部238は、上記区間の1サイクル後の空きスロット位置に停止させておいた1つのスロットを復帰させる命令を挿入する(S192)。サイクル後に命令を挿入する空きスロット位置がない場合には、1サイクル追加し、上記命令を追加する。   Next, the slot stop / return instruction generation unit 238 inserts an instruction for returning one slot that has been stopped at an empty slot position after one cycle of the section (S192). If there is no empty slot position to insert an instruction after the cycle, one cycle is added and the above instruction is added.

図35のスケジュール結果では、4サイクル目から8サイクル目までの5サイクルは第1および第2スロットのみが使用され、第3スロットは使用されていない。このため、その前後のサイクルに第3スロットを停止させる命令(“set2 12”)および復帰させる命令(“clear2 12”)をそれぞれ書き込む必要がある。しかし、3サイクル目および9サイクル目の双方ともにすべてのスロットに命令が配置されている。このため、スロット停止・復帰命令生成部238は、4サイクル目の前および8サイクル目の後に1サイクルずつ新たなサイクルを挿入し、上記2命令をそれぞれのサイクルに書き込む。図36は、図33の特定の2スロットのみが連続使用されている場合の処理(S188〜S192)で命令が書き込まれたスケジュール結果の一例を示す図である。   In the schedule result of FIG. 35, only the first and second slots are used in the fifth cycle from the fourth cycle to the eighth cycle, and the third slot is not used. Therefore, it is necessary to write an instruction for stopping the third slot (“set2 12”) and an instruction for returning (“clear2 12”) in the preceding and succeeding cycles. However, instructions are arranged in all slots in both the third and ninth cycles. Therefore, the slot stop / return instruction generation unit 238 inserts a new cycle one cycle before the fourth cycle and after the eighth cycle, and writes the two instructions in each cycle. FIG. 36 is a diagram illustrating an example of a schedule result in which an instruction is written in the processing (S188 to S192) when only the specific two slots in FIG. 33 are continuously used.

なお、本実施の形態では、命令は、第1スロット、第2スロット、第3スロットの順に配置されることを前提としている。このため、2つのスロットが動作している場合には、必ず第3スロットが動作しておらず、1つのスロットのみが動作している場合には、必ず第2スロットと第3スロットとが動作していないことになる。   In this embodiment, it is assumed that instructions are arranged in the order of the first slot, the second slot, and the third slot. Therefore, when two slots are operating, the third slot is not always operating, and when only one slot is operating, the second and third slots are always operating. It will not be.

また、プロセッサ30には、32ビットのプログラム状態レジスタ(図示せず)が設けられている。図37は、プログラム状態レジスタの一例を示す図である。たとえば、15および16ビットの2ビットで動作しているスロットの数を表すことができる。この場合、図37(a)〜(d)は、動作しているスロットの数がそれぞれ0〜3であることを示している。   The processor 30 is provided with a 32-bit program status register (not shown). FIG. 37 is a diagram illustrating an example of a program status register. For example, the number of slots operating with 2 bits of 15 and 16 bits can be represented. In this case, FIGS. 37A to 37D show that the number of operating slots is 0 to 3, respectively.

図38はプログラム状態レジスタの他の一例を示す図である。このプログラム状態レジスタでは、14ビット目が第1スロットに、15ビット目が第2スロットに、16ビット目が第3スロットに対応している。各ビットの値が「1」であれば、そのスロットが動作していることを示し、「0」であれば、そのスロットが停止していることを示す。たとえば、図38(b)のプログラム状態レジスタでは、第1スロットが停止しており、第2および第3スロットが動作していることを示している。   FIG. 38 shows another example of the program status register. In this program status register, the 14th bit corresponds to the first slot, the 15th bit corresponds to the second slot, and the 16th bit corresponds to the third slot. A value of “1” for each bit indicates that the slot is operating, and a value of “0” indicates that the slot is stopped. For example, the program status register shown in FIG. 38B indicates that the first slot is stopped and the second and third slots are operating.

上述した命令“set1”または“set2”でプログラム状態レジスタに保持された値が書き換えられる。   The value held in the program status register is rewritten by the above-described instruction “set1” or “set2”.

以上、本実施の形態におけるコンパイラについて説明したが、コンパイラ200の各部は以下のように変形可能である。次に、その変形例について順次説明を行なう。   Although the compiler according to the present embodiment has been described above, each part of the compiler 200 can be modified as follows. Next, the modifications will be sequentially described.

[コンパイラの各部の変形例]
[命令再スケジューリング部236の動作の変形例]
本実施の形態では、図28および図29を参照して、命令再スケジューリング部236の動作について説明したが、図29を参照して説明した図28の最適命令取出し処理(S122)の代わりに、図39に示す最適命令取出し処理を行なってもよい。
[Modifications of each part of the compiler]
[Modification of Operation of Instruction Rescheduling Unit 236]
In the present embodiment, the operation of the instruction rescheduling unit 236 has been described with reference to FIGS. 28 and 29. Instead of the optimum instruction fetching process (S122) of FIG. 28 described with reference to FIG. The optimum instruction fetch process shown in FIG. 39 may be performed.

図39は、図28の最適命令取出し処理(S122)の他の動作を示すフローチャートである。   FIG. 39 is a flowchart showing another operation of the optimum instruction fetch process (S122) of FIG.

命令再スケジューリング部236は、図29の最小ハミング距離を求める処理(S156)の代わりに、以下に示す方法で最小ハミング距離を求める。すなわち、命令再スケジューリング部236は、配置候補命令のうち、1つ前のサイクルの同一スロットで実行される命令と比較して、レジスタフィールドのビットパターンのハミング距離が最小のものを求める(S212)。   The instruction rescheduling unit 236 obtains the minimum Hamming distance by the following method instead of the process of obtaining the minimum Hamming distance (S156) in FIG. That is, the instruction rescheduling unit 236 obtains the one in which the hamming distance of the bit pattern of the register field is the minimum compared with the instruction executed in the same slot of the previous cycle among the arrangement candidate instructions (S212). .

図40は、配置候補命令特定処理(S212)を説明するための図である。Nサイクル目の第1スロットで実行される命令として“add1 R0,R2”が配置されているものとし、N+1サイクル目の第1スロットに配置可能な命令として図40(a)に示す“sub1 R3,R1”と、図40(b)に示す“div R7,R1”とがあるものとする。それぞれの命令のビットパターンは図示するとおりである。図40(a)に示すように、当該配置位置に命令“sub1 R3,R1”を配置した場合には、命令“add1 R0,R2”とのレジスタフィールド間のハミング距離は4である。図40(b)に示すように、当該配置位置に命令“div R7,R1”を配置した場合には、命令“add1 R0,R2”とのレジスタフィールド間のハミング距離は5である。このため、配置候補命令として、“add1 R0,R2”が特定される。   FIG. 40 is a diagram for explaining the arrangement candidate instruction specifying process (S212). Assume that “add1 R0, R2” is arranged as an instruction to be executed in the first slot of the Nth cycle, and “sub1 R3” shown in FIG. 40A is an instruction that can be arranged in the first slot of the (N + 1) th cycle. , R1 ”and“ div R7, R1 ”shown in FIG. 40B. The bit pattern of each instruction is as shown in the figure. As shown in FIG. 40A, when the instruction “sub1 R3, R1” is arranged at the arrangement position, the Hamming distance between the register fields of the instruction “add1 R0, R2” is four. As shown in FIG. 40B, when the instruction “div R7, R1” is arranged at the arrangement position, the Hamming distance between the register fields of the instruction “add1 R0, R2” is 5. Therefore, “add1 R0, R2” is specified as the arrangement candidate instruction.

その他の処理(S152〜S154、S158〜S174)は、図29で説明したものと同様である。このため、その詳細な説明はここでは繰返さない。   Other processes (S152 to S154, S158 to S174) are the same as those described in FIG. Therefore, detailed description thereof will not be repeated here.

[サイクル内配置調整処理部237の第1変形例]
サイクル内配置調整処理部237は、図19を参照して説明した処理の代わりに、図41に示す処理を実行してもよい。
[First Modification of In-Cycle Arrangement Adjustment Processing Unit 237]
The in-cycle arrangement adjustment processing unit 237 may execute the process shown in FIG. 41 instead of the process described with reference to FIG.

図41は、サイクル内配置調整処理部237の動作の第1変形例を示すフローチャートである。   FIG. 41 is a flowchart showing a first modification of the operation of the in-cycle arrangement adjustment processing unit 237.

サイクル内配置調整処理部237は、図19のハミング距離を求める処理(S64)の代わりに、以下に示す方法で最小ハミング距離を求める。すなわち、サイクル内配置調整処理部237は、各命令並びの各スロットについて、着目命令と1つ前のサイクルの命令との間で、ビットパターン間のハミング距離を求める(S222)。その他の処理(S60〜S63、S65〜S69)は、図19を参照して説明したものと同様である。このため、その詳細な説明はここでは繰返さない。   The in-cycle arrangement adjustment processing unit 237 obtains the minimum Hamming distance by the following method instead of the process of obtaining the Hamming distance (S64) in FIG. That is, the in-cycle arrangement adjustment processing unit 237 obtains the Hamming distance between the bit patterns between the target instruction and the instruction of the previous cycle for each slot in each instruction list (S222). Other processes (S60 to S63, S65 to S69) are the same as those described with reference to FIG. Therefore, detailed description thereof will not be repeated here.

図42は、命令のハミング距離算出処理(S222)を説明するための図である。たとえば、図21に示すNサイクル目の命令並びと、図22(c)に示すN+1サイクル目の命令並びとの間で、スロットごとに命令のハミング距離を算出すると、第1スロット、第2スロットおよび第3スロットにおけるハミング距離は、それぞれ12、11および11となる。   FIG. 42 is a diagram for explaining the instruction Hamming distance calculation processing (S222). For example, when the Hamming distance of the instruction is calculated for each slot between the Nth cycle instruction sequence shown in FIG. 21 and the N + 1th cycle instruction sequence shown in FIG. 22C, the first slot and the second slot And the Hamming distances in the third slot are 12, 11 and 11, respectively.

したがって、図42の例におけるハミング距離の和は34である。ハミング距離和算出処理(S66)では、このようにして、図21に示すNサイクル目の命令並びと、図22(a)〜(f)に示す6通りの命令並びの各々との間でハミング距離の和が求められ、それぞれ28、26、34、28、34および30となる。命令並び選択処理(S68)では、6通りの命令並びのうち、最小のハミング距離の和をとる図22(b)の命令並びが選択される。   Therefore, the sum of the Hamming distances in the example of FIG. In the Hamming distance sum calculation process (S66), Hamming is performed between the instruction sequence at the Nth cycle shown in FIG. 21 and each of the six instruction sequences shown in FIGS. 22 (a) to (f). The sum of the distances is determined to be 28, 26, 34, 28, 34 and 30 respectively. In the instruction arrangement selection process (S68), the instruction arrangement shown in FIG. 22B that takes the sum of the minimum Hamming distances is selected from the six instruction arrangements.

なお、本変形例のハミング距離を求める処理(S222)では、レジスタが割付けられていることが前提となっている。このため、本変形例のサイクル内配置調整処理部237での処理は、レジスタが割付けられていない命令スケジューリング部232での処理の後に実行することはできず、レジスタ割付部234での処理の後または命令再スケジューリング部236での処理の後に実行される。   Note that, in the process of obtaining the Hamming distance (S222) of this modification, it is assumed that a register is allocated. For this reason, the process in the in-cycle arrangement adjustment processing unit 237 according to the present modification cannot be executed after the process in the instruction scheduling unit 232 to which no register is allocated, and after the process in the register allocation unit 234. Alternatively, it is executed after the processing in the instruction rescheduling unit 236.

[サイクル内配置調整処理部237の第2変形例]
サイクル内配置調整処理部237は、図19を参照して説明した処理の代わりに、図43に示す処理を実行してもよい。
[Second Modification of In-Cycle Arrangement Adjustment Processing Unit 237]
The in-cycle arrangement adjustment processing unit 237 may execute the process shown in FIG. 43 instead of the process described with reference to FIG.

図43は、サイクル内配置調整処理部237の動作の第2変形例を示すフローチャートである。   FIG. 43 is a flowchart showing a second modification of the operation of the in-cycle arrangement adjustment processing unit 237.

サイクル内配置調整処理部237は、図19のハミング距離を求める処理(S64)の代わりに、以下に示す方法で最小ハミング距離を求める。すなわち、サイクル内配置調整処理部237は、各命令並びの各スロットについて、着目命令と1つ前のサイクルの命令とのレジスタフィールドのビットパターン間のハミング距離を求める(S232)。その他の処理(S60〜S63、S65〜S69)は、図19を参照して説明したものと同様である。このため、その詳細な説明はここでは繰返さない。   The in-cycle arrangement adjustment processing unit 237 obtains the minimum Hamming distance by the following method instead of the process of obtaining the Hamming distance (S64) in FIG. That is, the in-cycle arrangement adjustment processing unit 237 obtains the Hamming distance between the bit patterns in the register field between the instruction of interest and the instruction of the previous cycle for each slot of each instruction list (S232). Other processes (S60 to S63, S65 to S69) are the same as those described with reference to FIG. Therefore, detailed description thereof will not be repeated here.

図44は、レジスタフィールドのハミング距離算出処理(S232)を説明するための図である。たとえば、図21に示すNサイクル目の命令並びと、図22(c)に示すN+1サイクル目の命令並びとの間で、スロットごとにレジスタフィールドのハミング距離を算出すると、第1スロット、第2スロットおよび第3スロットにおけるハミング距離は、それぞれ2、2および6となる。   FIG. 44 is a diagram for explaining the Hamming distance calculation process (S232) of the register field. For example, when the Hamming distance of the register field is calculated for each slot between the N-th cycle instruction sequence shown in FIG. 21 and the N + 1-th cycle instruction sequence shown in FIG. The Hamming distances in the slot and the third slot are 2, 2 and 6, respectively.

したがって、図44の例におけるハミング距離の和は10となる。ハミング距離和算出処理(S66)では、このようにして、図21に示すNサイクル目の命令並びと、図22(a)〜(f)に示す6通りの命令並びの各々との間でハミング距離の和が求められ、それぞれ14、10、10、6、10および10となる。命令並び選択処理(S68)では、6通りの命令並びのうち、最小のハミング距離の和をとる図22(d)の命令並びが選択される。   Therefore, the sum of the Hamming distances in the example of FIG. In the Hamming distance sum calculation process (S66), Hamming is performed between the instruction sequence at the Nth cycle shown in FIG. 21 and each of the six instruction sequences shown in FIGS. 22 (a) to (f). The sum of distances is determined to be 14, 10, 10, 6, 10 and 10, respectively. In the instruction arrangement selection process (S68), the instruction arrangement of FIG. 22 (d) that takes the sum of the minimum Hamming distances is selected from the six instruction arrangements.

なお、本変形例のハミング距離を求める処理(S232)では、レジスタが割付けられていることが前提となっている。このため、本変形例のサイクル内配置調整処理部237での処理は、レジスタが割付けられていない命令スケジューリング部232での処理の後に実行することはできず、レジスタ割付部234での処理の後または命令再スケジューリング部236での処理の後に実行される。   Note that, in the process of obtaining the Hamming distance (S232) of this modification, it is assumed that a register is allocated. For this reason, the process in the in-cycle arrangement adjustment processing unit 237 according to the present modification cannot be executed after the process in the instruction scheduling unit 232 to which no register is allocated, and after the process in the register allocation unit 234. Alternatively, it is executed after the processing in the instruction rescheduling unit 236.

[サイクル内配置調整処理部237の第3変形例]
サイクル内配置調整処理部237は、図19を参照して説明した処理の代わりに、図45に示す処理を実行してもよい。
[Third Modification of In-Cycle Arrangement Adjustment Processing Unit 237]
The in-cycle arrangement adjustment processing unit 237 may execute the process shown in FIG. 45 instead of the process described with reference to FIG.

図45は、サイクル内配置調整処理部237の動作の第3変形例を示すフローチャートである。   FIG. 45 is a flowchart showing a third modification of the operation of the in-cycle arrangement adjustment processing unit 237.

サイクル内配置調整処理部237は、図19のハミング距離を求める処理(S64)の代わりに、以下の処理を実行する。すなわち、サイクル内配置調整処理部237は、各命令並びの各スロットについて、着目命令と1つ前のサイクルの命令との間で、同一のレジスタ番号を有するレジスタフィールドの個数を求める(S242)。   The in-cycle arrangement adjustment processing unit 237 executes the following process instead of the process (S64) for obtaining the Hamming distance in FIG. That is, the in-cycle arrangement adjustment processing unit 237 obtains the number of register fields having the same register number between the target instruction and the instruction of the previous cycle for each slot in each instruction list (S242).

また、サイクル内配置調整処理部237は、図19のハミング距離の和を求める処理(S66)の代わりに、以下の処理を実行する。すなわち、サイクル内配置調整処理部237は、3つのスロットの命令の各々について求められた同一のレジスタ番号を有するレジスタフィールドの個数の和を求める(S244)。   Further, the in-cycle arrangement adjustment processing unit 237 executes the following processing instead of the processing (S66) for obtaining the sum of the Hamming distances in FIG. That is, the in-cycle arrangement adjustment processing unit 237 obtains the sum of the number of register fields having the same register number obtained for each of the instructions in the three slots (S244).

さらに、サイクル内配置調整処理部237は、図19の命令の並べ替え処理(S68)の代わりに、以下の処理を実行する。すなわち、サイクル内配置調整処理部237は、6通りの命令並びの各々について求められたレジスタフィールドの個数の和のうち、最大のレジスタフィールドの個数の和をとる命令並びを選択し、その命令並びの並びになるように命令の並べ替えを行なう(S246)。その他の処理(S60〜S63、S65、S67およびS69)は、図19を参照して説明したものと同様である。このため、その詳細な説明はここでは繰返さない。   Further, the in-cycle arrangement adjustment processing unit 237 executes the following process instead of the instruction rearrangement process (S68) of FIG. That is, the in-cycle arrangement adjustment processing unit 237 selects an instruction sequence that takes the sum of the maximum number of register fields from the sum of the numbers of register fields obtained for each of the six instruction sequences, and the instruction sequence. The instructions are rearranged so as to be arranged as follows (S246). Other processes (S60 to S63, S65, S67, and S69) are the same as those described with reference to FIG. Therefore, detailed description thereof will not be repeated here.

図46は、配置された命令の一例を示す図である。Nサイクル目には、第1スロット、第2スロットおよび第3スロットで実行される命令として、“ld R0,R1”、“sub1 R2,R3”および“add1 R4,R5”がそれぞれ配置されているものとする。N+1サイクル目には、第1スロット、第2スロットおよび第3スロットで実行される命令として、“st R5,R8”、“mul R2,R3”および“mod R0,R10”がそれぞれ配置されているものとする。   FIG. 46 is a diagram illustrating an example of arranged instructions. In the Nth cycle, “ld R0, R1”, “sub1 R2, R3” and “add1 R4, R5” are arranged as instructions executed in the first slot, the second slot, and the third slot, respectively. Shall. In the (N + 1) th cycle, “st R5, R8”, “mul R2, R3”, and “mod R0, R10” are arranged as instructions executed in the first slot, the second slot, and the third slot, respectively. Shall.

図47は、命令並び作成処理(S61)を説明するための図である。たとえば、図46に示すN+1サイクル目に配置された3つの命令より、図47(a)〜(f)に示す6つの命令並びが作成される。   FIG. 47 is a diagram for explaining the instruction arrangement creating process (S61). For example, six instruction sequences shown in FIGS. 47A to 47F are created from three instructions arranged in the (N + 1) th cycle shown in FIG.

図48は、レジスタフィールド個数算出処理(S242)を説明するための図である。たとえば、図46に示すNサイクル目の命令並びと、図47(f)に示すN+1サイクル目の命令並びとの間で、スロットごとに同一のレジスタ番号を有するレジスタフィールドの個数を求める。第1スロットについては、レジスタR0が両サイクルの同一レジスタフィールドで共通し、その他レジスタフィールドのレジスタは異なるため、当該個数は1である。第2スロットについては、レジスタR2およびR3が両サイクルの同一レジスタフィールドで共通するため、当該個数は2である。第3スロットについては、同一レジスタフィールドで共通するレジスタがないため、当該個数は0である。   FIG. 48 is a diagram for explaining the register field number calculation process (S242). For example, the number of register fields having the same register number for each slot is obtained between the instruction sequence of the Nth cycle shown in FIG. 46 and the instruction sequence of the (N + 1) th cycle shown in FIG. 47 (f). For the first slot, the number is 1 because the register R0 is common to the same register field in both cycles and the registers in the other register fields are different. For the second slot, the number is 2 because registers R2 and R3 are common to the same register field in both cycles. For the third slot, the number is 0 because there is no common register in the same register field.

したがって、図48の例における同一のレジスタ番号を有するレジスタフィールドの個数の和は3である。レジスタフィールド個数和算出処理(S244)では、このようにして、図46に示すNサイクル目の命令並びと、図47(a)〜(f)に示す6通りの命令並びとの各々との間でレジスタフィールドの個数の和が求められ、それぞれ0,2,0,0,0,1および3となる。命令並び選択処理(S246)では、6通りの命令並びのうち、最大のレジスタフィールドの個数和をとる図47(f)に示す命令並びが選択される。   Therefore, the sum of the number of register fields having the same register number in the example of FIG. In the register field number sum calculation process (S244), in this way, between the instruction sequence of the Nth cycle shown in FIG. 46 and each of the six instruction sequences shown in FIGS. 47 (a) to 47 (f). The sum of the number of register fields is obtained and becomes 0, 2, 0, 0, 0, 1 and 3, respectively. In the instruction arrangement selection process (S246), the instruction arrangement shown in FIG. 47 (f) that takes the maximum number of register fields is selected from the six instruction arrangements.

なお、本変形例のレジスタフィールドの個数を求める処理(S242)は、レジスタが割付けられていることが前提となっている。このため、本変形例のサイクル内配置調整処理部237での処理は、レジスタが割付けられていない命令スケジューリング部232での処理の後に実行することはできず、レジスタ割付部234での処理の後または命令再スケジューリング部236での処理の後に実行される。   Note that the processing (S242) for obtaining the number of register fields in this modification is based on the premise that registers are allocated. For this reason, the process in the in-cycle arrangement adjustment processing unit 237 according to the present modification cannot be executed after the process in the instruction scheduling unit 232 to which no register is allocated, and after the process in the register allocation unit 234. Alternatively, it is executed after the processing in the instruction rescheduling unit 236.

[サイクル内配置調整処理部237の第4変形例]
サイクル内配置調整処理部237は、図19を参照して説明した処理の代わりに、図49に示す処理を実行してもよい。
[Fourth Modification of In-Cycle Arrangement Adjustment Processing Unit 237]
The in-cycle arrangement adjustment processing unit 237 may execute the process shown in FIG. 49 instead of the process described with reference to FIG.

図49は、サイクル内配置調整処理部237の動作の第4変形例を示すフローチャートである。   FIG. 49 is a flowchart showing a fourth modification of the operation of the in-cycle arrangement adjustment processing unit 237.

サイクル内配置調整処理部237は、図19の命令並びごとにハミング距離の和を求める処理(S63〜S66)の代わりに、以下の処理を実行する。すなわち、サイクル内配置調整処理部237は、着目している命令並びに含まれる命令のうち、スロットのデフォルト論理に合致する命令の個数を求める(S252)。   The in-cycle arrangement adjustment processing unit 237 executes the following process instead of the process (S63 to S66) for obtaining the sum of the Hamming distances for each instruction array in FIG. That is, the in-cycle arrangement adjustment processing unit 237 obtains the number of instructions that match the default logic of the slot among the instruction of interest and the included instructions (S252).

また、サイクル内配置調整処理部237は、図19の命令の並べ替え処理(S68)の代わりに、以下の処理を実行する。すなわち、サイクル内配置調整処理部237は、6通りの命令並びの各々について求められたデフォルト論理に合致する命令の個数のうち、最大個数をとる命令並びを選択し、その命令並びの並びになるように命令の並べ替えを行なう(S254)。その他の処理(S60〜S62、S67およびS69)は、図19を参照して説明したものと同様である。このため、その詳細な説明はここでは繰返さない。   The in-cycle arrangement adjustment processing unit 237 executes the following process instead of the instruction rearrangement process (S68) of FIG. In other words, the in-cycle arrangement adjustment processing unit 237 selects the instruction sequence that takes the maximum number from the number of instructions that match the default logic obtained for each of the six instruction sequences, and arranges the instruction sequences. The instructions are rearranged (S254). Other processes (S60 to S62, S67, and S69) are the same as those described with reference to FIG. Therefore, detailed description thereof will not be repeated here.

たとえば、命令並び作成処理(S61)で図47(a)〜(f)に示す6つの命令並びが作成されたものとする。上述のとおり、命令並びに含まれる各命令が配置されたスロットのデフォルト論理に合致するか否かは、命令の先頭2ビットを参照することにより判別可能である。たとえば、図47(b)に示す命令並びでは、第1スロットに配置された命令の先頭2ビットが“01”であるため、当該スロットのデフォルト論理に合致するが、第2スロットおよび第3スロットに配置された命令の先頭2ビットはそれぞれ“11”および“10”であるため、当該スロットのデフォルト論理には合致しない。このため、当該スロットでデフォルト論理に合致する命令は1つである。このようにして、個数算出処理(S252)では6通りの命令並びの各々についてデフォルト論理に合致する命令の個数が求められ、それぞれ3、1、1、0、0および1となる。命令並び選択処理(S254)では、6通りの命令並びのうち、デフォルト論理に合致する命令数の最大値をとる図47(a)に示す命令並びが選択される。   For example, it is assumed that six instruction sequences shown in FIGS. 47A to 47F have been created in the instruction sequence creation process (S61). As described above, whether or not the instruction and the included instruction match the default logic of the slot in which the instruction is arranged can be determined by referring to the first two bits of the instruction. For example, in the instruction sequence shown in FIG. 47B, the first 2 bits of the instruction placed in the first slot is “01”, which matches the default logic of the slot, but the second slot and the third slot Since the first 2 bits of the instruction placed in are “11” and “10” respectively, they do not match the default logic of the slot. For this reason, there is one instruction that matches the default logic in the slot. In this way, in the number calculation process (S252), the number of instructions that match the default logic is obtained for each of the six instruction sequences, which are 3, 1, 1, 0, 0, and 1, respectively. In the instruction arrangement selection process (S254), the instruction arrangement shown in FIG. 47A that takes the maximum number of instructions that match the default logic is selected from the six instruction arrangements.

以上のように、本実施の形態におけるコンパイラ200によれば、同一スロットのサイクル間で命令、オペコードおよびレジスタフィールドのハミング距離が小さくなるように命令の配置の最適化が行なわれる。このため、プロセッサの命令レジスタに保持される値のビット変化が小さく、プロセッサを低消費電力で動作させることができる機械語プログラムが生成される。   As described above, according to compiler 200 in the present embodiment, instruction placement is optimized so that the Hamming distance between instructions, opcodes, and register fields is reduced between cycles in the same slot. Therefore, a machine language program is generated in which the bit change of the value held in the instruction register of the processor is small and the processor can be operated with low power consumption.

また、同一スロットの同一レジスタフィールドにおいて、同一のレジスタのアクセスが連続するような命令の配置の最適化が行なわれる。このため、同一のレジスタへのアクセスが連続し、レジスタを選択するための制御信号の変化が少なくなり、プロセッサを低消費電力で動作させることができる機械語プログラムが生成される。   In addition, the instruction arrangement is optimized so that accesses to the same register continue in the same register field of the same slot. For this reason, access to the same register is continued, a change in the control signal for selecting the register is reduced, and a machine language program that can operate the processor with low power consumption is generated.

さらに、各スロットにはデフォルト論理に合致するように命令が割り当てられる。このため、同一のスロットでは、プロセッサの同じ構成要素を利用する命令が連続して実行されることになる。このため、プロセッサを低消費電力で動作させることができる機械語プログラムが生成される。   In addition, instructions are assigned to each slot to match the default logic. For this reason, in the same slot, an instruction using the same component of the processor is continuously executed. For this reason, a machine language program capable of operating the processor with low power consumption is generated.

さらにまた、1スロットまたは2スロットしか使用しない命令の命令サイクルが連続した場合には、その間、空きスロットへの電力の供給を停止させることができる。このため、プロセッサを低消費電力で動作させることができる機械語プログラムが生成される。   Furthermore, when an instruction cycle of an instruction that uses only one slot or two slots continues, the supply of power to the empty slot can be stopped during that period. For this reason, a machine language program capable of operating the processor with low power consumption is generated.

さらにまた、プラグマまたはコンパイル時のオプションでプログラム実行時に使用するスロット数を指定することができる。このため、空きスロットを発生させることができ、空きスロットへの電力の供給を停止させることができる。このため、プロセッサを低消費電力で動作させることができる機械語プログラムが生成される。   Furthermore, the number of slots to be used when executing a program can be specified by a pragma or a compile option. For this reason, an empty slot can be generated and the supply of power to the empty slot can be stopped. For this reason, a machine language program capable of operating the processor with low power consumption is generated.

以上、本発明に係るコンパイラについて、実施の形態に基づいて説明したが、本発明は、この実施の形態に限定されるものではない。   Although the compiler according to the present invention has been described based on the embodiment, the present invention is not limited to this embodiment.

例えば、図28および図29を参照して説明した命令再スケジューリング部232の最適命令取出し処理(S122)では、同一のレジスタ番号を有するフィールドの個数(S152)、直前に実行される命令とのハミング距離(S156)、スロットのデフォルト論理(S160)の順に優先して最適命令を特定したが、この優先順位はこれに限られるものではなく、その他の優先順位で最適命令を特定してもよい。   For example, in the optimum instruction fetching process (S122) of the instruction rescheduling unit 232 described with reference to FIGS. 28 and 29, the number of fields having the same register number (S152) and hamming with the instruction executed immediately before Although the optimum instruction is specified in the order of distance (S156) and default logic (S160) of the slot, this priority is not limited to this, and the optimum instruction may be specified with other priorities.

また、最適命令を特定する際に考慮するハミング距離、スロットのデフォルト論理等の各種条件も、この実施の形態に限定されるものではない。要するに、本発明に係るコンパイラによりプロセッサが動作した際に、総消費電力量が小さくなるような、条件の組み合わせや、優先順位であればよいのである。なお、命令スケジューリング部232以外の、命令スケジューリング部232、レジスタ割付部234およびサイクル内配置調整処理部237などの処理においても同様であるのは言うまでもない。   Further, various conditions such as the Hamming distance and the default logic of the slot considered when specifying the optimum instruction are not limited to this embodiment. In short, any combination of conditions or priority order may be used so that the total power consumption is reduced when the processor is operated by the compiler according to the present invention. Needless to say, the same applies to the processing other than the instruction scheduling unit 232, such as the instruction scheduling unit 232, the register allocation unit 234, and the in-cycle arrangement adjustment processing unit 237.

さらに、これら条件の組み合わせや、優先順位をパラメータ化し、ソースプログラム202のヘッダファイルとしてコンパイル時に組み込む構成としてもよいし、これらのパラメータをコンパイラのオプションとして指定可能としてもよい。   Furthermore, a combination of these conditions and priorities may be parameterized and incorporated as a header file of the source program 202 at the time of compilation, or these parameters may be designated as compiler options.

さらにまた、本実施の形態の最適化部230での処理は、基本ブロックごとにいくつかのスケジューリング方法の中から最適なものを選択するようにしてもよい。例えば、基本ブロックごとに、あらかじめ用意された複数のスケジューリング方法のすべてについてスケジュール結果を求め、最も消費電力が小さくなると予測されるスケジューリング方法を選択するようにしてもよい。   Furthermore, the processing in the optimization unit 230 of the present embodiment may be performed by selecting an optimum one from several scheduling methods for each basic block. For example, for each basic block, a scheduling result may be obtained for all of a plurality of scheduling methods prepared in advance, and a scheduling method that is predicted to have the smallest power consumption may be selected.

また、バックトラックなどの手法を用いて最適なスケジューリング方法を選択するようにしてもよい。例えば、命令スケジューリング部232において最も消費電力が小さくなると予測されるスケジューリング方法を選択した後であっても、レジスタ割付部234でレジスタ割付を行なったところ、予測消費電力が予定していた値よりも大きくなった場合には、命令スケジューリング部232において2番目に消費電力が小さくなると予測されるスケジューリング方法を選択して、レジスタ割付を行なってみる。その結果、予測消費電力が予定していた値よりも小さくなれば、命令再スケジューリング部236による命令再スケジュール処理を実行するようにしてもよい。 さらにまた、本実施の形態では、C言語で記述されたソースプログラムを機械語プログラムに変換する例について説明したが、ソースプログラムはC言語以外の高級言語であってもよいし、他のコンパイラですでにコンパイルされた機械語プログラムであってもよい。ソースプログラムが機械語プログラムの場合には、その機械語プログラムを最適化した機械語プログラムが出力される構成となる。   Further, an optimal scheduling method may be selected using a method such as backtracking. For example, even after selecting a scheduling method in which the power consumption is predicted to be the smallest in the instruction scheduling unit 232, when the register allocation is performed in the register allocation unit 234, the predicted power consumption is less than the expected value. When the value becomes larger, the instruction scheduling unit 232 selects a scheduling method that is predicted to have the second lowest power consumption, and performs register allocation. As a result, if the predicted power consumption becomes smaller than the planned value, the instruction rescheduling process by the instruction rescheduling unit 236 may be executed. Furthermore, in this embodiment, an example of converting a source program written in C language into a machine language program has been described. However, the source program may be a high-level language other than C language, or another compiler. It may be a machine language program compiled in When the source program is a machine language program, a machine language program in which the machine language program is optimized is output.

本実施の形態に係るプロセッサが解読実行する命令の構造を示す図である。It is a figure which shows the structure of the instruction | indication which a processor which concerns on this Embodiment decodes and performs. 本実施の形態に係るプロセッサの概略構成を示すブロック図である。It is a block diagram which shows schematic structure of the processor which concerns on this Embodiment. パケットの一例を示す図である。It is a figure which shows an example of a packet. パケットに含まれる並列実行境界情報について説明するための図である。It is a figure for demonstrating the parallel execution boundary information contained in a packet. パケットの並列実行境界情報に基づいて作成された並列実行される命令の実行単位の一例を示す図である。It is a figure which shows an example of the execution unit of the command performed in parallel produced based on the parallel execution boundary information of a packet. 算術論理・比較演算部の概略構成を示すブロック図である。It is a block diagram which shows schematic structure of an arithmetic logic and comparison operation part. バレルシフタの概略構成を示すブロック図である。It is a block diagram which shows schematic structure of a barrel shifter. 除算器の概略構成を示すブロック図である。It is a block diagram which shows schematic structure of a divider. 乗算・積和演算部の概略構成を示すブロック図である。It is a block diagram which shows schematic structure of a multiplication and a product-sum operation part. プロセッサによる命令実行時の各パイプライン動作を示すタイミング図である。FIG. 10 is a timing chart showing each pipeline operation when an instruction is executed by a processor. プロセッサで実行される命令、処理の内容およびそのビットパターンを示す図である。It is a figure which shows the command performed with a processor, the content of a process, and its bit pattern. 本実施の形態に係るコンパイラの構成を示す機能ブロック図である。It is a functional block diagram which shows the structure of the compiler which concerns on this Embodiment. 命令スケジューリング部の動作を示すフローチャートである。It is a flowchart which shows operation | movement of an instruction scheduling part. 依存グラフの一例を示す図である。It is a figure which shows an example of a dependence graph. 命令のスケジュール結果の一例を示す図である。It is a figure which shows an example of the schedule result of a command. 図13の最適命令取出し処理の動作を示すフローチャートである。It is a flowchart which shows the operation | movement of the optimal command extraction process of FIG. オペコードのビットパターン間のハミング距離の算出方法を説明するための図である。It is a figure for demonstrating the calculation method of the Hamming distance between the bit patterns of an opcode. ビット長が異なるオペコード間でのハミング距離の算出方法を説明するための図である。It is a figure for demonstrating the calculation method of the Hamming distance between the operation codes from which bit length differs. サイクル内配置調整処理部の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the arrangement adjustment process part in a cycle. 6通りの命令並びの一例を示す図である。It is a figure which shows an example of 6 types of instruction sequences. 配置された命令の一例を示す図である。It is a figure which shows an example of the arrange | positioned instruction | indication. 命令並び作成処理(図19のS61)を説明するための図である。It is a figure for demonstrating a command arrangement | sequence creation process (S61 of FIG. 19). オペコードのハミング距離算出処理(図19のS64)を説明するための図である。It is a figure for demonstrating the Hamming distance calculation process (S64 of FIG. 19) of an opcode. レジスタ割付部の動作を示すフローチャートである。It is a flowchart which shows operation | movement of a register allocation part. 割付対象となる変数の生存区間を示す図である。It is a figure which shows the lifetime of the variable used as allocation object. 図25の例に基づいて作成された変数の干渉グラフを示す図である。It is a figure which shows the interference graph of the variable produced based on the example of FIG. 命令スケジューリングの途中結果を示す図である。It is a figure which shows the intermediate result of instruction scheduling. 命令再スケジューリング部の動作を示すフローチャートである。It is a flowchart which shows operation | movement of an instruction rescheduling part. 図28の最適命令取出し処理の動作を示すフローチャートである。It is a flowchart which shows the operation | movement of the optimal instruction extraction process of FIG. 配置候補命令特定処理(図29のS152)を説明するための図である。It is a figure for demonstrating arrangement | positioning candidate command specific processing (S152 of FIG. 29). 配置候補命令特定処理(図29のS156)を説明するための図である。It is a figure for demonstrating arrangement | positioning candidate command specific processing (S156 of FIG. 29). 配置候補命令特定処理(図29のS160)を説明するための図である。It is a figure for demonstrating arrangement | positioning candidate command specific processing (S160 of FIG. 29). スロット停止・復帰命令生成部の動作を示すフローチャートである。It is a flowchart which shows operation | movement of a slot stop / restoration command generation part. 命令が配置されたスケジュール結果の一例を示す図である。It is a figure which shows an example of the schedule result by which the instruction | command is arrange | positioned. 図33の特定の1スロットのみが連続使用されている場合の処理で命令が書き込まれたスケジュール結果の一例を示す図である。It is a figure which shows an example of the schedule result in which the command was written by the process in case only one specific slot of FIG. 33 is used continuously. 図33の特定の2スロットのみが連続使用されている場合の処理で命令が書き込まれたスケジュール結果の一例を示す図である。It is a figure which shows an example of the schedule result in which the command was written by the process in case only 2 specific slots of FIG. 33 are used continuously. プログラム状態レジスタの一例を示す図である。It is a figure which shows an example of a program status register. プログラム状態レジスタの他の一例を示す図である。It is a figure which shows another example of a program status register. 図28の最適命令取出し処理の他の動作を示すフローチャートである。FIG. 29 is a flowchart showing another operation of the optimum instruction fetch process of FIG. 28. FIG. 配置候補命令特定処理(図39のS212)を説明するための図である。It is a figure for demonstrating arrangement | positioning candidate command specific processing (S212 of FIG. 39). サイクル内配置調整処理部237の動作の第1変形例を示すフローチャートである。12 is a flowchart showing a first modification of the operation of the in-cycle arrangement adjustment processing unit 237. 命令のハミング距離算出処理(図41のS222)を説明するための図である。FIG. 42 is a diagram for explaining a command Hamming distance calculation process (S222 in FIG. 41). サイクル内配置調整処理部237の動作の第2変形例を示すフローチャートである。12 is a flowchart illustrating a second modification of the operation of the in-cycle arrangement adjustment processing unit 237. レジスタフィールドのハミング距離算出処理(図43のS232)を説明するための図である。FIG. 44 is a diagram for describing a Hamming distance calculation process (S232 in FIG. 43) of a register field. サイクル内配置調整処理部237の動作の第3変形例を示すフローチャートである。12 is a flowchart showing a third modification of the operation of the in-cycle arrangement adjustment processing unit 237. 配置された命令の一例を示す図である。It is a figure which shows an example of the arrange | positioned instruction | indication. 命令並び作成処理(図45のS61)を説明するための図である。It is a figure for demonstrating a command arrangement | sequence creation process (S61 of FIG. 45). レジスタフィールド個数算出処理(図45のS242)を説明するための図である。FIG. 46 is a diagram for describing a register field number calculation process (S242 in FIG. 45). サイクル内配置調整処理部237の動作の第4変形例を示すフローチャートである。12 is a flowchart showing a fourth modification of the operation of the in-cycle arrangement adjustment processing unit 237.

符号の説明Explanation of symbols

30 プロセッサ
40 命令メモリ
50 命令供給発行部
52 命令フェッチ部
54 命令バッファ
56 命令レジスタ部
56a〜56c 命令レジスタ
60 解読部
62 命令発行制御部
64 デコード部
64a〜64c 命令デコーダ
70 実行部
72 実行制御部
74 PC部
76 レジスタファイル
78a〜78c 算術論理・比較演算部
80a,80b 乗算・積和演算部
82a〜82c バレルシフタ
84 除算器
88 オペランドアクセス部
90,92 データバス
94 ODバス
96 OAバス
100 データメモリ
112,114 パケット
122,124,126 実行単位
132 ALU部
134,154,180 飽和処理部
136 フラグ部
142,162,172 アキュムレータ部
146,148,178 セレクタ
150 上位バレルシフタ
152 下位バレルシフタ
164 除算部
174a,174b 32ビット乗算器(MUL)
176a〜176c 64ビット加算器(Adder)
200 コンパイラ
202 ソースプログラム
204 機械語プログラム
210 パーサー部
220 中間コード変換部
230 最適化部
232 命令スケジューリング部
234 レジスタ割付部
236 命令再スケジューリング部
237 サイクル内配置調整処理部
238 スロット停止・復帰命令生成部
239 並列実行境界情報設定部
240 コード生成部
DESCRIPTION OF SYMBOLS 30 Processor 40 Instruction memory 50 Instruction supply issue part 52 Instruction fetch part 54 Instruction buffer 56 Instruction register part 56a-56c Instruction register 60 Decoding part 62 Instruction issue control part 64 Decoding part 64a-64c Instruction decoder 70 Execution part 72 Execution control part 74 PC unit 76 Register file 78a to 78c Arithmetic logic / comparison operation unit 80a, 80b Multiply / product sum operation unit 82a to 82c Barrel shifter 84 Divider 88 Operand access unit 90, 92 Data bus 94 OD bus 96 OA bus 100 Data memory 112, 114 Packet 122, 124, 126 Execution unit 132 ALU unit 134, 154, 180 Saturation processing unit 136 Flag unit 142, 162, 172 Accumulator unit 146, 148, 178 Selector 150 Rushifuta 152 lower barrel shifter 164 divider 174a, 174b 32-bit multiplier (MUL)
176a to 176c 64-bit adder (Adder)
DESCRIPTION OF SYMBOLS 200 Compiler 202 Source program 204 Machine language program 210 Parser part 220 Intermediate code conversion part 230 Optimization part 232 Instruction scheduling part 234 Register allocation part 236 Instruction rescheduling part 237 In-cycle arrangement adjustment processing part 238 Slot stop / return instruction generation part 239 Parallel execution boundary information setting unit 240 Code generation unit

Claims (4)

ソースプログラムを、並列処理可能な複数の実行ユニットと、前記複数の実行ユニットで実行される命令を各々発行する複数の命令発行ユニットとを有するプロセッサ用の機械語プログラムに翻訳するコンパイラ装置であって、
前記ソースプログラムを構文解析するパーサー手段と、
解析された前記ソースプログラムを中間コードに変換する中間コード変換手段と、
前記中間コードに対応する命令の依存関係を崩すことなく、直前の命令サイクルの同一の命令発行ユニットに対応する位置に配置された命令のレジスタと同一のレジスタをアクセスする命令を優先して、前記複数の命令発行ユニットの各々の対応する位置に当該命令を配置し、前記中間コードを最適化する最適化手段と、
最適化された前記中間コードを機械語命令に変換するコード生成手段と
を備えることを特徴とするコンパイラ装置。
A compiler apparatus for translating a source program into a machine language program for a processor having a plurality of execution units capable of parallel processing and a plurality of instruction issuance units that respectively issue instructions executed by the plurality of execution units. ,
Parser means for parsing the source program;
Intermediate code conversion means for converting the analyzed source program into intermediate code;
Priority is given to an instruction that accesses the same register as the register of the instruction arranged at the position corresponding to the same instruction issuing unit of the immediately preceding instruction cycle without breaking the dependency relation of the instruction corresponding to the intermediate code, An optimization means for optimizing the intermediate code by arranging the instruction at a corresponding position in each of a plurality of instruction issuing units;
A compiler apparatus comprising: code generation means for converting the optimized intermediate code into a machine language instruction.
前記最適化手段は、直前の命令サイクルの同一の命令発行ユニットに対応する位置に配置された命令のレジスタのレジスタ番号と近い番号のレジスタをアクセスする命令を優先して、前記複数の命令発行ユニットの各々の対応する位置に当該命令を配置することを特徴とする請求項1に記載のコンパイラ装置。   The optimization means prioritizes an instruction that accesses a register having a number close to the register number of the register of an instruction arranged at a position corresponding to the same instruction issuing unit of the immediately preceding instruction cycle, and the plurality of instruction issuing units. The compiler apparatus according to claim 1, wherein the instruction is arranged at a position corresponding to each of. ソースプログラムを、並列処理可能な複数の実行ユニットと、前記複数の実行ユニットで実行される命令を各々発行する複数の命令発行ユニットとを有するプロセッサ用の機械語プログラムに翻訳するコンパイル方法であって、
前記ソースプログラムを構文解析するパーサーステップと、
解析された前記ソースプログラムを中間コードに変換する中間コード変換ステップと、
前記中間コードに対応する命令の依存関係を崩すことなく、直前の命令サイクルの同一の命令発行ユニットに対応する位置に配置された命令のレジスタと同一のレジスタをアクセスする命令を優先して、前記複数の命令発行ユニットの各々の対応する位置に当該命令を配置し、前記中間コードを最適化する最適化ステップと、
最適化された前記中間コードを機械語命令に変換するコード生成ステップと
を含むことを特徴とするコンパイル方法。
A compiling method for translating a source program into a machine language program for a processor having a plurality of execution units capable of parallel processing and a plurality of instruction issuing units each issuing instructions executed by the plurality of execution units. ,
A parser step for parsing the source program;
An intermediate code conversion step of converting the analyzed source program into an intermediate code;
Priority is given to an instruction that accesses the same register as the register of the instruction arranged at the position corresponding to the same instruction issuing unit of the immediately preceding instruction cycle without breaking the dependency relation of the instruction corresponding to the intermediate code, An optimization step of optimizing the intermediate code by placing the instruction at a corresponding position in each of a plurality of instruction issuing units;
And a code generation step of converting the optimized intermediate code into a machine language instruction.
ソースプログラムを、並列処理可能な複数の実行ユニットと、前記複数の実行ユニットで実行される命令を各々発行する複数の命令発行ユニットとを有するプロセッサ用の機械語プログラムに翻訳するコンパイラ用のプログラムであって、
前記プログラムは、
前記ソースプログラムを構文解析するパーサーステップと、
解析された前記ソースプログラムを中間コードに変換する中間コード変換ステップと、
前記中間コードに対応する命令の依存関係を崩すことなく、直前の命令サイクルの同一の命令発行ユニットに対応する位置に配置された命令のレジスタと同一のレジスタをアクセスする命令を優先して、前記複数の命令発行ユニットの各々の対応する位置に当該命令を配置し、前記中間コードを最適化する最適化ステップと、
最適化された前記中間コードを機械語命令に変換するコード生成ステップと
を含むことを特徴とするプログラム。
A program for a compiler that translates a source program into a machine language program for a processor having a plurality of execution units capable of parallel processing and a plurality of instruction issuing units that issue instructions executed by the plurality of execution units. There,
The program is
A parser step for parsing the source program;
An intermediate code conversion step of converting the analyzed source program into an intermediate code;
Priority is given to an instruction that accesses the same register as the register of the instruction arranged at the position corresponding to the same instruction issuing unit of the immediately preceding instruction cycle without breaking the dependency relation of the instruction corresponding to the intermediate code, An optimization step of optimizing the intermediate code by placing the instruction at a corresponding position in each of a plurality of instruction issuing units;
A code generation step for converting the optimized intermediate code into a machine language instruction.
JP2006207058A 2006-07-28 2006-07-28 Compiler device and compiling method Expired - Lifetime JP4721975B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006207058A JP4721975B2 (en) 2006-07-28 2006-07-28 Compiler device and compiling method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006207058A JP4721975B2 (en) 2006-07-28 2006-07-28 Compiler device and compiling method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2003019365A Division JP3896087B2 (en) 2003-01-28 2003-01-28 Compiler device and compiling method

Publications (2)

Publication Number Publication Date
JP2006286027A true JP2006286027A (en) 2006-10-19
JP4721975B2 JP4721975B2 (en) 2011-07-13

Family

ID=37407801

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006207058A Expired - Lifetime JP4721975B2 (en) 2006-07-28 2006-07-28 Compiler device and compiling method

Country Status (1)

Country Link
JP (1) JP4721975B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102248787B1 (en) 2014-08-28 2021-05-06 삼성전자 주식회사 Method and apparatus for power control for GPU resources

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06214802A (en) * 1993-01-20 1994-08-05 Fuji Xerox Co Ltd Register allotment system
JPH07121377A (en) * 1993-10-20 1995-05-12 Matsushita Electric Ind Co Ltd Resource allocating device
JPH08101773A (en) * 1994-09-30 1996-04-16 Toshiba Corp Information processor
JPH08101777A (en) * 1994-09-30 1996-04-16 Toshiba Corp Instruction string optimizing device
JPH08314727A (en) * 1995-03-16 1996-11-29 Matsushita Electric Ind Co Ltd Resource allocation device
JPH11249896A (en) * 1997-12-23 1999-09-17 Texas Instr Inc <Ti> Power reducing method for multi-instruction word processor
JP2000284968A (en) * 1999-03-31 2000-10-13 Toshiba Corp Method and device for compiling
JP2001243077A (en) * 2000-02-22 2001-09-07 Texas Instr Inc <Ti> Method for optimally compiling application program
JP2002342091A (en) * 2001-05-18 2002-11-29 Mitsubishi Electric Corp Program preparation device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06214802A (en) * 1993-01-20 1994-08-05 Fuji Xerox Co Ltd Register allotment system
JPH07121377A (en) * 1993-10-20 1995-05-12 Matsushita Electric Ind Co Ltd Resource allocating device
JPH08101773A (en) * 1994-09-30 1996-04-16 Toshiba Corp Information processor
JPH08101777A (en) * 1994-09-30 1996-04-16 Toshiba Corp Instruction string optimizing device
JPH08314727A (en) * 1995-03-16 1996-11-29 Matsushita Electric Ind Co Ltd Resource allocation device
JPH11249896A (en) * 1997-12-23 1999-09-17 Texas Instr Inc <Ti> Power reducing method for multi-instruction word processor
JP2000284968A (en) * 1999-03-31 2000-10-13 Toshiba Corp Method and device for compiling
JP2001243077A (en) * 2000-02-22 2001-09-07 Texas Instr Inc <Ti> Method for optimally compiling application program
JP2002342091A (en) * 2001-05-18 2002-11-29 Mitsubishi Electric Corp Program preparation device

Also Published As

Publication number Publication date
JP4721975B2 (en) 2011-07-13

Similar Documents

Publication Publication Date Title
JP3896087B2 (en) Compiler device and compiling method
Eichenberger et al. Using advanced compiler technology to exploit the performance of the Cell Broadband Engine™ architecture
Hoogerbrugge et al. Transport-triggering vs. operation-triggering
US5790874A (en) Information processing apparatus for reducing power consumption by minimizing hamming distance between consecutive instruction
Goossens et al. Embedded software in real-time signal processing systems: Design technologies
JP3801545B2 (en) COMPILER PROGRAM, COMPILER DEVICE, AND COMPILING METHOD
Leupers et al. Retargetable compiler technology for embedded systems: tools and applications
JP4283131B2 (en) Processor and compiling method
JP3327818B2 (en) Program conversion device and recording medium
EP0843257A2 (en) Improved code optimiser for pipelined computers
JPH09282179A (en) Method and device for instruction scheduling in optimized compiler for minimizing overhead instruction
Kessler Compiling for VLIW DSPs
Araujo et al. Code generation for fixed-point DSPs
US7076775B2 (en) Power efficiency in microprocessor systems
Hohenauer et al. A SIMD optimization framework for retargetable compilers
Kessler et al. Optimal integrated code generation for clustered VLIW architectures
JP4721975B2 (en) Compiler device and compiling method
DeVries A vectorizing SUIF compiler: implementation and performance.
EP2181389A2 (en) Data processing with protection against soft errors
US8677312B1 (en) Generation of compiler description from architecture description
EP1828889B1 (en) Compiling method, compiling apparatus and computer system to compile a loop in a program
JP6897213B2 (en) Code generator, code generator and code generator
Canedo et al. Compiling for reduced bit-width queue processors
Tian et al. Inside the Intel 10.1 Compilers: New Threadizer and New Vectorizer for Intel Core2 Processors.
JP4006887B2 (en) Compiler, processor and recording medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060823

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090901

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20091026

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100824

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20110315

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110405

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

Free format text: PAYMENT UNTIL: 20140415

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250