JP5218063B2 - Instruction opcode generation system - Google Patents

Instruction opcode generation system Download PDF

Info

Publication number
JP5218063B2
JP5218063B2 JP2008545398A JP2008545398A JP5218063B2 JP 5218063 B2 JP5218063 B2 JP 5218063B2 JP 2008545398 A JP2008545398 A JP 2008545398A JP 2008545398 A JP2008545398 A JP 2008545398A JP 5218063 B2 JP5218063 B2 JP 5218063B2
Authority
JP
Japan
Prior art keywords
opcode
instruction
value
length
operation code
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.)
Expired - Fee Related
Application number
JP2008545398A
Other languages
Japanese (ja)
Other versions
JPWO2008062768A1 (en
Inventor
孝寛 久村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP2008545398A priority Critical patent/JP5218063B2/en
Publication of JPWO2008062768A1 publication Critical patent/JPWO2008062768A1/en
Application granted granted Critical
Publication of JP5218063B2 publication Critical patent/JP5218063B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

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

Description

本発明は、プロセッサを設計するツールで用いられる命令オペコード生成システムに関し、特にプロセッサの命令セットの設計において命令オペコードを自動的に決定する技術に関する。   The present invention relates to an instruction opcode generation system used in a tool for designing a processor, and more particularly to a technique for automatically determining an instruction opcode in designing an instruction set of a processor.

従来、プロセッサの設計を効率良く行なうためにさまざまなツールが開発されている。そのようなツールの一つにプロセッサの設計仕様からプロセッサのハードウェア構成やソフトウェア開発ツールを生成するツールがある。そうしたツールをここでは「プロセッサ設計ツール」と呼ぶことにする。従来のプロセッサ設計ツールでは、命令語長やオペコードやオペランドなどの情報を全て設計者が定義する。一つの命令を定義する際に、その命令の語長を定義したり、その命令がもつオペランドの種類や数を定義したりする。   Conventionally, various tools have been developed to efficiently design a processor. One of such tools is a tool for generating a hardware configuration of a processor and a software development tool from a processor design specification. Such a tool is referred to herein as a “processor design tool”. In a conventional processor design tool, the designer defines all information such as instruction word length, opcode, and operand. When defining one instruction, the word length of the instruction is defined, and the type and number of operands of the instruction are defined.

従来のプロセッサ設計ツールが非特許文献1、2、特許文献1〜3で紹介されている。例えば、非特許文献1のツールは、プロセッサの命令セットを定義し、そのプロセッサのシミュレータを生成することができる。非特許文献1のツールでは、以下のように命令のビットパターンを定義する。   Conventional processor design tools are introduced in Non-Patent Documents 1 and 2 and Patent Documents 1 to 3. For example, the tool of Non-Patent Document 1 can define a processor instruction set and generate a simulator for the processor. In the tool of Non-Patent Document 1, an instruction bit pattern is defined as follows.

CODING {Dest Src1 Src2 0b010000 0b10000}
ここでは、'{'と'}'で囲まれた部分がビットパターンを表す。DestとSrc1とSrc2は、それぞれレジスタの番号を表す。その後の0b010000と0b10000は、命令のオペコードを表す2進数である。このように命令のビットパターンを構成する情報を全て設計者が定義する必要がある。他の文献で紹介されているツールでも同様である。
CODING {Dest Src1 Src2 0b010000 0b10000}
Here, a portion surrounded by “{” and “}” represents a bit pattern. Dest, Src1, and Src2 represent register numbers, respectively. Subsequent 0b010000 and 0b10000 are binary numbers representing the operation code of the instruction. In this way, it is necessary for the designer to define all information constituting the bit pattern of the instruction. The same applies to tools introduced in other literature.

命令のオペコードは、その命令を他の命令と区別するための命令フィールドである。命令セットがあらかじめ決まっている場合、命令のオペコードを初めに一度だけ定義すればよい。しかし、どんな命令を命令セットへ追加するべきかを検討する場合には、命令のオペコードを何度か修正する必要がある。   The instruction opcode is an instruction field for distinguishing the instruction from other instructions. If the instruction set is predetermined, the instruction opcode need only be defined once at the beginning. However, when considering what instructions should be added to the instruction set, it is necessary to modify the instruction opcode several times.

もし命令のオペコードを定義したり修正したりする必要がなければ、設計者が定義する項目が減る。オペコードがどんな値をもつかは重要ではなく、各命令を識別可能なようにオペコードが定義されればよい。命令のオペコードを自動的に定義できるようにすれば、設計者が定義する項目が減り、設計効率の向上につながる。
S. Pees, et al., "LISA - Machine Description Language for Cycle-Accurate Models of Programmable DSP Architectures," 36th Design Automation Conference (DAC 99), June 1999, pp. 933-938. Andreas Hoffmann, et al., "A Survey on Modeling Issues Using the Machine Description Language Lisa," Proceedings of ICASSP 2001, Vol. 2, pp. 1137-1140, May 7-11 2001. 米国特許第6477683号明細書 米国特許第6862563号明細書 特表2003−518280号公報 特開2003−323463号公報
If there is no need to define or modify instruction opcodes, the designer defines fewer items. It does not matter what value the opcode has, and it only needs to be defined so that each instruction can be identified. If the instruction opcode can be automatically defined, the number of items defined by the designer is reduced, leading to improvement in design efficiency.
S. Pees, et al., "LISA-Machine Description Language for Cycle-Accurate Models of Programmable DSP Architectures," 36th Design Automation Conference (DAC 99), June 1999, pp. 933-938. Andreas Hoffmann, et al., "A Survey on Modeling Issues Using the Machine Description Language Lisa," Proceedings of ICASSP 2001, Vol. 2, pp. 1137-1140, May 7-11 2001. US Pat. No. 6,477,683 US Pat. No. 6,862,563 Special table 2003-518280 gazette JP 2003-323463 A

従来の命令セット生成ツールでは、命令のオペコードを定義するという作業が必要で効率が悪いという問題があった。命令セットの内容を検討して何度も試行錯誤を繰り返す際には、設計者が入力しなければならない項目が少ない方が効率的である。   In the conventional instruction set generation tool, there is a problem that the operation of defining the operation code of the instruction is required and the efficiency is low. When examining the contents of the instruction set and repeating trial and error many times, it is more efficient that the designer has fewer items to input.

本発明は、オペコードを自動的に生成できるような命令オペコード自動生成方式を提供することによって、プロセッサの命令セット設計の作業効率を向上させ、命令セットの検討における設計者の負担を軽減することを目的とする。   The present invention provides an instruction opcode automatic generation method that can automatically generate an opcode, thereby improving the efficiency of processor instruction set design and reducing the burden on the designer in the instruction set review. Objective.

上記目的を達成するため、本発明に係る命令オペコード生成システムは、プロセッサの命令セットに関する仕様データにもとづいて、前記命令セットの各命令のオペコードに割り当てるビット幅を決めるオペコードビット幅決定手段と、前記オペコードのビット幅にしたがって前記各命令を並び替える命令分類手段と、前記各命令のビット幅及び並び順番にもとづいて、その各命令のオペコードの値を決定するオペコード値決定手段と、を備えることを特徴とするIn order to achieve the above object, an instruction opcode generation system according to the present invention comprises an operation code bit width determination means for determining a bit width to be assigned to an operation code of each instruction of the instruction set based on specification data relating to an instruction set of a processor, an instruction classification means according to the bit width of the operation code rearranging said each instruction, on the basis of the bit width and the arrangement order of each instruction, that includes an opcode value determining means for determining the value of the operation code of each instruction, the Features .

また、本発明に係るシステムは、プロセッサの命令に関する仕様データにもとづいて、そのプロセッサのハードウェア構成定義又はソフトウェア開発ツールを生成するシステムであって、上記に記載の命令オペコード生成システムを用いて、前記命令セットを構成する各命令のオペコードの値を決定することを特徴とする。   Further, a system according to the present invention is a system that generates a hardware configuration definition or software development tool of a processor based on specification data related to a processor instruction, and uses the instruction opcode generation system described above, A value of an opcode of each instruction constituting the instruction set is determined.

本発明に係る命令オペコード生成方法は、プロセッサの命令セットに関する仕様データにもとづいて、前記仕様データを解釈するための仕様データ解析ステップと、前記命令セットの各命令のオペコードに割り当てるビット幅を決めるステップと、前記オペコードのビット幅にしたがって前記各命令を並び替えるステップと、前記各命令のビット幅及び並び順番にもとづいて、その各命令のオペコードの値を決定するステップと、を備えることを特徴とする。 An instruction opcode generation method according to the present invention includes a specification data analysis step for interpreting the specification data based on specification data relating to an instruction set of a processor, and a step of determining a bit width to be assigned to an operation code of each instruction of the instruction set And rearranging the instructions according to the bit width of the operation code, and determining the value of the operation code of each instruction based on the bit width and arrangement order of the instructions. To do.

本発明によれば、プロセッサの命令セットに関する仕様データにもとづいてオペコードの値が自動的に生成されるため、設計者がオペコードを定義する必要が無くなり、その分、命令セット設計の作業効率を向上させ、命令セットの検討における設計者の負担を軽減することができる。   According to the present invention, since the value of the operation code is automatically generated based on the specification data related to the instruction set of the processor, it is not necessary for the designer to define the operation code, thereby improving the work efficiency of the instruction set design. Thus, the burden on the designer in examining the instruction set can be reduced.

本発明の第一の実施の形態に係る命令オペコード生成システムを表す図である。It is a figure showing the instruction opcode production | generation system which concerns on 1st embodiment of this invention. 本発明の第二の実施の形態に係る命令オペコード生成システムを表す図である。It is a figure showing the instruction opcode production | generation system which concerns on 2nd embodiment of this invention. 本発明の実施例におけるオペコード割り当て方法のフローチャートである。It is a flowchart of the opcode allocation method in the Example of this invention. (a)はオペコードを命令のビットパターンのMSB側に配置する方法を示す図で、(b)はオペコードを命令のビットパターンのLSB側に配置する方法を示す図である。(A) is a figure which shows the method of arrange | positioning an opcode on the MSB side of the bit pattern of an instruction, (b) is a figure which shows the method of arrange | positioning an opcode on the LSB side of the bit pattern of an instruction. 第一のオペコード決定方法のフローチャートである。It is a flowchart of the 1st opcode determination method. 仕様データとなる命令の例である。It is an example of the instruction | command used as specification data. 第一のオペコード決定方法によるオペコード割り当ての例である。It is an example of opcode allocation by the 1st opcode determination method. 第二のオペコード決定方法のフローチャートである。It is a flowchart of the 2nd operation code determination method. 第二のオペコード決定方法によるオペコード割り当ての例である。It is an example of operation code allocation by the 2nd operation code determination method. 第三のオペコード決定方法のフローチャートである。It is a flowchart of the 3rd opcode determination method. 第三のオペコード決定方法によるオペコード割り当ての例である。It is an example of operation code allocation by the 3rd operation code determination method. 第四のオペコード決定方法のフローチャートである。It is a flowchart of the 4th opcode determination method. 第四のオペコード決定方法のインデックス・サブフィールド決定方法のフローチャートである。It is a flowchart of the index subfield determination method of the fourth opcode determination method. 第四のオペコード決定方法のグループ・サブフィールド決定方法のフローチャートである。It is a flowchart of the group subfield determination method of the 4th operation code determination method. 仕様データとなる命令の例である。It is an example of the instruction | command used as specification data. 第四のオペコード決定方法によるインデックス・サブフィールドの割り当ての例である。It is an example of allocation of an index subfield by the fourth opcode determination method. 第四のオペコード決定方法におけるグループ・サブフィールドのビット幅にもとづく命令並び替え実施後の命令の例である。It is an example of the instruction | indication after instruction rearrangement based on the bit width of the group subfield in the 4th opcode determination method. 第四のオペコード決定方法によるグループ・サブフィールドの割り当ての例である。It is an example of allocation of a group subfield by the 4th opcode determination method.

符号の説明Explanation of symbols

100 オペコードビット幅決定手段
200 命令並べ替え手段
300 オペコード値決定手段
400 第1のオペコードサブフィールド値決定手段
500 第2のオペコードサブフィールド値決定手段
600 仕様データ解析手段
700 オペコード出力手段
800 中間データ記憶手段
100 operation code bit width determination means 200 instruction rearrangement means 300 operation code value determination means 400 first operation code subfield value determination means 500 second operation code subfield value determination means 600 specification data analysis means 700 operation code output means 800 intermediate data storage means

次に、本発明に係る命令オペコード生成システムを実施するための最良の形態について、図面を参照して詳細に説明する。   Next, the best mode for carrying out the instruction opcode generation system according to the present invention will be described in detail with reference to the drawings.

(第一の実施の形態)
図1は、本発明の第一の実施の形態に係る命令オペコード生成システムの構成を示す。図1に示す命令オペコード生成システムは、プロセッサの命令セットに関する仕様データにもとづいて、仕様データを解釈する仕様データ解析手段600と、各命令のオペコードに割り当て可能なビット幅を決めるオペコードビット幅決定手段100と、オペコードのビット幅にしたがって命令を並び替える命令並び替え手段200と、各命令のオペコードの値を決定するオペコード値決定手段300と、命令オペコードを出力するオペコード出力手段700と、仕様データ解析手段600とオペコードビット幅決定手段100と命令並び替え手段200とオペコード値決定手段300とオペコード出力手段700が使用するデータを記憶するための中間データ記憶手段800と、を備える。
(First embodiment)
FIG. 1 shows the configuration of an instruction opcode generation system according to the first embodiment of the present invention. The instruction opcode generation system shown in FIG. 1 includes specification data analysis means 600 that interprets specification data based on specification data related to the instruction set of the processor, and operation code bit width determination means that determines the bit width that can be assigned to the operation code of each instruction. 100, instruction rearranging means 200 for rearranging instructions according to the bit width of the operation code, operation code value determining means 300 for determining the value of the operation code of each instruction, operation code output means 700 for outputting the instruction operation code, and specification data analysis Means 600, operation code bit width determination means 100, instruction rearrangement means 200, operation code value determination means 300, and intermediate data storage means 800 for storing data used by operation code output means 700.

この構成により、プロセッサの命令セットに関する仕様データにもとづいて各命令のオペコードの値が自動的に生成されるため、設計者がオペコードを定義する必要が無くなり、その分、プロセッサの命令セット設計の作業効率を向上させ、命令セットの検討における設計者の負担を軽減することができる。   With this configuration, the value of the opcode for each instruction is automatically generated based on the specification data related to the processor instruction set, eliminating the need for the designer to define the opcode. The efficiency can be improved and the burden on the designer in examining the instruction set can be reduced.

(第二の実施の形態)
図2は、本発明の第二の実施の形態に係る命令オペコード生成システムの構成を示す。図2に示す命令オペコード生成システムは、プロセッサの命令セットに関する仕様データにもとづいて、仕様データを解釈する仕様データ解析手段600と、各命令のオペコードに割り当て可能なビット幅を決めるオペコードビット幅決定手段100と、オペコードのビット幅にしたがって命令を並び替える命令並び替え手段200と、オペコードを二つのサブフィールドで構成してそれぞれのサブフィールドの値をオペコードのビット幅にもとづいて決定する二つの手段、すなわち第一のオペコードサブフィールド値決定手段400と、第二のオペコードサブフィールド値決定手段500と、命令オペコードを出力するオペコード出力手段700と、仕様データ解析手段600とオペコードビット幅決定手段100と命令並び替え手段200とオペコード値決定手段300と第一のオペコードサブフィールド値決定手段400と第二のオペコードサブフィールド値決定手段500とオペコード出力手段700が使用するデータを記憶するための中間データ記憶手段800と、を備える。
(Second embodiment)
FIG. 2 shows the configuration of an instruction opcode generation system according to the second embodiment of the present invention. The instruction opcode generation system shown in FIG. 2 includes specification data analysis means 600 that interprets specification data based on specification data relating to the instruction set of the processor, and operation code bit width determination means that determines the bit width that can be assigned to the operation code of each instruction. 100, an instruction rearranging means 200 for rearranging instructions according to the bit width of the opcode, and two means for determining the value of each subfield based on the bit width of the opcode by configuring the opcode into two subfields, That is, the first operation code subfield value determination means 400, the second operation code subfield value determination means 500, the operation code output means 700 for outputting the instruction operation code, the specification data analysis means 600, the operation code bit width determination means 100, and the instruction Sorting means 20 And an operation code value determination means 300, a first operation code subfield value determination means 400, a second operation code subfield value determination means 500, and an intermediate data storage means 800 for storing data used by the operation code output means 700. Prepare.

この構成により、第一の実施の形態と同様に、プロセッサの命令セットに関する仕様データにもとづいて各命令のオペコードの値が自動的に生成されるため、設計者がオペコードを定義する必要が無くなり、その分、プロセッサの命令セット設計の作業効率を向上させ、命令セットの検討における設計者の負担を軽減することができる。さらに、第一の実施の形態の命令オペコード生成システムと比較して、第二の実施の形態の命令オペコード生成システムには生成されたオペコードがデコードし易いという特徴がある。   With this configuration, as in the first embodiment, the value of the operation code of each instruction is automatically generated based on the specification data related to the instruction set of the processor, so that the designer need not define the operation code. As a result, the work efficiency of the instruction set design of the processor can be improved, and the burden on the designer in examining the instruction set can be reduced. Furthermore, compared with the instruction opcode generation system of the first embodiment, the instruction opcode generation system of the second embodiment has a feature that the generated opcode is easy to decode.

なお、第一および第二の実施の形態に係る命令オペコード生成システムは、いずれもコンピュータ上で動作するプログラムで実現してもよい。この場合、命令オペコード生成システムを構成するプログラムは、コンピュータを上記の各手段100〜800として機能させるものである。これにより、命令オペコード生成システムは、コンピュータを制御して、コンピュータの記憶装置からプロセッサの命令セットに関する仕様データを読みだし、その仕様データにもとづいて各命令のオペコードを決定する。   Note that the instruction opcode generation systems according to the first and second embodiments may both be realized by a program operating on a computer. In this case, the program constituting the instruction opcode generation system causes the computer to function as each of the means 100 to 800 described above. Thus, the instruction opcode generation system controls the computer, reads the specification data regarding the instruction set of the processor from the storage device of the computer, and determines the operation code of each instruction based on the specification data.

以下、図3〜図18を参照して、第一および第二の実施の形態に係る命令オペコード生成システムの実施例について、具体的に説明する。なお、以下の実施例では、前述の図1及び図2に示す各手段100〜800は、コンピュータ機のプロセッサ(CPU:central processing unit)がその記録媒体に配置された命令オペコード生成システム用のプログラムコードを実行することにより実現される。   Hereinafter, examples of the instruction opcode generation system according to the first and second embodiments will be described in detail with reference to FIGS. In the following embodiment, each of the means 100 to 800 shown in FIGS. 1 and 2 is a program for an instruction opcode generation system in which a processor (CPU: central processing unit) of a computer is arranged on a recording medium. Realized by executing code.

最初に、プロセッサの命令はどのように定義されるかについて説明する。   First, it will be described how the processor instructions are defined.

プロセッサの命令は、0と1のビットパターンとして表される。命令のビットパターンのどのビットがどのような意味をもつかを予め定義しておいて、プロセッサが命令のビットパターンを読み込んでその命令を解釈する。   Processor instructions are represented as bit patterns of 0s and 1s. Which bits of the instruction bit pattern have what meanings are defined in advance, and the processor reads the instruction bit pattern and interprets the instruction.

命令のビットパターンには、オペコードとオペランドの二種類のフィールドがある。オペコードは、命令の名前や種類を表すフィールドである。命令の名前や種類を表すために、命令には、必ずオペコードが一つ必要である。オペコードは命令の名前や種類を表すので、異なる名前や種類の命令は異なるオペコードをもつ。オペランドは、命令へ与えられるパラメータを表すフィールドである。命令が複数のオペランドをもつこともあるし、一つもオペランドをもたない命令もある。   The instruction bit pattern has two types of fields: opcode and operand. The opcode is a field indicating the name and type of the instruction. An instruction must have one opcode to indicate the name and type of the instruction. Since the opcode represents the name and type of the instruction, different names and types of instructions have different opcodes. The operand is a field representing a parameter given to the instruction. An instruction may have multiple operands, and some instructions may have no operands.

プロセッサが命令を解釈するには、まず命令のオペコードからその命令の名前や種類を知る。次に命令の名前や種類からオペランドの数や意味を知る。命令の名前や種類とオペランドの数や意味とは一対一の関係にあるので、オペコードを解釈し易いか否かが命令の解釈し易さに直接関係する。   To interpret an instruction, the processor first knows the name and type of the instruction from the instruction opcode. Next, learn the number and meaning of operands from the name and type of instruction. Since the name and type of the instruction and the number and meaning of the operands have a one-to-one relationship, whether or not the opcode is easy to interpret is directly related to the ease of interpreting the instruction.

例えば、命令語長が一定で、オペコードの開始ビット位置が一定で、オペコードのビット幅が一定であるなら、非常に簡単にオペコードを解釈できる。しかし、一般的にはオペコードのビット幅は一定ではないし、命令語長やオペコードの開始ビット位置が一定ではないかも知れない。オペコードの解釈を容易にするには、オペコードの開始ビット位置を一定にして、オペコードのビット幅の種類をできるだけ少なくすればよい。   For example, if the instruction word length is constant, the start bit position of the operation code is constant, and the bit width of the operation code is constant, the operation code can be interpreted very easily. However, generally, the bit width of the operation code is not constant, and the instruction word length and the start bit position of the operation code may not be constant. In order to facilitate the interpretation of the operation code, the operation code start bit position should be constant and the number of types of the operation code bit width should be as small as possible.

[オペコード生成方法]
次に、命令のオペコードをどのように決定するかについて説明する。なお、本明細書で用いる各種の演算子(=、+=、==、<<、&、~、+、-、等)の意味は、C言語で一般に使用されている意味と同じとする。例えば、「x=y」は、xにyを代入する代入演算を意味する。また「x+=y」は、xにx+yを代入する代入演算を意味する(x=x+yと同じ意味である)。「x==y」は、xとyとの等値性を判断する関係演算を意味し、等しければ真、等しくなければ偽を返す。「x<<y」は、xをy分だけ左にシフトさせるシフト演算を意味する。「x&y」は、xとyとの論理積を計算する論理演算を意味する。「~x」はxの全てのビットを反転する演算を意味する。
[Operation code generation method]
Next, how to determine the instruction opcode will be described. The meanings of various operators (=, + =, ==, <<, &, ~, +,-, etc.) used in this specification are the same as those generally used in the C language. . For example, “x = y” means an assignment operation that assigns y to x. “X + = y” means an assignment operation that substitutes x + y for x (same meaning as x = x + y). “X == y” means a relational operation for determining equality between x and y, and returns true if they are equal, false if they are not equal. “X << y” means a shift operation for shifting x to the left by y. “X & y” means a logical operation for calculating a logical product of x and y. “˜x” means an operation for inverting all bits of x.

まず、以降の説明で使用する言葉について定義しておく。以下のうち、(仕様)と書かれているものは、オペコードを生成するために設計者が定義するべき情報(仕様データ)を意味する。   First, terms used in the following explanation are defined. Of the following, what is written as (specification) means information (specification data) that the designer should define in order to generate the operation code.

[定義1]命令の番号をkあるいはiで表す。   [Definition 1] The instruction number is represented by k or i.

[定義2]命令の総数をSとする(仕様)。   [Definition 2] Let S be the total number of instructions (specification).

[定義3]命令の語長をNとする(仕様)。   [Definition 3] Let N be the word length of the instruction (specification).

[定義4]命令kの全てのオペランドを表すために使用するビットパターンの幅を、total_operands_length[k]とする(仕様)。   [Definition 4] The width of the bit pattern used to represent all the operands of the instruction k is total_operands_length [k] (specification).

[定義5]命令kのオペコードフィールドの長さを、opcode_length[k]ビットとする。   [Definition 5] The length of the opcode field of the instruction k is opcode_length [k] bits.

[定義6]命令kのオペコードフィールドの値を、opcode_value[k]とする。opcode_value[k]は、符号無し整数とする。   [Definition 6] The value of the opcode field of the instruction k is opcode_value [k]. opcode_value [k] is an unsigned integer.

[定義7]オペコードフィールドの長さがxビットである命令の数を、num_of_inst_having_opcode_length(x)とする。   [Definition 7] The number of instructions whose opcode field length is x bits is num_of_inst_having_opcode_length (x).

[定義8]値x以上の2のべき乗の最小値を、min_power_of_2(x)とする。   [Definition 8] The minimum power of 2 that is greater than or equal to the value x is min_power_of_2 (x).

[定義9]ビット幅がlengthである値xのビットリバースした値を、bitrev(x,length)とする。   [Definition 9] A value obtained by bit-reversing a value x having a bit width of length is defined as bitrev (x, length).

次に、上記の定義1〜9を前提にして命令のオペコードを割り当てる方法を以下に示す。以下の方法に対応するフローチャートを図3に示す。   Next, a method for assigning instruction opcodes based on the above definitions 1 to 9 will be described below. A flowchart corresponding to the following method is shown in FIG.

(0)まず、仕様データを読込む(ステップSt0)。   (0) First, the specification data is read (step St0).

ここでは、仕様データから命令kの全てのオペランドを表すために使用するビットパターンの幅total_operands_length[k]を読み取る。この処理は図1及び図2に示す仕様データ解析手段600により実行される。   Here, the width total_operands_length [k] of the bit pattern used to represent all the operands of the instruction k is read from the specification data. This process is executed by the specification data analysis means 600 shown in FIGS.

(1)次に、命令のオペコードフィールドのビット幅を決定する(ステップSt1)。   (1) Next, the bit width of the opcode field of the instruction is determined (step St1).

ここでは、命令kのオペコードフィールドのビット幅opcode_length[k]を以下のように定義する。   Here, the bit width opcode_length [k] of the opcode field of the instruction k is defined as follows.

opcode_length[k]=N-total_operands_length[k](k=0,1,...,S-1)
この処理は、図1及び図2に示すオペコードビット幅決定手段100により実行される。
opcode_length [k] = N-total_operands_length [k] (k = 0,1, ..., S-1)
This process is executed by the operation code bit width determining means 100 shown in FIGS.

(2)次に、命令をソートする(ステップSt2)。   (2) Next, the instructions are sorted (step St2).

ここでは、total_operands_length[k]にもとづいて、全ての命令をソートする。ソート後の命令の番号をiで表す。最も多くのビットをオペランドに使用する命令の番号iを0とする。最も少ないビットをオペランドに使用する命令の番号iをS-1とする。   Here, all instructions are sorted based on total_operands_length [k]. The instruction number after sorting is represented by i. The instruction number i that uses the most bits as an operand is set to 0. Let S-1 be the instruction number i that uses the least number of bits as an operand.

この処理は、図1及び図2に示す命令並び替え手段200により実行される。   This process is executed by the instruction rearranging means 200 shown in FIGS.

(3)次に、命令のオペコードフィールドの値を決定する(ステップSt3)。   (3) Next, the value of the opcode field of the instruction is determined (step St3).

ここでは、0番目の命令から順番にオペコードフィールドの値opcode_value[i]を決定する。この処理は、図1に示すオペコード値決定手段300、又は図2に示す第1のオペコードサブフィールド値決定手段400と第2のオペコードサブフィールド値決定手段500によりそれぞれ実行される。   Here, the opcode field value opcode_value [i] is determined in order from the 0th instruction. This process is executed by the opcode value determining means 300 shown in FIG. 1, or the first opcode subfield value determining means 400 and the second opcode subfield value determining means 500 shown in FIG.

上記の手順において、オペコードフィールドを命令のビットパターンのMost Significant Bit(MSB)側に配置する場合、図4(a)のようにオペコードフィールドを配置する。一方、オペコードフィールドを命令のビットパターンのLeast Significant Bit(LSB)側に配置する場合、図4(b)のようにオペコードフィールドの値をビットリバースした値を配置する。   In the above procedure, when the opcode field is arranged on the Most Significant Bit (MSB) side of the instruction bit pattern, the opcode field is arranged as shown in FIG. On the other hand, when the opcode field is arranged on the Least Significant Bit (LSB) side of the instruction bit pattern, a value obtained by bit-reversing the value of the opcode field is arranged as shown in FIG.

図4(a)及び(b)において、opcode_length[i]は命令iのオペコードのビット幅を、opcode_value[i]は命令iのオペコードの値を、operand_0[i]は命令iの0番目のオペランドの内容を、operand_1[i]は命令iの1番目のオペランドの内容を、operand_q[i]は命令iのq番目のオペランドの内容を、bitrev(X,Y)はXの下位Yビットをビットリバースした値を、それぞれ表す。   4 (a) and 4 (b), opcode_length [i] is the bit width of the opcode of instruction i, opcode_value [i] is the value of the opcode of instruction i, and operand_0 [i] is the 0th operand of instruction i. , Operand_1 [i] is the content of the first operand of instruction i, operand_q [i] is the content of the qth operand of instruction i, bitrev (X, Y) is the low-order Y bit of X Each reversed value is represented.

上記の手順のうち、(3)オペコードフィールドの値を決定する方法(ステップSt3)はいくつかある。以降でその方法について説明する。   Among the procedures described above, there are several methods (3) for determining the value of the opcode field (step St3). The method will be described below.

[第一のオペコード決定方法]
最初に、第一のオペコード決定方法について説明する。
[First Opcode Determination Method]
First, the first opcode determination method will be described.

このオペコード決定方法では、まず、前述の方法にしたがって、(1)オペコードフィールドのビット幅の決定、(2)命令のソート、を行なう。その後で、以下のようにして、(3)各命令のオペコードの値opcode_value[i]を決定する。   In this opcode determining method, first, according to the above-described method, (1) the bit width of the opcode field is determined and (2) the instructions are sorted. Thereafter, (3) the opcode value opcode_value [i] of each instruction is determined as follows.

このオペコード決定方法のフローチャートを図5に示す。図5において、iは命令の番号を、Sは命令の総数を、opcode_value[i]は命令iのオペコードの値を、opcode_length[i]は命令iのオペコードのビット幅を、それぞれ表す。   A flowchart of this opcode determination method is shown in FIG. In FIG. 5, i represents the instruction number, S represents the total number of instructions, opcode_value [i] represents the value of the opcode of instruction i, and opcode_length [i] represents the bit width of the opcode of instruction i.

まず、opcode_value[0]へ0を代入する(ステップSt11)。   First, 0 is assigned to opcode_value [0] (step St11).

続いて、命令の番号iを1からS-1まで順番に変えながら、opcode_value[i]を以下のように決定する(ステップSt12〜St15)。   Subsequently, opcode_value [i] is determined as follows while sequentially changing the instruction number i from 1 to S-1 (steps St12 to St15).

opcode_value[i]=((opcode_value[i-1]+1)<<(opcode_length[i]-opcode_length[i-1]))
すなわち、opcode_value[i-1]に1を加算する演算を行う一方、opcode_length[i]からopcode_length[i-1]を減算する演算を行う。そして、前者の演算値を後者の演算値分だけ左にシフトさせる演算を行い、その演算値をopcode_value[i]に代入する。このようにして、各命令のオペコードの値を決定する。
opcode_value [i] = ((opcode_value [i-1] +1) << (opcode_length [i] -opcode_length [i-1]))
That is, an operation of adding 1 to opcode_value [i-1] is performed, and an operation of subtracting opcode_length [i-1] from opcode_length [i] is performed. Then, an operation for shifting the former operation value to the left by the latter operation value is performed, and the operation value is assigned to opcode_value [i]. In this way, the value of the operation code of each instruction is determined.

上記の第一のオペコード決定方法によるオペコード割り当ての例を図6と図7に示す。図6は14個の命令のビットパターンを表す(S=14)。図6において、Ra、Rb、Rcはレジスタの番号を表すオペランド・フィールドである。IMM6、IMM4、IMM2は数値を表すオペランド・フィールドである。図6において、各命令の語長は16ビットである(N=16)。図6において、ビットパターンのMSB側に書かれた0や1のビットパターンがオペコードを表す。   An example of the operation code assignment by the first operation code determination method is shown in FIGS. FIG. 6 shows the bit pattern of 14 instructions (S = 14). In FIG. 6, Ra, Rb, and Rc are operand fields representing register numbers. IMM6, IMM4, and IMM2 are operand fields representing numerical values. In FIG. 6, the word length of each instruction is 16 bits (N = 16). In FIG. 6, the 0 or 1 bit pattern written on the MSB side of the bit pattern represents the opcode.

図6のような命令の語長とオペランド・フィールドのビット幅をもつ命令セットの仕様データが与えられたとして、第一のオペコード決定方法により命令U、V、W、A、B、C、D、E、F、G、H、P、Q、Tのオペコードの値を決定する。   Given the instruction set specification data having the word length of the instruction and the bit width of the operand field as shown in FIG. 6, the instructions U, V, W, A, B, C, and D are determined by the first opcode determination method. , E, F, G, H, P, Q, and T opcode values are determined.

図6の命令をopcode_length[i]にもとづいて並び替え、図5のステップSt11からSt15までの処理を実行すると図7が得られる。図7に示すように、各命令のオペコードの値opcode_value[i](i=0、…、13)は、他のどの命令のオペコードの値とも重複していない。したがって、第一のオペコード決定方法で生成されたオペコードによって、各命令を正しく識別することができる。   7 is obtained by rearranging the instructions in FIG. 6 based on opcode_length [i] and executing the processing from steps St11 to St15 in FIG. As shown in FIG. 7, the opcode value opcode_value [i] (i = 0,..., 13) of each instruction does not overlap with the value of the opcode of any other instruction. Therefore, each instruction can be correctly identified by the operation code generated by the first operation code determination method.

図6は命令の仕様データの一つの表現形態である。必ずしも仕様データを図6のように記述する必要はない。テキストファイルとして仕様データを記述してもよい。   FIG. 6 shows an expression form of instruction specification data. It is not always necessary to describe the specification data as shown in FIG. The specification data may be described as a text file.

上記のように第一のオペコード決定方法は、非常に単純であることが特徴である。さらに、このオペコード決定方法には、下記の他のオペコード決定方法よりも多くの種類のオペコードを表現できるという利点がある。   As described above, the first opcode determination method is very simple. Furthermore, this operation code determination method has an advantage that more types of operation codes can be expressed than the following other operation code determination methods.

なお、第一のオペコード決定方法で生成されたオペコードは、そのデコードが多少複雑になる。すなわち、上記のオペコードをデコードするには引き算と比較演算が必要になる。命令を1サイクルでデコードするには、複数の引き算と比較演算を同時に実行する必要があるので、下記の他のオペコード決定方法に比べてオペコードのデコード回路の規模が大きくなる。   Note that the operation code generated by the first operation code determination method is somewhat complicated to decode. That is, subtraction and comparison are required to decode the above operation code. In order to decode an instruction in one cycle, it is necessary to execute a plurality of subtractions and comparison operations at the same time. Therefore, the scale of the operation code decoding circuit becomes larger than the other operation code determination methods described below.

[第二のオペコード決定方法]
次に、第二のオペコード決定方法について説明する。
[Second opcode determination method]
Next, the second operation code determination method will be described.

このオペコード決定方法では、まず、前述の方法にしたがって、(1)オペコードフィールドのビット幅の決定(ステップSt1)、(2)命令のソート(ステップSt2)、を行なう。その後で、以下のようにして、(3)各命令のオペコードの値opcode_value[i]を決定する。   In this operation code determination method, first, (1) determination of the bit width of the operation code field (step St1) and (2) instruction sorting (step St2) are performed according to the above-described method. Thereafter, (3) the opcode value opcode_value [i] of each instruction is determined as follows.

このオペコード決定方法のフローチャートを図8に示す。図8において、iは命令の番号を、Sは命令の総数を、opcode_value[i]は命令iのオペコードの値を、opcode_length[i]は命令iのオペコードのビット幅を、それぞれ表す。   A flowchart of this opcode determination method is shown in FIG. In FIG. 8, i represents the instruction number, S represents the total number of instructions, opcode_value [i] represents the value of the opcode of instruction i, and opcode_length [i] represents the bit width of the opcode of instruction i.

まず、opcode_value[0]へ0を代入する(ステップSt21)。   First, 0 is assigned to opcode_value [0] (step St21).

続いて、命令の番号iを1からS-1まで順番に変えながら、命令iのオペコードの値opcode_value[i]を以下のように決定する(ステップSt22〜St30)。   Subsequently, while changing the instruction number i in order from 1 to S-1, the value opcode_value [i] of the instruction i of the instruction i is determined as follows (steps St22 to St30).

ステップSt23において、opcode_length[i]がopcode_length[i-1]と同じかどうかを
判断する。
In step St23, it is determined whether or not opcode_length [i] is the same as opcode_length [i-1].

opcode_length[i]がopcode_length[i-1]と同じなら(ステップSt23:YES)、opcode_value[i-1]に1を加算する演算を行い、その演算値をopcode_value[i]へ代入する(ステップSt24)。すなわち、opcode_value[i-1]に1を加算した値をopcode_length[i]とする。   If opcode_length [i] is the same as opcode_length [i-1] (step St23: YES), an operation of adding 1 to opcode_value [i-1] is performed, and the calculated value is assigned to opcode_value [i] (step St24). ). That is, a value obtained by adding 1 to opcode_value [i-1] is defined as opcode_length [i].

一方、opcode_length[i]がopcode_length[i-1]と異なるなら(ステップSt23:NO)、opcode_value[i]=(opcode_value[i-1]<<(opcode_length[i]-opcode_length[i-1]))とする(ステップSt25)。すなわち、opcode_length[i]からopcode_length[i-1]を減算する演算を行う。そして、その演算値分だけ、opcode_value[i-1]を左にシフトさせる演算を行い、その演算値をopcode_value[i]へ代入する。つづいて、ステップSt26を実行する。   On the other hand, if opcode_length [i] is different from opcode_length [i-1] (step St23: NO), opcode_value [i] = (opcode_value [i-1] << (opcode_length [i] -opcode_length [i-1]) ) (Step St25). That is, an operation of subtracting opcode_length [i-1] from opcode_length [i] is performed. Then, an operation for shifting opcode_value [i-1] to the left by the calculated value is performed, and the calculated value is assigned to opcode_value [i]. Subsequently, Step St26 is executed.

ステップSt26において、(1<<(opcode_length[i]-opcode_length[i-1]))という値よりも、命令iと同じオペコード長をもつ命令の数以上の最小の2のべき乗の値(min_power_of_2(num_of_inst_having_opcode_length(opcode_length[i])))が大きいかどうか判断し、大きい方の値をZとする。   In step St26, the minimum power of 2 (min_power_of_2 (min_power_of_2 ()) which is equal to or greater than the number of instructions having the same opcode length as the instruction i, rather than the value of (1 << (opcode_length [i] -opcode_length [i-1])). num_of_inst_having_opcode_length (opcode_length [i]))) is determined to be large, and the larger value is set to Z.

ステップSt26の判定がYESの場合、Z=min_power_of_2(num_of_inst_having_opcode_length(opcode_length[i]))として、opcode_value[i]=(opcode_value[i]+Z)&(~(Z-1))という計算式によってopcode_value[i]を求める。   If the determination in step St26 is YES, Zcode = value is calculated by the following formula: opcode_value [i] = (opcode_value [i] + Z) & (~ (Z-1)) as Z = min_power_of_2 (num_of_inst_having_opcode_length (opcode_length [i])) Find [i].

一方、ステップSt26の判定がNOの場合、Z=(1<<(opvode_length[i]-opcode_length[i-1]))として、opcode_value[i]=(opcode_value[i]+Z)&(~(Z-1))という計算式によってopcode_value[i]を求める(ステップSt28)。   On the other hand, if the determination in step St26 is NO, as Z = (1 << (opvode_length [i] -opcode_length [i-1])), opcode_value [i] = (opcode_value [i] + Z) & (~ ( The opcode_value [i] is obtained by the calculation formula Z-1)) (step St28).

以上のようにして、各命令のオペコードの値を決定する。   As described above, the value of the operation code of each instruction is determined.

上記の第二のオペコード決定方法によるオペコード割り当ての例を図6と図9に示す。図6の命令を仕様データとして、それらの命令をopcode_length[i]にもとづいて並び替え、図8のステップSt21からSt30までの処理を実行すると図9が得られる。   Examples of operation code assignment by the second operation code determination method are shown in FIGS. When the instructions in FIG. 6 are used as specification data, the instructions are rearranged based on opcode_length [i], and the processing from steps St21 to St30 in FIG. 8 is executed, FIG. 9 is obtained.

図9に示すように、各命令のオペコードの値opcode_value[i](i=0、…、13)は、他のどの命令のオペコードの値とも重複していない。したがって、このオペコード決定方法で生成されたオペコードを使って、各命令を正しく識別することができる。   As shown in FIG. 9, the opcode value opcode_value [i] (i = 0,..., 13) of each instruction does not overlap with the value of the opcode of any other instruction. Therefore, each instruction can be correctly identified using the operation code generated by this operation code determination method.

上記のように第二のオペコード決定方法は、第一のオペコード決定方法よりも多少複雑である。しかし、第二のオペコード決定方法は第一のオペコード決定方法よりも、生成されたオペコードをデコードするのが簡単である。なぜなら、第二のオペコード決定方法によって生成されたオペコードは、同じオペコードのビット幅をもつオペコードのグループを表すビット列と、そのグループの中における命令のインデックスを表すビット列とから構成されているためである。これにより、オペコードを二つのビット列に分けて考えることができるため、オペコードを階層的にデコードできる。   As described above, the second operation code determination method is slightly more complicated than the first operation code determination method. However, the second operation code determination method is easier to decode the generated operation code than the first operation code determination method. This is because the operation code generated by the second operation code determination method is composed of a bit string representing a group of operation codes having the same bit width of the operation code and a bit string representing an instruction index in the group. . Thereby, since the operation code can be divided into two bit strings, the operation code can be decoded hierarchically.

すなわち、第二のオペコード決定方法で生成されたオペコードをデコードする際には、まず同じオペコードのビット幅をもつオペコードのグループを表すビット列をデコードする。そして、最も長いビット列をもつグループを選択し、次にそのグループの中における命令のインデックスを表すビット列をデコードする。第二のオペコード決定方法で生成されたオペコードをデコードする際には、引き算が必要ない。よって、論理演算とシフト演算だけでデコード回路を作ることができるので、第一のオペコード決定方法に比べて第二のオペコード決定方法のデコード回路は簡単になる。   That is, when decoding an operation code generated by the second operation code determination method, first, a bit string representing a group of operation codes having the same operation code bit width is decoded. Then, the group having the longest bit string is selected, and then the bit string representing the instruction index in the group is decoded. No subtraction is required when decoding the operation code generated by the second operation code determination method. Therefore, since the decoding circuit can be made only by the logical operation and the shift operation, the decoding circuit of the second operation code determination method becomes simpler than the first operation code determination method.

[第三のオペコード決定方法]
次に、第三のオペコード決定方法について説明する。
[Third opcode determination method]
Next, a third operation code determination method will be described.

このオペコード決定方法では、まず、前述の方法にしたがって、(1)オペコードフィールドのビット幅の決定(ステップSt1)、(2)命令のソート(ステップSt2)、を行なう。その後で、以下のようにして、(3)各命令のオペコードの値opcode_value[i]を決定する。   In this operation code determination method, first, (1) determination of the bit width of the operation code field (step St1) and (2) instruction sorting (step St2) are performed according to the above-described method. Thereafter, (3) the opcode value opcode_value [i] of each instruction is determined as follows.

このオペコード決定方法のフローチャートを図10に示す。図10において、iは命令の番号を、Sは命令の総数を、opcode_value[i]は命令iのオペコードの値を、opcode_length[i]は命令iのオペコードのビット幅を、それぞれ表す。   A flowchart of this opcode determination method is shown in FIG. In FIG. 10, i represents the instruction number, S represents the total number of instructions, opcode_value [i] represents the opcode value of the instruction i, and opcode_length [i] represents the bit width of the opcode of the instruction i.

まず、opcode_value[0]へ0を代入する(ステップSt31)。   First, 0 is assigned to opcode_value [0] (step St31).

続いて、命令の番号iを1からS-1まで順番に変えながら、opcode_value[i]を以下のようにして決定する(ステップSt32〜St38)。   Subsequently, opcode_value [i] is determined as follows while sequentially changing the instruction number i from 1 to S-1 (steps St32 to St38).

ステップSt23において、opcode_length[i]がopcode_length[i-1]と同じかどうか判断する。   In step St23, it is determined whether or not opcode_length [i] is the same as opcode_length [i-1].

opcode_length[i]がopcode_length[i-1]と同じなら(ステップSt23:YES)、opcode_value[i-1]に1を加算する演算を行い、その演算値をopcode_value[i]へ代入する(ステップSt24)。   If opcode_length [i] is the same as opcode_length [i-1] (step St23: YES), an operation of adding 1 to opcode_value [i-1] is performed, and the calculated value is assigned to opcode_value [i] (step St24). ).

一方、opcode_length[i]がopcode_length[i-1]と異なるなら(ステップSt23:NO)、命令iと同じオペコード長をもつ命令の数以上の最小の2のべき乗の値(min_power_of_2(num_of_inst_having_opcode_length(opcode_length[i-1]))をZとする(ステップSt35)。つづいてステップ36を実行する。   On the other hand, if opcode_length [i] is different from opcode_length [i-1] (step St23: NO), the smallest power-of-two value (min_power_of_2 (num_of_inst_having_opcode_length (opcode_length [opcode [length [opcode_length [opcode [length [opcode_length [op] [opcode_length [ i-1])) is set to Z (step St35), and then step 36 is executed.

ステップ36において、opcode_value[i]=((opcode_value[i-1]+Z)<<(opcode_length[i]-opcode_length[i-1]))という計算式にもとづいてopcode_value[i]を求める。   In step 36, opcode_value [i] is obtained based on the calculation formula: opcode_value [i] = ((opcode_value [i-1] + Z) << (opcode_length [i] -opcode_length [i-1])).

以上のようにして、各命令のオペコードの値を決定する。   As described above, the value of the operation code of each instruction is determined.

上記の第三のオペコード決定方法によるオペコード割り当ての例を図6と図11に示す。図6の命令を仕様データとして、それらの命令をopcode_length[i]にもとづいて並び替え、図8のステップSt31からSt38までの処理を実行すると図11が得られる。   Examples of operation code assignment by the third operation code determination method are shown in FIGS. FIG. 11 is obtained when the instructions of FIG. 6 are used as specification data, the instructions are rearranged based on opcode_length [i], and the processing from step St31 to St38 of FIG. 8 is executed.

図11に示すように、各命令のオペコードの値opcode_value[i](i=0、…、13)は、他のどの命令のオペコードの値とも重複していない。したがって、このオペコード決定方法で生成されたオペコードを使って、各命令を正しく識別することができる。   As shown in FIG. 11, the opcode value opcode_value [i] (i = 0,..., 13) of each instruction does not overlap with the value of the opcode of any other instruction. Therefore, each instruction can be correctly identified using the operation code generated by this operation code determination method.

第三のオペコード決定方法によって生成されたオペコードをデコードするには、引き算と比較演算が必要になる。この点は第一のオペコード決定方法と同様である。   Decoding and comparison operations are required to decode the operation code generated by the third operation code determination method. This is the same as the first opcode determination method.

なお、第三のオペコード決定方法は、第一や第二のオペコード決定方法に比べると、第一のオペコード決定方法よりもオペコード決定方法が単純でなく、第二のオペコード決定方法よりもオペコードのデコードが簡単ではない。   The third operation code determination method is not simpler than the first operation code determination method than the first and second operation code determination methods, and the operation code decoding method is more difficult than the second operation code determination method. Is not easy.

[第四のオペコード決定方法]
次に、第四のオペコード決定方法について説明する。
[Fourth operation code determination method]
Next, a fourth opcode determination method will be described.

このオペコード決定方法では、オペコードフィールドを二つのサブフィールドに分ける。一つはグループ・サブフィールドで、もう一つはインデックス・サブフィールドとする。グループ・サブフィールドをMSB側に配置し、インデックス・サブフィールドをLSB側に配置する。この方法では、インデックス・サブフィールドとグループ・サブフィールドを別々に決定する。   In this operation code determination method, the operation code field is divided into two subfields. One is a group subfield and the other is an index subfield. The group subfield is placed on the MSB side, and the index subfield is placed on the LSB side. In this method, the index subfield and the group subfield are determined separately.

このオペコード決定方法のフローチャートを図12に示す。同図に示すように、この方法は、インデックス・サブフィールドのビット幅を決定する手順と(ステップSt41)、インデックス・サブフィールドの値を決定する手順と(ステップSt42)、グループ・サブフィールドのビット幅を決定する手順と(ステップSt43)、グループ・サブフィールドのビット幅にもとづいて命令を並び替える手順と(ステップSt44)、グループ・サブフィールドの値を決定する手順と(ステップSt45)、から構成される。   A flowchart of this opcode determination method is shown in FIG. As shown in the figure, this method includes a procedure for determining the bit width of the index subfield (step St41), a procedure for determining the value of the index subfield (step St42), and the bit of the group subfield. A procedure for determining the width (step St43), a procedure for rearranging instructions based on the bit width of the group / subfield (step St44), and a procedure for determining the value of the group / subfield (step St45). Is done.

ここで、二つのサブフィールドに関する記号を以下のように定義する。   Here, the symbols related to the two subfields are defined as follows.

[定義10]命令iのグループ・サブフィールドの長さを、opcode_sub_grp_length[i]とする。   [Definition 10] The length of the group subfield of the instruction i is set to opcode_sub_grp_length [i].

[定義11]命令iのグループ・サブフィールドの値を、opcode_sub_grp_value[i]とする。   [Definition 11] The value of the group subfield of the instruction i is set to opcode_sub_grp_value [i].

[定義12]命令iのインデックス・サブフィールドの長さを、opcode_sub_idx_length[i]とする。   [Definition 12] The length of the index subfield of the instruction i is set to opcode_sub_idx_length [i].

[定義13]命令iのインデックス・サブフィールドの値を、opcode_sub_idx_value[i]とする。   [Definition 13] The value of the index subfield of the instruction i is set to opcode_sub_idx_value [i].

[定義14]全ての命令について、インデックス・サブフィールドの長さを以下のように決める(ステップSt41)。   [Definition 14] For all instructions, the length of the index subfield is determined as follows (step St41).

opcode_sub_idx_length[i]=min_power_of_2(num_of_inst_having_opcode_length(opcode_length[i]))
[定義15]全ての命令について、グループ・サブフィールドの長さを以下のように決める(ステップSt43)。
opcode_sub_idx_length [i] = min_power_of_2 (num_of_inst_having_opcode_length (opcode_length [i]))
[Definition 15] For all instructions, the length of the group subfield is determined as follows (step St43).

opcode_sub_grp_length[i]=opcode_length[i]-opcode_sub_idx_length[i]
次に、インデックス・サブフィールドの値を決定する手順を以下に示す。この手順に対応するフローチャートを図13に示す。図13において、iは命令の番号を、Sは命令の総数を、opcode_value[i]は命令iのオペコードの値を、opcode_length[i]は命令iのオペコードのビット幅を、opcode_sub_idx_value[i]は命令iのインデックス・サブフィールドの値を、それぞれ表す。
opcode_sub_grp_length [i] = opcode_length [i] -opcode_sub_idx_length [i]
Next, the procedure for determining the value of the index subfield is shown below. A flowchart corresponding to this procedure is shown in FIG. In FIG. 13, i is the instruction number, S is the total number of instructions, opcode_value [i] is the value of the opcode of instruction i, opcode_length [i] is the bit width of the opcode of instruction i, and opcode_sub_idx_value [i] is Represents the value of the index subfield of instruction i.

まず、opcode_sub_idx_value[0]へ0を代入する(ステップSt51)。   First, 0 is substituted into opcode_sub_idx_value [0] (step St51).

続いて、命令の番号iを1からS-1まで順番に変えながら、opcode_sub_idx_value[i]を以下のようにして決定する(ステップSt52〜St57)。   Subsequently, opcode_sub_idx_value [i] is determined as follows while sequentially changing the instruction number i from 1 to S-1 (steps St52 to St57).

ステップSt53において、opcode_length[i]がopcode_length[i-1]と同じかどうか判断する。   In step St53, it is determined whether opcode_length [i] is the same as opcode_length [i-1].

opcode_length[i]がopcode_length[i-1]と同じなら(ステップSt53:YES)、opcode_sub_idx_value[i-1]に1を加算する演算を行い、その演算値をopcode_sub_idx_value[i]へ代入する(ステップSt54)。   If opcode_length [i] is the same as opcode_length [i-1] (step St53: YES), an operation of adding 1 to opcode_sub_idx_value [i-1] is performed, and the calculated value is assigned to opcode_sub_idx_value [i] (step St54) ).

一方、opcode_length[i]がopcode_length[i-1]と異なるなら(ステップSt53:NO)、opcode_sub_idx_value[i]へ0を代入する(ステップSt55)。   On the other hand, if opcode_length [i] is different from opcode_length [i-1] (step St53: NO), 0 is assigned to opcode_sub_idx_value [i] (step St55).

次に、グループ・サブフィールドのビット幅にもとづいて命令を並び替える手順について説明する。命令iのグループ・サブフィールドの長さopcode_sub_grp_length[i]にもとづいて全ての命令を並び替える。並び替えられた後の命令の番号をnとする。最も多くのビットをグループ・サブフィールドに使用する命令の番号nを0、最も少ないビットをグループ・サブフィールドに使用する命令の番号nをS-1とする。   Next, a procedure for rearranging instructions based on the bit width of the group / subfield will be described. All instructions are rearranged based on the length opcode_sub_grp_length [i] of the group / subfield of the instruction i. The instruction number after the rearrangement is n. The instruction number n that uses the most bits in the group subfield is 0, and the instruction number n that uses the least bits in the group subfield is S-1.

次に、グループ・サブフィールドの値を決定する手順を以下に示す。この手順に対応するフローチャートを図14に示す。図14において、nは命令の番号を、Sは命令の総数を、opcode_value[n]は命令nのオペコードの値を、opcode_length[n]は命令nのオペコードのビット幅を、opcode_sub_grp_value[n]は命令nのグループ・サブフィールドの値を、opcode_sub_grp_length[n]は命令nのグループ・サブフィールドのビット幅を、それぞれ表す。   Next, the procedure for determining the value of the group subfield is shown below. A flowchart corresponding to this procedure is shown in FIG. 14, n is the instruction number, S is the total number of instructions, opcode_value [n] is the value of the opcode of instruction n, opcode_length [n] is the bit width of the opcode of instruction n, and opcode_sub_grp_value [n] is The value of the group subfield of the instruction n and the opcode_sub_grp_length [n] represent the bit width of the group subfield of the instruction n, respectively.

まず、opcode_sub_grp_value[0]へ0を代入する(ステップSt61)。   First, 0 is substituted into opcode_sub_grp_value [0] (step St61).

続いて、命令の番号nを1からS-1まで順番に変えながら、opcode_sub_grp_value[n]を以下のようにして決定する(ステップSt62〜St66)。   Subsequently, opcode_sub_grp_value [n] is determined as follows while sequentially changing the instruction number n from 1 to S-1 (steps St62 to St66).

ステップSt63において、opcode_length[n]がopcode_length[n-1]と同じかどうか判断する。   In step St63, it is determined whether opcode_length [n] is the same as opcode_length [n-1].

opcode_length[n]がopcode_length[n-1]と同じなら(ステップSt63:YES)、opcode_sub_grp_value[n-1]をopcode_sub_grp_value[n]へ代入する(ステップSt64)。   If opcode_length [n] is the same as opcode_length [n-1] (step St63: YES), opcode_sub_grp_value [n-1] is substituted into opcode_sub_grp_value [n] (step St64).

一方、opcode_length[n]がopcode_length[n-1]と異なるなら(ステップSt63:NO)、opcode_sub_grp_value[n]=((opcode_sub_grp_value[n-1]+1)<<(opcode_sub_grp_length[n]-opcode_sub_grp_length[n-1]))という計算式にもとづいてopcode_sub_grp_value[n]を求める(ステップSt65)。   On the other hand, if opcode_length [n] is different from opcode_length [n-1] (step St63: NO), opcode_sub_grp_value [n] = ((opcode_sub_grp_value [n-1] +1) << (opcode_sub_grp_length [n] -opcode_sub_grp_length [n] -1])) to obtain opcode_sub_grp_value [n] (step St65).

以上のようにして、各命令のオペコードの値を決定する。   As described above, the value of the operation code of each instruction is determined.

上記の第四のオペコード決定方法によるオペコード割り当ての例を図15から図18に示す。   Examples of operation code assignment by the fourth operation code determination method are shown in FIGS.

図15は14個の命令のビットパターンを表す(S=14)。図15において、Ra、Rb、Rcはレジスタの番号を表すオペランド・フィールドである。IMM6、IMM4、IMM2は数値を表すオペランド・フィールドである。各命令の語長は16ビットである(N=16)。命令ビットパターンのLSB側にオペランドを配置し、命令ビットパターンのMSB側にオペコードフィールドを配置する。   FIG. 15 shows the bit pattern of 14 instructions (S = 14). In FIG. 15, Ra, Rb, and Rc are operand fields representing register numbers. IMM6, IMM4, and IMM2 are operand fields representing numerical values. The word length of each instruction is 16 bits (N = 16). An operand is placed on the LSB side of the instruction bit pattern, and an opcode field is placed on the MSB side of the instruction bit pattern.

図15の命令を仕様データとして、それらの命令をopcode_length[i]にもとづいて並び替え、図13のステップSt51からSt57までの処理を実行すると図16が得られる。図16は図15の命令に対するインデックス・サブフィールドの値を表す。   When the instructions in FIG. 15 are used as specification data, the instructions are rearranged based on opcode_length [i], and the processing from steps St51 to St57 in FIG. 13 is executed, FIG. 16 is obtained. FIG. 16 shows the value of the index subfield for the instruction of FIG.

つづいて、インデックス・サブフィールドの値が求まった図16の命令を使って、それらの命令のグループ・サブフィールドのビット幅を求める。そして、グループ・サブフィールドのビット幅にもとづいて命令を並び替えると図17が得られる。   Subsequently, using the instructions of FIG. 16 in which the values of the index subfields are obtained, the bit widths of the group subfields of those instructions are obtained. Then, when the instructions are rearranged based on the bit width of the group / subfield, FIG. 17 is obtained.

つづいて、図17の命令に対して図14のステップSt61からステップSt67までの処理を実行すると図18が得られる。図18は図17の命令に対するグループ・サブフィールドの値を表す。以上の処理によって、各命令のインデックス・サブフィールドとグループ・サブフィールドの値が求まる。そして、インデックス・サブフィールドとグループ・サブフィールドとを連結したビット列がオペコードの値となる。   Next, FIG. 18 is obtained by executing the processing from step St61 to step St67 in FIG. 14 for the instruction in FIG. FIG. 18 shows group subfield values for the instruction of FIG. With the above processing, the values of the index subfield and group subfield of each instruction are obtained. A bit string obtained by concatenating the index subfield and the group subfield is an opcode value.

図18に示すように、グループ・サブフィールドの値opcode_sub_grp_value[i](i=0、…、13)と、インデックス・サブフィールドの値opcode_sub_idx_value[i](i=0、…、13)とで構成される各命令のオペコードの値は、他のどの命令のオペコードの値とも重複していない。したがって、このオペコード決定方法を使って、各命令をオペコードによって正しく識別することができる。   As shown in FIG. 18, it is composed of a group subfield value opcode_sub_grp_value [i] (i = 0,..., 13) and an index subfield value opcode_sub_idx_value [i] (i = 0,..., 13). The value of the opcode of each instruction to be executed does not overlap with the value of the opcode of any other instruction. Therefore, using this operation code determination method, each instruction can be correctly identified by the operation code.

第四のオペコード決定方法は、同じオペコードのビット幅をもつオペコードのグループを表すビット列と、そのグループの中における命令のインデックスを表すビット列とから構成される。これは、第二のオペコードと同じ特徴である。したがって、第二のオペコードと同様に、オペコードをデコードするのが簡単である。オペコードのデコード処理には引き算が必要無く、論理演算とシフト演算だけでオペコードをデコードできる。   The fourth operation code determination method is composed of a bit string representing a group of operation codes having the same operation code bit width and a bit string representing an instruction index in the group. This is the same feature as the second opcode. Therefore, it is easy to decode the operation code as with the second operation code. The operation code decoding process does not require subtraction, and the operation code can be decoded only by a logical operation and a shift operation.

さらに、第四のオペコード決定方法によって生成されたオペコードには、短いオペコードのグループ・サブフィールドが別の長いオペコードのグループ・サブフィールドに部分的に一致することがない、という特徴がある。これは第二のオペコード決定方法にはない特徴である。この特徴によって、第二のオペコード決定方法よりもデコード処理が簡単になる。   Further, the operation code generated by the fourth operation code determination method has a feature that a group subfield of a short operation code does not partially match a group subfield of another long operation code. This is a feature not found in the second operation code determination method. This feature makes the decoding process easier than the second operation code determination method.

すなわち、第二のオペコード決定方法で生成されたオペコードをデコードする際には、まず同じオペコードのビット幅をもつオペコードのグループを表すビット列をデコードし、最も長いビット列をもつグループを選択する必要がある。なぜなら、同じオペコードのビット幅をもつオペコードのグループを表すビット列が部分的に一致しているため、それらの中から最もふさわしいグループを選択しなければならないからである。第二のオペコード決定方法に比べて、第四のオペコード決定方法は、表現できるオペコードの種類が少ない。命令語長が24ビットや32ビットなどの場合には、この点はあまり問題にならないだろう。   That is, when decoding an operation code generated by the second operation code determination method, it is necessary to first decode a bit string representing a group of operation codes having the same operation code bit width and select a group having the longest bit string. . This is because the bit string representing the group of operation codes having the same operation code bit width partially matches, and the most suitable group must be selected from them. Compared to the second operation code determination method, the fourth operation code determination method has fewer types of operation codes that can be expressed. If the instruction word length is 24 bits or 32 bits, this will not be a problem.

次に、上記第一〜第四のオペコード決定方法のうち、何れのオペコード決定方法を選択するかについて説明する。   Next, it will be described which one of the first to fourth opcode determination methods is selected.

一般的には、デコード処理が簡単になるようなオペコード決定方法を選択するべきである。これまでに述べたオペコード決定方法の中では、第四のオペコード決定方法のデコード処理が最も容易である。もし、表現可能なオペコードの数を多くしたい場合には、第二のオペコード決定方法を選択してもよい。   In general, an opcode determination method that simplifies the decoding process should be selected. Of the opcode determination methods described so far, the decoding process of the fourth opcode determination method is the easiest. If it is desired to increase the number of opcodes that can be expressed, the second opcode determination method may be selected.

以上、本発明の実施例を詳細に説明したが、本発明は、代表的に例示した上述の実施例に限定されるものではなく、当業者であれば、特許請求の範囲の記載内容に基づき、本発明の要旨を逸脱しない範囲内で種々の態様に変形、変更、応用することができ、これらの変形例、変更例、応用例も本発明の権利範囲に属するものである。   As mentioned above, although the Example of this invention was described in detail, this invention is not limited to the above-mentioned Example illustrated typically, and those skilled in the art will be based on description content of a claim. Various modifications, changes, and applications can be made without departing from the spirit of the present invention, and these modifications, changes, and applications also belong to the scope of the right of the present invention.

[変形例]
これまでに述べた実施例では、命令のビットパターンのMSB側にオペコードが配置される。しかし、オペコードの位置はMSB側である必要はない。命令のビットパターンのLSB側にオペコードを配置してもよい。あるいは、命令のビットパターンの中間的な位置にオペコードを配置してもよい。あるいは、オペコードをいくつかの断片に分けて命令のビットパターンの中に配置してもよい。
[Modification]
In the embodiments described so far, the operation code is arranged on the MSB side of the bit pattern of the instruction. However, the opcode position need not be on the MSB side. An opcode may be placed on the LSB side of the instruction bit pattern. Alternatively, the operation code may be arranged at an intermediate position of the instruction bit pattern. Alternatively, the opcode may be divided into several pieces and arranged in the bit pattern of the instruction.

[応用例]
本発明の実施例を特許文献3にあるようなプロセッサのハードウェア構成生成ツールやソフトウェア開発ツール生成ツールに応用することも可能である。こうしたツールはプロセッサの仕様からハードウェア構成あるいはソフトウェア開発ツールを生成する。プロセッサの仕様には命令セットの仕様も含まれる。特許文献3では命令セットの仕様にオペコードのビット幅や値が含まれていたが、本発明の実施例を使えばオペコードのビット幅と値を自動的に決定することができる。そして決定されたオペコードを正しくデコードしたりエンコードしたりするためのハードウェア構成やソフトウェア開発ツールを生成するといった応用も可能になる。
[Application example]
The embodiment of the present invention can also be applied to a processor hardware configuration generation tool and a software development tool generation tool as disclosed in Patent Document 3. These tools generate hardware configurations or software development tools from processor specifications. Processor specifications include instruction set specifications. In Patent Document 3, the bit width and value of the operation code are included in the specification of the instruction set. However, if the embodiment of the present invention is used, the bit width and value of the operation code can be automatically determined. Then, it is possible to apply a hardware configuration and software development tool for correctly decoding and encoding the determined opcode.

本発明の実施例に係る命令オペコード生成システムを構成する各手段の少なくとも一部の機能を、コンピュータのプログラムコードを用いて実現する場合、かかるプログラムコード及びこれを記録するコンピュータ読み取り可能な記録媒体は、本発明の範疇に含まれる。この場合のプログラムコードは、上記の機能をコンピュータに実現させるものであればよい。例えば、オペレーティングシステム(OS)等の他のプログラムコードと連携して上記の機能が実現されてもよい。また、このようなプログラムコードを記録するコンピュータ読み取り可能な記録媒体としては、例えばROM(read only memory)等の半導体メモリ、ディスク型の記録媒体(ハードディスク等の磁気ディスク、光ディスク、光磁気ディスク等)、テープ型の記録媒体等、いずれの形態の記録媒体でも適用可能である。   When realizing at least a part of functions of each means constituting the instruction opcode generation system according to the embodiment of the present invention using a program code of a computer, the program code and a computer-readable recording medium for recording the program code are as follows: Are included in the scope of the present invention. The program code in this case may be any program code that allows a computer to realize the above functions. For example, the above functions may be realized in cooperation with other program codes such as an operating system (OS). Moreover, as a computer-readable recording medium for recording such a program code, for example, a semiconductor memory such as a ROM (read only memory), a disk type recording medium (a magnetic disk such as a hard disk, an optical disk, a magneto-optical disk, etc.) Any type of recording medium such as a tape-type recording medium can be applied.

また、本発明の実施例に係る命令オペコード生成システムを構成するプログラムコードの命令を実行するコンピュータ機についても、本発明の範疇に含まれる。このコンピュータ機は、プログラム制御で動作するプロセッサ(CPU)と、制御プログラムや制御データ等を格納する記憶領域を有するメモリと、各種入出力装置(例えば、ハードディスク等の外部記録装置、通信モデムやLAN(local area network)インタフェース等の通信装置、CRT(cathode ray tube)や液晶ディスプレイ等の表示装置、キーボードやマウス等の入力装置等の各種周辺装置の少なくとも一部とを用いて実現することが可能である。この場合、上記各手段の機能を実現するために用いられるプロセッサ、メモリ、及び各種入出力装置は、本発明の範疇に含まれる。このコンピュータ機は、スタンドアロン型のものでも、ネットワークに通信可能に接続された複数のコンピュータ機から構成されるものでも、いずれの形態でも適用可能である。   In addition, a computer that executes an instruction of a program code constituting the instruction opcode generation system according to the embodiment of the present invention is also included in the scope of the present invention. This computer machine includes a processor (CPU) operating under program control, a memory having a storage area for storing control programs and control data, and various input / output devices (for example, external recording devices such as hard disks, communication modems and LANs). (Local area network) interface and other communication devices, display devices such as CRT (cathode ray tube) and liquid crystal display, and at least some of various peripheral devices such as keyboard and mouse input devices. In this case, a processor, a memory, and various input / output devices used for realizing the functions of the above means are included in the scope of the present invention. Either a computer that is communicably connected or any form is suitable. Is available.

この出願は、2006年11月21日に出願された日本出願特願2006−314260号を基礎とする優先権を主張し、その開示の全てをここに取り込む。   This application claims the priority on the basis of Japanese application Japanese Patent Application No. 2006-314260 for which it applied on November 21, 2006, and takes in those the indications of all here.

本発明を使用すれば、命令セットの仕様記述から各命令のオペコードを自動的に生成することができる。プロセッサの仕様記述からプロセッサのハードウェア記述を生成するようなシステムにおいて本発明を使用することが可能である。あるいは、命令セットの使用記述からアセンブラやコンパイラなどのソフトウェア開発ツールを生成するようなシステムにおいても本発明を使用することが可能である。   By using the present invention, it is possible to automatically generate an operation code of each instruction from the specification description of the instruction set. The present invention can be used in a system that generates a processor hardware description from a processor specification description. Alternatively, the present invention can be used in a system that generates a software development tool such as an assembler or a compiler from an instruction set usage description.

Claims (16)

プロセッサの命令セットに関する仕様データにもとづいて、前記命令セットの各命令のオペコードに割り当てるビット幅を決めるオペコードビット幅決定手段と、
前記オペコードのビット幅にしたがって前記各命令を並び替える命令分類手段と、
前記各命令のビット幅及び並び順番にもとづいて、その各命令のオペコードの値を決定するオペコード値決定手段と、
を備えることを特徴とする命令オペコード生成システム。
An operation code bit width determining means for determining a bit width to be assigned to an operation code of each instruction of the instruction set based on specification data relating to the instruction set of the processor;
Instruction classification means for rearranging the instructions according to the bit width of the opcode;
Opcode value determining means for determining the value of the opcode of each instruction based on the bit width and arrangement order of each instruction;
An instruction opcode generation system comprising:
請求項1に記載の命令オペコード生成システムであって、
前記仕様データを解釈するための仕様データ解析手段と、
前記仕様データ解析手段と前記オペコードビット幅決定手段と前記命令分類手段と前記オペコード値決定手段とが出力するデータを記憶するための中間データ記憶手段と、
をさらに備えることを特徴とする命令オペコード生成システム。
The instruction opcode generation system according to claim 1,
Specification data analysis means for interpreting the specification data;
Intermediate data storage means for storing data output by the specification data analysis means, the operation code bit width determination means, the instruction classification means, and the operation code value determination means;
An instruction opcode generation system further comprising:
請求項2に記載の命令オペコード生成システムにおいて、
前記オペコード値決定手段は、
前記オペコードを二つのサブフィールドで構成してそれぞれのサブフィールドの値を前記各命令のビット幅及び並び順番にもとづいて決定する手段、
を備えることを特徴とする命令オペコード生成システム。
The instruction opcode generation system according to claim 2,
The opcode value determining means includes
Means for determining the value of each subfield based on the bit width and arrangement order of each instruction, comprising the opcode in two subfields;
An instruction opcode generation system comprising:
請求項2または請求項3に記載の命令オペコード生成システムであって、
前記プロセッサの命令セットに関する仕様データには、命令の語長と、命令がもつオペランドの個数と、各オペランドのビット幅と、が含まれ、
前記オペコード値決定手段は、前記命令の語長と、前記命令がもつオペランドの個数と、前記各オペランドのビット幅とを含む前記プロセッサの命令セットに関する仕様データにもとづいて、各命令のオペコードを決定することを特徴とする命令オペコード生成システム。
An instruction opcode generation system according to claim 2 or claim 3,
The specification data regarding the instruction set of the processor includes the word length of the instruction, the number of operands included in the instruction, and the bit width of each operand.
The opcode value determining means determines an opcode of each instruction based on specification data relating to the instruction set of the processor including a word length of the instruction, the number of operands of the instruction, and a bit width of each operand. An instruction opcode generation system characterized by:
請求項4に記載の命令オペコード生成システムにおいて、
前記命令の番号をkとし、前記命令の総数をSとし、前記命令の語長をNとし、前記命令kの全てのオペランドを表すために使用するビットパターンの幅total_operands_length[k]とし、前記命令kのオペコードフィールドの長さをopcode_length[k]ビットとし、前記命令kのオペコードフィールドの値をopcode_value[k]とし、前記オペコードフィールドの長さがxビットである命令の数をnum_of_inst_having_opcode_length(x)とし、値x以上の2のべき乗の最小値をmin_power_of_2(x)としたとき、
前記オペコードビット幅決定手段は、前記命令kのオペコードフィールドのビット幅opcode_length[k]を、
opcode_length[k]=N-total_operands_length[k](k=0,1,...,S-1)
により求め、
前記命令分類手段は、前記命令kの全てのオペランドを表すために使用するビットパターンの幅total_operands_length[k]にもとづいて全ての前記命令を並び替え、
並び替えられた後の前記命令の番号をiとし、最も多くのビットをオペランドに使用する命令の番号iを0とし、最も少ないビットをオペランドに使用する命令の番号iをS-1としたとき、
前記オペコード値決定手段は、0番目の命令からS-1番目の命令まで順番に命令iのオペコードフィールドの値opcode_value[i]を決定する、ことを特徴とする命令オペコード生成システム。
The instruction opcode generation system according to claim 4,
The instruction number is k, the total number of instructions is S, the word length of the instruction is N, the width of the bit pattern used to represent all operands of the instruction k, total_operands_length [k], and the instruction The length of the opcode field of k is opcode_length [k] bits, the value of the opcode field of the instruction k is opcode_value [k], and the number of instructions whose length of the opcode field is x bits is num_of_inst_having_opcode_length (x) , Where min_power_of_2 (x) is the minimum power of 2 greater than or equal to value x
The opcode bit width determining means sets the bit width opcode_length [k] of the opcode field of the instruction k,
opcode_length [k] = N-total_operands_length [k] (k = 0,1, ..., S-1)
Sought by
The instruction classification means rearranges all the instructions based on a bit pattern width total_operands_length [k] used to represent all operands of the instruction k,
When the number of the instruction after the rearrangement is i, the number i of the instruction that uses the most bits as the operand is 0, and the number i of the instruction that uses the fewest bits as the operand is S-1. ,
The opcode value determining means determines an opcode field value opcode_value [i] of an instruction i in order from the 0th instruction to the (S-1) th instruction.
請求項5に記載の命令オペコード生成システムにおいて、
前記命令iのオペコードフィールドの値opcode_value[i]を決定する手段は、
opcode_value[0]へ0を代入後、前記命令の番号iを1からS-1まで順番に変えながら、opcode_value[i]を、
opcode_value[i]=((opcode_value[i-1]+1)<<(opcode_length[i]-opcode_length[i-1]))
により決定することを特徴とする命令オペコード生成システム。
The instruction opcode generation system according to claim 5,
The means for determining the opcode field value opcode_value [i] of the instruction i is:
After substituting 0 for opcode_value [0], changing the instruction number i in order from 1 to S-1, opcode_value [i]
opcode_value [i] = ((opcode_value [i-1] +1) << (opcode_length [i] -opcode_length [i-1]))
An instruction opcode generation system characterized by being determined by:
請求項5に記載の命令オペコード生成システムにおいて、
前記命令iのオペコードフィールドの値opcode_value[i]を決定する手段は、
opcode_value[0]へ0を代入後、前記命令の番号iを1からS-1まで順番に変えながら、opcode_value[i]を、
(1)opcode_length[i]がopcode_length[i-1]と同じときに、opcode_value[i]=opcode_value[i-1]+1により決定し、
(2)opcode_length[i]がopcode_length[i-1]と異なるときに、
(1<<(opcode_length[i]-opcode_length[i-1]))と、命令iと同じオペコード長をもつ命令の数以上の最小の2のべき乗min_power_of_2(num_of_inst_having_opcode_length(opcode_length[i]))との大きい方の値をZとして、opcode_value[i]=((opcode_value[i-1]<<(opcode_length[i]-opcode_length[i-1]))+Z)&((Z-1))により決定することを特徴とする命令オペコード生成システム。
The instruction opcode generation system according to claim 5,
The means for determining the opcode field value opcode_value [i] of the instruction i is:
After substituting 0 for opcode_value [0], changing the instruction number i in order from 1 to S-1, opcode_value [i]
(1) When opcode_length [i] is the same as opcode_length [i-1], it is determined by opcode_value [i] = opcode_value [i-1] +1,
(2) When opcode_length [i] is different from opcode_length [i-1]
(1 << (opcode_length [i] -opcode_length [i-1])) and the minimum power of 2 min_power_of_2 (num_of_inst_having_opcode_length (opcode_length [i])) equal to or greater than the number of instructions having the same opcode length as the instruction i The larger value is Z, and opcode_value [i] = ((opcode_value [i-1] << (opcode_length [i] -opcode_length [i-1])) + Z) & ( ~ (Z-1)) An instruction opcode generation system characterized by determining.
請求項5に記載の命令オペコード生成システムにおいて、
前記命令iのオペコードフィールドの値opcode_value[i]を決定する手段は、
opcode_value[0]へ0を代入後、命令の番号iを1からS-1まで順番に変えながら、opcode_value[i]を、
(1)opcode_length[i]がopcode_length[i-1]と同じときに、opcode_value[i]=opcode_value[i-1]+1により決定し、
(2)opcode_length[i]がopcode_length[i-1]と異なるときに、命令iと同じオペコード長をもつ命令の数以上の最小の2のべき乗(min_power_of_2(num_of_inst_having_opcode_length(opcode_length[i-1]))をZとして、opcode_value[i]=((opcode_value[i-1]+Z)<<(opcode_length[i]-opcode_length[i-1]))により決定することを特徴とする命令オペコード生成システム。
The instruction opcode generation system according to claim 5,
The means for determining the opcode field value opcode_value [i] of the instruction i is:
After substituting 0 for opcode_value [0], changing the instruction number i from 1 to S-1 in order, opcode_value [i]
(1) When opcode_length [i] is the same as opcode_length [i-1], it is determined by opcode_value [i] = opcode_value [i-1] +1,
(2) When opcode_length [i] is different from opcode_length [i-1], the minimum power of 2 equal to or more than the number of instructions having the same opcode length as instruction i (min_power_of_2 (num_of_inst_having_opcode_length (opcode_length [i-1])) Is an instruction opcode generation system, which is determined by opcode_value [i] = ((opcode_value [i-1] + Z) << (opcode_length [i] -opcode_length [i-1])).
請求項5に記載の命令オペコード生成システムにおいて、
前記オペコードフィールドはグループ・サブフィールドとインデックス・サブフィールドとに区分され、
前記命令iのオペコードフィールドの値opcode_value[i]を決定する手段は、前記インデックス・サブフィールドの値を決定する手段と、前記グループ・サブフィールドの値を決定する手段とを有し、
前記命令iのインデックス・サブフィールドの長さをopcode_sub_idx_length[i]とし、前記命令iのインデックス・サブフィールドの値をopcode_sub_idx_value[i]とし、全ての命令についてインデックス・サブフィールドの長さをopcode_sub_idx_length[i]=min_power_of_2(num_of_inst_having_opcode_length(opcode_length[i]))とし、前記命令iのグループ・サブフィールドの長さをopcode_sub_grp_length[i]とし、前記命令iのグループ・サブフィールドの値をopcode_sub_grp_value[i]とし、全ての命令についてグループ・サブフィールドの長さを opcode_sub_grp_length[i]=opcode_length[i]-opcode_sub_idx_length[i]としたとき、
前記インデックス・サブフィールドの値を決定する手段は、
opcode_sub_idx_value[0]へ0を代入後、命令の番号iを1からS-1まで順番に変えながら、opcode_sub_idx_value[i]を、
(1)opcode_length[i]がopcode_length[i-1]と同じときに、opcode_sub_idx_value[i]=opcode_sub_idx_value[i-1]+1により決定し、
(2)opcode_length[i]がopcode_length[i-1]と異なるときに、opcode_sub_idx_value[i]=0により決定し、
前記命令iのグループ・サブフィールドの長さopcode_sub_grp_length[i]にもとづいて全ての前記命令を並び替え、並び替えられた後の前記命令の番号をnとし、最も多くのビットをグループ・サブフィールドに使用する命令の番号nを0とし、最も少ないビットをグループ・サブフィールドに使用する命令の番号nをS-1とし、
前記グループ・サブフィールドの値を決定する手段は、
opcode_sub_grp_value[0]へ0を代入後、命令の番号nを1からS-1まで順番に変えながら、opcode_sub_grp_value[n]を、
(1)opcode_length[n]がopcode_length[n-1]と同じときに、
opcode_sub_grp_value[n]=opcode_sub_grp_value[n-1]により決定し、
(2)opcode_length[n]がopcode_length[n-1]と異なるときに、
opcode_sub_grp_value[n]=((opcode_sub_grp_value[n-1]+1)<<(opcode_sub_grp_length[n]-opcode_sub_grp_length[n-1]))により決定することを特徴とする命令オペコード生成システム。
The instruction opcode generation system according to claim 5,
The opcode field is divided into a group subfield and an index subfield.
The means for determining the opcode field value opcode_value [i] of the instruction i includes means for determining the value of the index subfield, and means for determining the value of the group subfield.
The length of the index subfield of the instruction i is opcode_sub_idx_length [i], the value of the index subfield of the instruction i is opcode_sub_idx_value [i], and the length of the index subfield for all instructions is opcode_sub_idx_length [i]. ] = min_power_of_2 (num_of_inst_having_opcode_length (opcode_length [i])) When the length of the group subfield is set to opcode_sub_grp_length [i] = opcode_length [i] -opcode_sub_idx_length [i]
The means for determining the value of the index subfield is:
After assigning 0 to opcode_sub_idx_value [0], changing the instruction number i from 1 to S-1 in order, opcode_sub_idx_value [i]
(1) When opcode_length [i] is the same as opcode_length [i-1], it is determined by opcode_sub_idx_value [i] = opcode_sub_idx_value [i-1] +1,
(2) When opcode_length [i] is different from opcode_length [i-1], it is determined by opcode_sub_idx_value [i] = 0,
All the instructions are rearranged based on the length opcode_sub_grp_length [i] of the group subfield of the instruction i, and the number of the instruction after the rearrangement is n, and the most bits are assigned to the group subfield. The instruction number n used is 0, the instruction number n that uses the least number of bits in the group subfield is S-1,
The means for determining the value of the group subfield is:
After assigning 0 to opcode_sub_grp_value [0], changing the instruction number n in order from 1 to S-1, changing the opcode_sub_grp_value [n]
(1) When opcode_length [n] is the same as opcode_length [n-1]
determined by opcode_sub_grp_value [n] = opcode_sub_grp_value [n-1]
(2) When opcode_length [n] is different from opcode_length [n-1]
An instruction opcode generation system characterized by opcode_sub_grp_value [n] = ((opcode_sub_grp_value [n-1] +1) << (opcode_sub_grp_length [n] -opcode_sub_grp_length [n-1])).
プロセッサの命令に関する仕様データにもとづいて、そのプロセッサのハードウェア構成定義又はソフトウェア開発ツールを生成するシステムであって、
請求項1から9のいずれかに記載の命令オペコード生成システムを用いて、前記プロセッサの命令セットに関する仕様データにもとづいて、前記命令セットを構成する各命令のオペコードの値を決定することを特徴とするシステム。
A system for generating a hardware configuration definition or software development tool for a processor based on specification data relating to a processor instruction,
The instruction opcode generation system according to any one of claims 1 to 9, wherein an operation code value of each instruction constituting the instruction set is determined based on specification data relating to the instruction set of the processor. System.
プロセッサの命令セットに関する仕様データにもとづいて、
前記仕様データを解釈するための仕様データ解析ステップと、
前記命令セットの各命令のオペコードに割り当てるビット幅を決めるステップと、
前記オペコードのビット幅にしたがって前記各命令を並び替えるステップと、
前記各命令のビット幅及び並び順番にもとづいて、その各命令のオペコードの値を決定するステップと、
を備えることを特徴とする命令オペコード生成方法。
Based on the specification data about the processor instruction set,
A specification data analysis step for interpreting the specification data;
Determining a bit width to be assigned to an operation code of each instruction of the instruction set;
Rearranging the instructions according to the bit width of the opcode;
Determining an opcode value for each instruction based on the bit width and order of each instruction;
An instruction opcode generation method comprising:
請求項11に記載の命令オペコード生成方法において、
前記オペコード値決定ステップは、
前記オペコードを二つのサブフィールドで構成してそれぞれのサブフィールドの値を前記各命令のビット幅及び並び順番にもとづいて決定するステップと、
を備えることを特徴とする命令オペコード生成方法。
The instruction opcode generation method according to claim 11,
The opcode value determining step includes:
The opcode is composed of two subfields, and the value of each subfield is determined based on the bit width and arrangement order of each instruction;
An instruction opcode generation method comprising:
請求項11または請求項12に記載の命令オペコード生成方法であって、
前記プロセッサの命令セットに関する仕様データには、命令の語長と、命令がもつオペランドの個数と、各オペランドのビット幅と、が含まれ、
前記オペコード値決定ステップは、前記命令の語長と、前記命令がもつオペランドの個数と、前記各オペランドのビット幅とを含む前記プロセッサの命令セットに関する仕様データにもとづいて、各命令のオペコードを決定することを特徴とする命令オペコード生成方法。
An instruction opcode generation method according to claim 11 or claim 12,
The specification data regarding the instruction set of the processor includes the word length of the instruction, the number of operands included in the instruction, and the bit width of each operand.
The opcode value determining step determines an opcode of each instruction based on specification data relating to the instruction set of the processor including a word length of the instruction, the number of operands of the instruction, and a bit width of each operand. An instruction opcode generation method characterized by:
請求項11から請求項13のいずれかに記載の命令オペコード生成方法をコンピュータに実行させることを特徴とする命令オペコード生成プログラム。   An instruction opcode generation program that causes a computer to execute the instruction opcode generation method according to any one of claims 11 to 13. プロセッサの命令に関する仕様データにもとづいて、そのプロセッサのハードウェア構成定義又はソフトウェア開発ツールをコンピュータに生成させるプログラムであって、
請求項14に記載の命令オペコード生成プログラムを用いて、前記プロセッサの命令セットに関する仕様データにもとづいて、前記命令セットを構成する各命令のオペコードの値を決定することを特徴とするプログラム。
A program that causes a computer to generate a hardware configuration definition or a software development tool for a processor based on specification data relating to a processor instruction,
15. A program that uses the instruction opcode generation program according to claim 14 to determine an opcode value of each instruction that constitutes the instruction set based on specification data relating to the instruction set of the processor.
請求項3に記載の命令オペコード生成システムにおいて、The instruction opcode generation system according to claim 3,
前記オペコード値決定手段は、複数の前記命令の中に、同じオペコードビット幅を有する命令が存在する数にもとづいて、前記命令の各サブフィールドの長さを決めることを特徴とする命令オペコード生成システム。The operation code value determination means determines the length of each subfield of the instruction based on the number of instructions having the same operation code bit width among the plurality of instructions. .
JP2008545398A 2006-11-21 2007-11-19 Instruction opcode generation system Expired - Fee Related JP5218063B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008545398A JP5218063B2 (en) 2006-11-21 2007-11-19 Instruction opcode generation system

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
JP2006314260 2006-11-21
JP2006314260 2006-11-21
JP2008545398A JP5218063B2 (en) 2006-11-21 2007-11-19 Instruction opcode generation system
PCT/JP2007/072413 WO2008062768A1 (en) 2006-11-21 2007-11-19 Command operation code generation system

Publications (2)

Publication Number Publication Date
JPWO2008062768A1 JPWO2008062768A1 (en) 2010-03-04
JP5218063B2 true JP5218063B2 (en) 2013-06-26

Family

ID=39429698

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008545398A Expired - Fee Related JP5218063B2 (en) 2006-11-21 2007-11-19 Instruction opcode generation system

Country Status (6)

Country Link
US (1) US8935512B2 (en)
EP (1) EP2096533A4 (en)
JP (1) JP5218063B2 (en)
CN (1) CN101542434A (en)
TW (1) TWI381309B (en)
WO (1) WO2008062768A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI513282B (en) * 2013-11-21 2015-12-11 Mstar Semiconductor Inc Cache managing device and motion picture system and method utilizing the same
US10831502B2 (en) 2018-11-06 2020-11-10 International Business Machines Corporation Migration of partially completed instructions
US10831478B2 (en) * 2018-11-06 2020-11-10 International Business Machines Corporation Sort and merge instruction for a general-purpose processor
US10831503B2 (en) 2018-11-06 2020-11-10 International Business Machines Corporation Saving and restoring machine state between multiple executions of an instruction
CN111258633B (en) * 2018-11-30 2022-08-09 上海寒武纪信息科技有限公司 Multiplier, data processing method, chip and electronic equipment
CN110007962A (en) * 2019-03-08 2019-07-12 浙江大学 A kind of instruction-set simulation method based on Code automatic build
CN113656071B (en) * 2021-10-18 2022-02-08 深圳市智想科技有限公司 RISC architecture based CPU instruction set system and CPU system

Family Cites Families (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03271829A (en) * 1990-03-20 1991-12-03 Fujitsu Ltd Information processor
EP0950946B1 (en) * 1993-11-05 2001-08-16 Intergraph Corporation Software scheduled superscaler computer architecture
US5493508A (en) * 1994-06-01 1996-02-20 Lsi Logic Corporation Specification and design of complex digital systems
US5636352A (en) * 1994-12-16 1997-06-03 International Business Machines Corporation Method and apparatus for utilizing condensed instructions
US5809273A (en) * 1996-01-26 1998-09-15 Advanced Micro Devices, Inc. Instruction predecode and multiple instruction decode
GB2308470B (en) * 1995-12-22 2000-02-16 Nokia Mobile Phones Ltd Program memory scheme for processors
US6862563B1 (en) 1998-10-14 2005-03-01 Arc International Method and apparatus for managing the configuration and functionality of a semiconductor design
US6477683B1 (en) 1999-02-05 2002-11-05 Tensilica, Inc. Automated processor generation system for designing a configurable processor and method for the same
KR100874738B1 (en) 1999-02-05 2008-12-22 텐실리카 인코포레이티드 Automated processor generation system for designing a configurable processor and method for the same
US6385757B1 (en) * 1999-08-20 2002-05-07 Hewlett-Packard Company Auto design of VLIW processors
US6457173B1 (en) * 1999-08-20 2002-09-24 Hewlett-Packard Company Automatic design of VLIW instruction formats
US7036106B1 (en) * 2000-02-17 2006-04-25 Tensilica, Inc. Automated processor generation system for designing a configurable processor and method for the same
US7051189B2 (en) * 2000-03-15 2006-05-23 Arc International Method and apparatus for processor code optimization using code compression
US7069420B1 (en) * 2000-09-28 2006-06-27 Intel Corporation Decode and dispatch of multi-issue and multiple width instructions
US6948051B2 (en) * 2001-05-15 2005-09-20 International Business Machines Corporation Method and apparatus for reducing logic activity in a microprocessor using reduced bit width slices that are enabled or disabled depending on operation width
JP2003241975A (en) * 2002-02-21 2003-08-29 Matsushita Electric Ind Co Ltd Compiler device and semiconductor integrated circuit
JP2003288203A (en) * 2002-03-27 2003-10-10 Asahi Kasei Corp Processor development support device
JP4202673B2 (en) 2002-04-26 2008-12-24 株式会社東芝 System LSI development environment generation method and program thereof
US7162617B2 (en) * 2003-02-14 2007-01-09 Fine Arc Incorporated Data processor with changeable architecture
US7299460B2 (en) * 2003-05-29 2007-11-20 Nec Corporation Method and computer program for converting an assembly language program for one processor to another
JP2005293448A (en) 2004-04-05 2005-10-20 Renesas Technology Corp Development method of data processor, development support program of data processor, providing method of design data, and development method of data processing system
JP4464316B2 (en) 2005-05-13 2010-05-19 明治乳業株式会社 Method for suppressing crystallization of tyrosine-containing beverage
US20070038984A1 (en) * 2005-08-12 2007-02-15 Gschwind Michael K Methods for generating code for an architecture encoding an extended register specification
JP2007122626A (en) * 2005-10-31 2007-05-17 Matsushita Electric Ind Co Ltd Microprocessor

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
JPN6012043689; L. Benini et al.: 'Automatic selection of instruction op-codes of low-power core processors' IEE Proceedings Computers & Digital Techniques Vol 146,Issue 4, 199907, pp.173-178, IEEE *
JPN7012003466; Achim Nohl et al.: 'Instruction Encoding Synthesis for Architecture Exploration using Hierarchical Processor Models' DAC 03 Proceedings of the 40th annual Design Automation Conference , 20030606, pp.262-267, ACM *

Also Published As

Publication number Publication date
TW200839610A (en) 2008-10-01
JPWO2008062768A1 (en) 2010-03-04
US8935512B2 (en) 2015-01-13
EP2096533A4 (en) 2011-06-22
EP2096533A1 (en) 2009-09-02
WO2008062768A1 (en) 2008-05-29
US20100037039A1 (en) 2010-02-11
TWI381309B (en) 2013-01-01
CN101542434A (en) 2009-09-23

Similar Documents

Publication Publication Date Title
JP5218063B2 (en) Instruction opcode generation system
Agerwala Microprogram optimization: A survey
JP5646737B2 (en) Conditional comparison instructions
US5918035A (en) Method for processor modeling in code generation and instruction set simulation
US7383422B2 (en) Very long instruction word (VLIW) computer having an efficient instruction code format
CN101111834A (en) Dynamically reconfigurable processor
JPH096609A (en) Program execution device and program conversion method
US5964861A (en) Method for writing a program to control processors using any instructions selected from original instructions and defining the instructions used as a new instruction set
JP3246438B2 (en) Variable target compilation processing method, its processing device, storage medium for its program, and storage medium for conversion table
KR20010024576A (en) Method for the generation of ISA simulators and assemblers from a machine description
JPH0877221A (en) System and method for designing of finite-state machine for reduction of power consumption
JP2001005675A (en) Program converter and processor
US7111278B1 (en) Automated translation of a microprocessor opcode summary table to an architecture description language
Britton MIPS assembly language programming
US8645758B2 (en) Determining page faulting behavior of a memory operation
JP7295469B2 (en) Function generation program, function generation method, and information processing device
JP5399601B2 (en) Implementation code development system and implementation code development program
CN104126169A (en) Systems, apparatuses and methods for performing absolute difference calculation between corresponding packed data elements of two vector registers
JP4721975B2 (en) Compiler device and compiling method
JP3464019B2 (en) Register allocation method
Harper Stream fusion on Haskell Unicode strings
Zimmermann On the correctness of transformations in compiler back-ends
JP2006079494A (en) Compiler
JP2831697B2 (en) Architecture synthesis equipment
JP6243619B2 (en) Program analysis apparatus and program analysis method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20101015

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20101019

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20101019

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120821

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20121017

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20121121

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130111

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20130205

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130218

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

Free format text: PAYMENT UNTIL: 20160315

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees