WO2008062768A1 - Système de génération de code d'opération de commande - Google Patents

Système de génération de code d'opération de commande Download PDF

Info

Publication number
WO2008062768A1
WO2008062768A1 PCT/JP2007/072413 JP2007072413W WO2008062768A1 WO 2008062768 A1 WO2008062768 A1 WO 2008062768A1 JP 2007072413 W JP2007072413 W JP 2007072413W WO 2008062768 A1 WO2008062768 A1 WO 2008062768A1
Authority
WO
WIPO (PCT)
Prior art keywords
opcode
instruction
value
length
operation code
Prior art date
Application number
PCT/JP2007/072413
Other languages
English (en)
French (fr)
Inventor
Takahiro Kumura
Original Assignee
Nec Corporation
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 Corporation filed Critical Nec Corporation
Priority to JP2008545398A priority Critical patent/JP5218063B2/ja
Priority to US12/515,439 priority patent/US8935512B2/en
Priority to EP07832143A priority patent/EP2096533A4/en
Publication of WO2008062768A1 publication Critical patent/WO2008062768A1/ja

Links

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

Definitions

  • 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.
  • processor design tool One such tool is a tool that generates processor hardware configuration and software development tools from processor design specifications. Such a tool is referred to here as a “processor design tool”.
  • 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.
  • Non-Patent Documents 1 and 2 and Patent Documents 1 to 3 Conventional processor design tools are introduced in Non-Patent Documents 1 and 2 and Patent Documents 1 to 3.
  • the tool of Non-Patent Document 1 can define a processor instruction set and generate a simulator for the processor.
  • the bit pattern of the instruction is defined as follows.
  • the part surrounded by ' ⁇ ' and ' ⁇ ' represents a bit pattern.
  • Dest, Srcl, and Src2 represent register numbers, respectively.
  • Subsequent ObOlOOOO and OblOOOO are binary numbers representing instruction opcodes. In this way, the designer must define all the information that makes up 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 opcode of the instruction many times. [0006] If there is no need to define or modify the instruction opcode, the number of items defined by the designer is reduced. The opcode need only be defined so that it can identify each instruction that does not matter what value the opcode has. If the instruction opcodes can be automatically defined, the number of items defined by the designer is reduced, leading to improved design efficiency.
  • Non-Patent Document 1 Pees, et al., "LI3 ⁇ 4A-Machine Description Language for Cycle- Accurate Models of Programmable DSP Architectures, 06th Design Automation and onfer ence (DAC 99), June 1999, pp. 933-938.
  • Non-Patent Document 2 Andreas Hoffmann, et al., T Survey on Modeling Issues Using the Machine Description Language Lisa, "Proceedings of ICASSP 2001, Vol. 2, pp. 1137-1140, May 7-11 2001.
  • Patent Document 1 US Pat. No. 6,477,683
  • Patent Document 2 US Patent No. 6862563
  • Patent Document 3 JP 2003-518280
  • Patent Document 4 Japanese Unexamined Patent Publication No. 2003-323463
  • the conventional instruction set generation tool has a problem that the operation of defining the operation code of the instruction is required, and the efficiency is bad. 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 enter.
  • 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 of the designer on instruction set review.
  • the purpose is to reduce.
  • an instruction opcode generation system is an operation that determines a bit width to be assigned to an operation code of each instruction of the instruction set based on specification data related to the instruction set of the processor.
  • a system according to the present invention is a system for generating a hardware configuration definition or a software development tool for a processor based on specification data related to a processor instruction, the instruction opcode generating system described above. Is used to determine the value of the operation code of each instruction constituting the instruction set.
  • the instruction opcode generation method includes a specification data analysis step for interpreting the specification data based on the specification data related to the instruction set of the processor, and an operation code of each instruction of the instruction set. Determining a bit width to be allocated; classifying each instruction according to the bit width of the opcode; and determining an opcode value for each instruction based on the classification of each instruction. It is characterized by having.
  • the value of the opcode 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 opcode. Work efficiency can be improved, and the burden on the designer in examining the instruction set can be reduced.
  • FIG. 1 is a diagram showing an instruction opcode generation system according to a first embodiment of the present invention.
  • FIG. 2 is a diagram showing an instruction opcode generation system according to a second embodiment of the present invention.
  • FIG. 3 is a flowchart of an operation code assignment method in an embodiment of the present invention.
  • FIG. 4 (a) is a diagram showing a method of placing an opcode on the MSB side of an instruction bit pattern, and (b) is a diagram showing a method of placing an opcode on the LSB side of an instruction bit pattern.
  • FIG. 5 is a flowchart of a first opcode determination method.
  • FIG. 7 An example of opcode assignment by the first opcode determination method.
  • FIG. 8 is a flowchart of a second operation code determination method.
  • FIG. 9 An example of opcode assignment by the second opcode determination method.
  • FIG. 10 is a flowchart of a third operation code determination method.
  • FIG. 11 An example of opcode assignment by the third opcode determination method.
  • FIG. 12 is a flowchart of a fourth opcode determination method.
  • FIG. 13 is a flowchart of the fourth opcode determination method index.subfield determination method.
  • FIG. 17 shows an example of an instruction after rearranging instructions based on the bit width of the group.subfield in the fourth opcode determination method.
  • FIG.18 This is an example of group / subfield assignment by the fourth opcode determination method.
  • 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 is based on the specification data related to the processor instruction set, the specification data analysis means 600 that interprets the specification data, and the opcode bit width determination that determines the bit width that can be assigned to each instruction opcode Means 100, instruction rearranging means 200 for rearranging instructions according to the bit width of the opcode, opcode value determining means 300 for determining the value of the opcode of each instruction, opcode output means 700 for outputting the instruction opcode, specification Data analysis means 600, operation code bit width determination means 100, instruction rearrangement means 200, operation code value determination means 300, and operation code output means 700, intermediate data storage means 800 for storing data used by 700
  • 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 is based on the specification data on the processor instruction set, the specification data analysis means 600 that interprets the specification data, and the opcode bit width determination that determines the bit width that can be assigned to each instruction opcode.
  • Means 100, instruction rearranging means 200 for rearranging instructions according to the bit width of the opcode, and the opcode is composed of two subfields, and the value of each subfield is based on the bit width of the opcode. !
  • first opcode subfield value determining means 400 second opcode subfield value determining means 500, opcode output means 700 for outputting the instruction opcode, and specification data analysis Means 600, opcode bit width determining means 100, instruction rearranging means 200, and opcode value determining means 300, first operation code subfield value determination means 400, second operation code subfield value determination means 500, and intermediate data storage means 800 for storing data used by operation code output means 700.
  • 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 the designer needs to define the operation code.
  • the instruction opcode generation system of the second embodiment has a feature that the generated opcode is easy to decode.
  • the instruction opcode generation systems according to the first and second embodiments may both be realized by a program operating on a computer.
  • the program constituting the instruction opcode generation system causes the computer to function as each of the means 100 to 800 described above.
  • the instruction opcode generation system controls the computer, reads the specification data relating to the instruction set of the processor from the storage device of the computer, and determines the opcode of each instruction based on the specification data.
  • 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 the recording medium. Realized by executing code.
  • a processor CPU: central processing unit
  • Processor instructions are represented as 0 and 1 bit patterns. Predetermine which bits of the instruction bit pattern have what meaning! / The processor reads the instruction bit pattern and interprets the instruction.
  • the opcode is a field that indicates the name and type of the instruction.
  • An instruction must have an opcode to indicate the name and type of the instruction.
  • Opcodes represent instruction names and types, so instructions with different names and types have different opcodes.
  • the operand is a field that represents a parameter given to the instruction.
  • An instruction also has multiple operands Sometimes there are instructions that do not have any operands.
  • the operation code can be interpreted very easily.
  • the bit width of the opcode is not constant, and the instruction word length and the start bit position of the opcode may not be constant.
  • the opcode start bit position should be kept constant and the bit width of the opcode should be minimized.
  • N is the word length of the instruction (specification).
  • [k] is an unsigned integer.
  • min_power_of_2 (x) be the minimum power of 2 greater than value X.
  • Bitrev (x length) is a bit-reversed value of value X whose bit width is length
  • Figure 3 shows a flowchart corresponding to the following method.
  • step StO read the specification data
  • bit pattern width total_operands_length [k] used to represent all 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.
  • step Stl the bit width of the opcode field of the instruction is determined.
  • bit width opcode_length [k] of the opcode field of the instruction k is defined as follows.
  • This process is executed by the operation code bit width determining means 100 shown in FIGS.
  • step St2 the instructions are sorted.
  • 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.
  • the instruction number i that uses the least number of bits for the operand is S-1.
  • This process is executed by the instruction rearranging means 200 shown in FIG. 1 and FIG.
  • step St3 the value of the opcode field of the instruction is determined.
  • the opcode field value opcode_value [i] is determined in order from the 0th instruction. This processing is performed by the opcode value determining means 300 shown in FIG. 1 or the first code shown in FIG. This is executed by the pecode subfield value determining means 400 and the second opcode subfield value determining means 500, respectively.
  • 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
  • operand_0 [i] is the instruction i
  • the contents of the 0th operand, operand_l [i] is the contents of the 1st operand of instruction i
  • operand_q [i] is the contents of the qth operand of instruction i
  • bitrev (X, Y) is the lower order of X Represents the value obtained by bit-reversing the Y bit.
  • step St3 (3) there are several methods (step St3) for determining the value of the opcode field. The method will be described below.
  • FIG. 5 A flowchart of this opcode determination method is shown in FIG.
  • i represents the instruction number
  • S represents the total number of instructions
  • opcode_value [i] represents the opcode value of instruction i
  • opcode_leng th [i] represents the bit width of the opcode of instruction i.
  • opcode_value [i] is determined as follows while sequentially changing the instruction number i from 1 to S-1 (steps Stl 2 to Stl 5).
  • opcode—value [i] (, opcode—value [i_l] + l) (opcode—length
  • FIGS. 6 and 7 show examples of operation code assignment by the first operation code determination method described above.
  • Ra, Rb, and Rc are operand 'fields representing register numbers.
  • IMM6, IMM4, and IMM2 are operand fields representing numbers.
  • the 0 or 1 bit pattern written on the MSB side of the bit pattern represents the opcode.
  • FIG. 6 shows one expression form of instruction specification data. It is not always necessary to describe the specification data as shown in Fig. 6.
  • the specification data may be described as a text file.
  • the first operation code determination method is characterized by being very simple.
  • this operation code determination method has an advantage that more types of operation codes can be expressed than the other operation code determination methods described below.
  • step Stl the bit width of the opcode field is determined (step Stl), and (2) the instructions are sorted (step St2). After that, (3) determine the opcode value opcode_value [i] of each instruction as follows:
  • FIG. 8 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 opcode value of instruction i, and opcode_leng th [i] represents the bit width of the opcode of instruction i.
  • the opcode value opcode_value [i] of the instruction i is determined as follows (steps St22 to St30).
  • step St23 whether or not opcode_length [i] is the same as opcode_length [l]
  • opcode_length [i] is the same as opcode_length [1] (step St23: YES), perform an operation of adding 1 to opcode.value [i_l] and assign the calculated value to opcode_value [i] (Step St24).
  • the value obtained by adding 1 to opcode_value [i_l] is defined as opcode_length [i].
  • opcode_length [i] is different from opcode_length [i- l] (step St23: NO)
  • opc ode— vaiue [i ” (opcode— value
  • step St26 the minimum power-of-two value (min) that is equal to or greater than the number of instructions having the same opcode length as instruction i, rather than the value of (1 ((opcode_length [i] _opcode_length [i-1] >>) — Power— of —2 (num— of— inst— having— opcode— length (opcode—length [i] >>) power, large! /, Force, force, half IJ, and the larger value Let Z be.
  • the value of the operation code of each instruction is determined.
  • Fig. 6 and Fig. 9 show examples of operation code assignment by the above second operation code determination method. Using the instructions in Fig. 6 as specification data, rearranging those instructions based on opcode_length [i], and executing the processing from steps St21 to St30 in Fig. 8 yields Fig. 9.
  • the second operation code determination method is somewhat more complicated than the first operation code determination method.
  • 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 opcodes having the same bit width of the operation code and a bit string representing an instruction index in the group. is there. As a result, the operation code can be divided into two bit strings, so that the operation code can be decoded hierarchically.
  • opcode_value [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 instruction i, and opcode_length [i] represents the bit width of the opcode of instruction i.
  • opcode_value [i] is determined as follows while changing the instruction number i from 1 to S-1 in order (steps St32 to St38).
  • step St23 it is determined whether opcode_length [i] is the same as opcode_length [i-l].
  • opcode_length [i] is the same as opcode_length [1] (step St23: YES), perform an operation of adding 1 to opcode.value [i_l] and assign the calculated value to opcode_value [i] (Step St24).
  • step St23 if opcode_length [i] is different from opcode_length [il] (step St23: NO), the smallest power-of-two value (min_power_of_2 (num— of—inst—having—opcode—length (opcode—length
  • the value of the operation code of each instruction is determined.
  • FIG. 6 and Fig. 11 show examples of opcode assignment by the above third opcode determination method. If the instructions in FIG. 6 are used as specification data, the instructions are rearranged based on opcode_length [i], and the processing from steps St31 to St38 in FIG. 8 is executed, FIG. 11 is obtained.
  • the third operation code determination method is compared with the first and second operation code determination methods.
  • the operation code determination method is simpler than the first operation code determination method, and the decoding of the operation code is not easier than the second operation code determination method.
  • the opcode field is divided into two subfields. One is a group subfield and the other is an index subfield. Place the group subfield on the MSB side and the index subfield on the LSB side. In this method, the index 'subfield and group' subfields are determined separately.
  • FIG. 12 shows a flowchart of this opcode determination method.
  • this method consists of the procedure for determining the bit width of the index subfield (step St41), the procedure for determining the value of the index subfield (step St42), and the group 'subfield.
  • Index of instruction i The length of the subfield is opcode_sub_idx_length [i].
  • Index of instruction i The value of the subfield is opcode_sub_idx_value [i]
  • opcode_sub_idx_lengtnLi] min_power_oT_2 (num_of_inst_having_opcode_iength (opcoae_l ength [i]))
  • i is the instruction number
  • S is the total number of instructions
  • opcode_value [i] is the opcode value of instruction i
  • opcode_length [i] is the bit width of the opcode of instruction i
  • opcode_sub_idx_value [i ] Indicates the index / subfield value of instruction i.
  • step SStt5533 determine whether ooppccooddee__lleennggtthh [[ii]] is the same as ooppccooddee__lleennggtthh [[ll]]. .
  • ooppccooddee__lleennggtthh [[ii]] is the same as ooppccooddee__lleennggtthh [[Toto 11]] ((Stepstep SStt5533 :: YYEESS))
  • ooppccooddee..ssuubb —— iiddxx_v ] Is added to and added to 11 and the calculated value is transferred to ooppccooddee__ssuubb__iiddxx__vvaalluuee [[ii]] ((Step Step SStt5544)).
  • Group of instructions i reorder all instructions according to subfield length opcode_sub_grp_length [i].
  • the instruction number after the rearrangement is n.
  • the number n of the instruction that uses the most bits in the group.subfield is 0, and the number n of the instruction that uses the least number of bits in the group 'subfield is S-1.
  • Figure 14 shows a flowchart corresponding to this procedure.
  • n is the instruction number
  • S is the total number of instructions
  • opcode_value [n] is the opcode value of instruction n
  • opcode_length [n] is the bit width of the opcode of instruction n
  • opcode_sub_grp_value [n ] Indicates the value of the group 'subfield of the instruction n
  • opcode_sub_grp_length [n] indicates the bit width of the group' subfield of the instruction n.
  • step SStt6633 it is determined whether ooppccooddee__lleennggtthh [[nn]] is the same as ooppccooddee__lleennggtthh [[nn--ll]]. .
  • Fig. 1155 shows an example of operation code allocation allocation according to the above-mentioned fourth method of determining the method of opcode coded decision. As shown in Fig. 1188. .
  • RRaa, RRbb, and RRcc are the operational numbers that represent the number numbers of the registration starters.
  • IIMMMM66, IIMMMM44, and IIMMMM22 are operation-based fields representing numerical values.
  • An operator run land is placed on the LLSSBB side of the life-order command bitter pattern, and an operation code field field is placed on the MMSSBB side of the life-order command bit pattern pattern. To place it. .
  • Fig. 1155 is based on the spec command data, and those commands are based on ooppccooddee__lleennggtthh [[ii]].
  • Figure 1166 can be obtained by rearranging and rearranging and executing the processing with the SStt5577 as shown in Fig. 1133 from SStt5511. .
  • FIG. 1166 shows the value of the index field for the command of FIG. 1155. .
  • each of the orders for each life command has a sub-field field and a dadalle.
  • the value of the loop.subfield is obtained.
  • a bit string obtained by concatenating the index.subfield and the group.subfield is an opcode value.
  • 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 and a force. This is the same feature as the second opcode. Therefore, as with the second opcode, it is easy to decode the opcode. Operation code decoding The operation code can be decoded with only logical and shift operations that do not require subtraction.
  • the opcode generated by the fourth opcode determination method has a feature that a group of short opcodes. A subfield does not partially match another group of long opcodes. is there. This is a feature not found in the second opcode determination method. This feature makes the decoding process easier than the second opcode determination method.
  • the fourth opcode determination method has fewer types of opcodes that can be expressed. If the instruction word length is 24 bits or 32 bits, this will not be a problem.
  • the operation code is arranged on the MSB side of the bit pattern of the instruction.
  • the opcode location need not be on the MSB side.
  • An opcode may be placed on the LSB side of the instruction bit pattern.
  • an opcode may be placed at an intermediate position in the instruction bit pattern.
  • the opcode may be divided into several pieces and placed in the instruction bit pattern.
  • the embodiment of the present invention can also be applied to a hardware configuration generation tool for a processor as described in Patent Document 3 or a software development tool generation tool. These tools generate hardware configurations or software development tools from processor specifications.
  • Processor specifications include instruction set specifications.
  • the bit width and value of an operation code are included in the specification of the instruction set. If the embodiment of the present invention is used, the bit width and value of the operation code can be automatically determined. Once the hardware code and software development tools to correctly decode and encode the determined opcode are generated, it can be applied at any time.
  • each means constituting the instruction opcode generation system is realized by using a program code of a computer, such a program code and a computer readable record for recording the program code
  • a program code of a computer such a program code and a computer readable record for recording the program code
  • the program code in this case causes the computer to realize the above functions. Anything is acceptable.
  • the above functions may be realized in cooperation with other program codes such as an operating system (OS).
  • OS operating system
  • Examples of computer-readable recording media for recording such program codes include semiconductor memories such as ROM (read only memory), disk-type recording media (magnetic disks such as hard disks, optical disks, optical disks, etc.) Any type of recording medium can be applied, such as a magnetic disk or tape-type recording medium.
  • semiconductor memories such as ROM (read only memory), disk-type recording media (magnetic disks such as hard disks, optical disks, optical disks, etc.) Any type of recording medium can be applied, such as a magnetic disk or tape-type recording medium.
  • a computer that executes an instruction of the 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 has a processor (CPU) that operates under program control, a memory having a storage area for storing control programs, control data, and the like, various input / output devices (for example, external recording devices such as hard disks, communication devices, etc.)
  • various input / output devices for example, external recording devices such as hard disks, communication devices, etc.
  • Use communication devices such as modems and LAN (local area network) interfaces, display devices such as CRT (cathode ray tube) and liquid crystal displays, and at least some of various peripheral devices such as keyboards and mice.
  • processors In this case, the processor, memory, and various input / output devices used to realize the functions of the above means are included in the scope of the present invention. Either a stand-alone type or a computer composed of multiple computers that are communicably connected to the network can be used. .
  • the present invention can be used in a system that generates a processor hardware description from a processor specification description.
  • 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.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Executing Machine-Instructions (AREA)

Description

明 細 書
命令オペコード生成システム 技術分野
[0001] 本発明は、プロセッサを設計するツールで用いられる命令オペコード生成システム に関し、特にプロセッサの命令セットの設計において命令オペコードを自動的に決定 する技術に関する。
背景技術
[0002] 従来、プロセッサの設計を効率良く行なうためにさまざまなツールが開発されている
。そのようなツールの一つにプロセッサの設計仕様からプロセッサのハードウェア構 成やソフトウェア開発ツールを生成するツールがある。そうしたツールをここでは「プロ セッサ設計ツール」と呼ぶことにする。従来のプロセッサ設計ツールでは、命令語長 やオペコードやオペランドなどの情報を全て設計者が定義する。一つの命令を定義 する際に、その命令の語長を定義したり、その命令がもつオペランドの種類や数を定 義したりする。
[0003] 従来のプロセッサ設計ツールが非特許文献 1、 2、特許文献 1〜3で紹介されている 。例えば、非特許文献 1のツールは、プロセッサの命令セットを定義し、そのプロセッ サのシミュレータを生成することができる。非特許文献 1のツールでは、以下のように 命令のビットパターンを定義する。
[0004] CODING {Dest Srcl Src2 ObOlOOOO OblOOOO}
ここでは、 '{'と '} 'で囲まれた部分がビットパターンを表す。 Destと Srclと Src2は、それ ぞれレジスタの番号を表す。その後の ObOlOOOOと OblOOOOは、命令のオペコードを表 す 2進数である。このように命令のビットパターンを構成する情報を全て設計者が定 義する必要がある。他の文献で紹介されているツールでも同様である。
[0005] 命令のオペコードは、その命令を他の命令と区別するための命令フィールドである 。命令セットがあらかじめ決まっている場合、命令のオペコードを初めに一度だけ定 義すればよい。しかし、どんな命令を命令セットへ追加するべきかを検討する場合に は、命令のオペコードを何度力、修正する必要がある。 [0006] もし命令のオペコードを定義したり修正したりする必要がなければ、設計者が定義 する項目が減る。オペコードがどんな値をもっかは重要ではなぐ各命令を識別可能 なようにオペコードが定義されればよい。命令のオペコードを自動的に定義できるよう にすれば、設計者が定義する項目が減り、設計効率の向上につながる。
非特許文 1: Pees, et al., "LI¾A - Machine Description Language for Cycle- Acc urate Models of Programmable DSP Architectures, 06th Design Automationし onfer ence (DAC 99), June 1999, pp. 933-938.
非特許文献 2 : Andreas Hoffmann, et al., t Survey on Modeling Issues Using the M acnine Description Language Lisa," Proceedings of ICASSP 2001, Vol. 2, pp. 1137- 1140, May 7-11 2001.
特許文献 1:米国特許第 6477683号明細書
特許文献 2 :米国特許第 6862563号明細書
特許文献 3:特表 2003— 518280号公報
特許文献 4:特開 2003— 323463号公報
発明の開示
発明が解決しょうとする課題
[0007] 従来の命令セット生成ツールでは、命令のオペコードを定義するという作業が必要 で効率が悪レ、と!/、う問題があった。命令セットの内容を検討して何度も試行錯誤を繰 り返す際には、設計者が入力しなければならない項目が少ない方が効率的である。
[0008] 本発明は、オペコードを自動的に生成できるような命令オペコード自動生成方式を 提供することによって、プロセッサの命令セット設計の作業効率を向上させ、命令セッ トの検討における設計者の負担を軽減することを目的とする。
課題を解決するための手段
[0009] 上記目的を達成するため、本発明に係る命令オペコード生成システムは、プロセッ サの命令セットに関する仕様データにもとづいて、前記命令セットの各命令のォペコ 一ドに割り当てるビット幅を決めるォペコードビット幅決定手段と、前記オペコードの ビット幅にしたがって前記各命令を分類する命令分類手段と、前記各命令の分類に もとづいて、その各命令のオペコードの値を決定するオペコード値決定手段と、を備 える。
[0010] また、本発明に係るシステムは、プロセッサの命令に関する仕様データにもとづい て、そのプロセッサのハードウェア構成定義又はソフトウェア開発ツールを生成するシ ステムであって、上記に記載の命令オペコード生成システムを用いて、前記命令セッ トを構成する各命令のオペコードの値を決定することを特徴とする。
[0011] 本発明に係る命令オペコード生成方法は、プロセッサの命令セットに関する仕様デ ータにもとづいて、前記仕様データを解釈するための仕様データ解析ステップと、前 記命令セットの各命令のオペコードに割り当てるビット幅を決めるステップと、前記ォ ぺコードのビット幅にしたがって前記各命令を分類するステップと、前記各命令の分 類にもとづいて、その各命令のオペコードの値を決定するステップと、を備えることを 特徴とする。
発明の効果
[0012] 本発明によれば、プロセッサの命令セットに関する仕様データにもとづいてォペコ ードの値が自動的に生成されるため、設計者がオペコードを定義する必要が無くなり 、その分、命令セット設計の作業効率を向上させ、命令セットの検討における設計者 の負担を軽減することができる。
図面の簡単な説明
[0013] [図 1]本発明の第一の実施の形態に係る命令オペコード生成システムを表す図であ
[図 2]本発明の第二の実施の形態に係る命令オペコード生成システムを表す図であ
[図 3]本発明の実施例におけるオペコード割り当て方法のフローチャートである。
[図 4] (a)はオペコードを命令のビットパターンの MSB側に配置する方法を示す図で、 (b)はオペコードを命令のビットパターンの LSB側に配置する方法を示す図である。
[図 5]第一のオペコード決定方法のフローチャートである。
[図 6]仕様データとなる命令の例である。
[図 7]第一のオペコード決定方法によるオペコード割り当ての例である。
[図 8]第二のオペコード決定方法のフローチャートである。 [図 9]第二のオペコード決定方法によるオペコード割り当ての例である。
[図 10]第三のオペコード決定方法のフローチャートである。
[図 11]第三のオペコード決定方法によるオペコード割り当ての例である。
[図 12]第四のオペコード決定方法のフローチャートである。
[図 13]第四のオペコード決定方法のインデックス.サブフィールド決定方法のフロー チャートである。
[図 14]第四のオペコード決定方法のグループ 'サブフィールド決定方法のフローチヤ ートである。
[図 15]仕様データとなる命令の例である。
[図 16]第四のオペコード決定方法によるインデックス ·サブフィールドの割り当ての例 でめる。
[図 17]第四のオペコード決定方法におけるグループ.サブフィールドのビット幅にもと づく命令並び替え実施後の命令の例である。
[図 18]第四のオペコード決定方法によるグループ ·サブフィールドの割り当ての例で ある。
符号の説明
[0014] 100 オペコードビット幅決定手段
200 命令並べ替え手段
300 オペコード値決定手段
400 第 1のオペコードサブフィールド値決定手段
500 第 2のオペコードサブフィールド値決定手段
600 仕様データ解析手段
700 オペコード出力手段
800 中間データ記憶手段
発明を実施するための最良の形態
[0015] 次に、本発明に係る命令オペコード生成システムを実施するための最良の形態に ついて、図面を参照して詳細に説明する。
[0016] (第一の実施の形態) 図 1は、本発明の第一の実施の形態に係る命令オペコード生成システムの構成を 示す。図 1に示す命令オペコード生成システムは、プロセッサの命令セットに関する 仕様データにもとづいて、仕様データを解釈する仕様データ解析手段 600と、各命 令のオペコードに割り当て可能なビット幅を決めるオペコードビット幅決定手段 100と 、オペコードのビット幅にしたがって命令を並び替える命令並び替え手段 200と、各 命令のオペコードの値を決定するオペコード値決定手段 300と、命令オペコードを出 力するオペコード出力手段 700と、仕様データ解析手段 600とオペコードビット幅決 定手段 100と命令並び替え手段 200とオペコード値決定手段 300とオペコード出力 手段 700が使用するデータを記憶するための中間データ記憶手段 800と、を備える
[0017] この構成により、プロセッサの命令セットに関する仕様データにもとづいて各命令の オペコードの値が自動的に生成されるため、設計者がオペコードを定義する必要が 無くなり、その分、プロセッサの命令セット設計の作業効率を向上させ、命令セットの 検討における設計者の負担を軽減することができる。
[0018] (第二の実施の形態)
図 2は、本発明の第二の実施の形態に係る命令オペコード生成システムの構成を 示す。図 2に示す命令オペコード生成システムは、プロセッサの命令セットに関する 仕様データにもとづいて、仕様データを解釈する仕様データ解析手段 600と、各命 令のオペコードに割り当て可能なビット幅を決めるオペコードビット幅決定手段 100と 、オペコードのビット幅にしたがって命令を並び替える命令並び替え手段 200と、ォ ぺコードを二つのサブフィールドで構成してそれぞれのサブフィールドの値をォペコ ードのビット幅にもとづ!/、て決定する二つの手段、すなわち第一のオペコードサブフ ィールド値決定手段 400と、第二のオペコードサブフィールド値決定手段 500と、命 令オペコードを出力するオペコード出力手段 700と、仕様データ解析手段 600とォ ぺコードビット幅決定手段 100と命令並び替え手段 200とオペコード値決定手段 30 0と第一のオペコードサブフィールド値決定手段 400と第二のオペコードサブフィー ルド値決定手段 500とオペコード出力手段 700が使用するデータを記憶するための 中間データ記憶手段 800と、を備える。 [0019] この構成により、第一の実施の形態と同様に、プロセッサの命令セットに関する仕様 データにもとづいて各命令のオペコードの値が自動的に生成されるため、設計者が オペコードを定義する必要が無くなり、その分、プロセッサの命令セット設計の作業効 率を向上させ、命令セットの検討における設計者の負担を軽減することができる。さら に、第一の実施の形態の命令オペコード生成システムと比較して、第二の実施の形 態の命令オペコード生成システムには生成されたオペコードがデコードし易いという 特徴がある。
[0020] なお、第一および第二の実施の形態に係る命令オペコード生成システムは、いず れもコンピュータ上で動作するプログラムで実現してもよい。この場合、命令ォペコー ド生成システムを構成するプログラムは、コンピュータを上記の各手段 100〜800とし て機能させるものである。これにより、命令オペコード生成システムは、コンピュータを 制御して、コンピュータの記憶装置からプロセッサの命令セットに関する仕様データ を読みだし、その仕様データにもとづいて各命令のオペコードを決定する。
[0021] 以下、図 3〜図 18を参照して、第一および第二の実施の形態に係る命令ォペコー ド生成システムの実施例について、具体的に説明する。なお、以下の実施例では、 前述の図 1及び図 2に示す各手段 100〜800は、コンピュータ機のプロセッサ(CPU : central processing unit)がその記録媒体に配置された命令オペコード生成システム 用のプログラムコードを実行することにより実現される。 実施例
[0022] 最初に、プロセッサの命令はどのように定義されるかについて説明する。
[0023] プロセッサの命令は、 0と 1のビットパターンとして表される。命令のビットパターンの どのビットがどのような意味をもっかを予め定義してお!/、て、プロセッサが命令のビッ トパターンを読み込んでその命令を解釈する。
[0024] 命令のビットパターンには、オペコードとオペランドの二種類のフィールドがある。ォ ぺコードは、命令の名前や種類を表すフィールドである。命令の名前や種類を表す ために、命令には、必ずオペコードがーつ必要である。オペコードは命令の名前や 種類を表すので、異なる名前や種類の命令は異なるオペコードをもつ。オペランドは 、命令へ与えられるパラメータを表すフィールドである。命令が複数のオペランドをも つこともあるし、一つもオペランドをもたない命令もある。
[0025] プロセッサが命令を解釈するには、まず命令のオペコードからその命令の名前や種 類を知る。次に命令の名前や種類からオペランドの数や意味を知る。命令の名前や 種類とオペランドの数や意味とは一対一の関係にあるので、オペコードを解釈し易い か否かが命令の解釈し易さに直接関係する。
[0026] 例えば、命令語長が一定で、オペコードの開始ビット位置が一定で、オペコードの ビット幅が一定であるなら、非常に簡単にオペコードを解釈できる。しかし、一般的に はオペコードのビット幅は一定ではなレ、し、命令語長やオペコードの開始ビット位置 が一定ではないかも知れない。オペコードの解釈を容易にするには、オペコードの開 始ビット位置を一定にして、オペコードのビット幅の種類をできるだけ少なくすればよ い。
[0027] [オペコード生成方法]
次に、命令のオペコードをどのように決定するかについて説明する。なお、本明細 書で用いる各種の演算子(=、 +=、 ==、くく、 &、〜、 +、 -、等)の意味は、 C言語で一般に 使用されている意味と同じとする。例えば、「x=y」は、χに yを代入する代入演算を意 味する。また「x+=y」は、 Xに x+yを代入する代入演算を意味する (x=x+yと同じ意味で ある)。「x==y」は、 Xと yとの等値性を判断する関係演算を意味し、等しければ真、等し くなければ偽を返す。 「χくく y」は、 Xを y分だけ左にシフトさせるシフト演算を意味する。 「x&y」は、 Xと yとの論理積を計算する論理演算を意味する。「x」は Xの全てのビットを 反転する演算を意味する。
[0028] まず、以降の説明で使用する言葉について定義しておく。以下のうち、(仕様)と書 かれているものは、オペコードを生成するために設計者が定義するべき情報 (仕様デ ータ)を意味する。
[0029] [定義 1]命令の番号を kあるいは iで表す。
[0030] [定義 2]命令の総数を Sとする (仕様)。
[0031] [定義 3]命令の語長を Nとする (仕様)。
[0032] [定義 4]命令 kの全てのオペランドを表すために使用するビットパターンの幅を、 tot al— operands— iength[k]とする (仕様)。 [0033] [定義 5]命令 kのオペコードフィールドの長さを、 0pcode_length[k]ビットとする。
[0034] [定義 6]命令 kのオペコードフィールドの値を、 opcode_value[k]とする。 opcode_value
[k]は、符号無し整数とする。
[0035] [定義 7]オペコードフィールドの長さ力 ビットである命令の数を、 num_of_inst_having
—opcode— length(xノとする。
[0036] [定義 8]値 X以上の 2のべき乗の最小値を、 min_power_of_2(x)とする。
[0037] [定義 9]ビット幅が lengthである値 Xのビットリバースした値を、 bitrev(x length)とする
[0038] 次に、上記の定義 1 9を前提にして命令のオペコードを割り当てる方法を以下に 示す。以下の方法に対応するフローチャートを図 3に示す。
[0039] (0)まず、仕様データを読込む(ステップ StO)
[0040] ここでは、仕様データから命令 kの全てのオペランドを表すために使用するビットパ ターンの幅 total_operands_length[k]を読み取る。この処理は図 1及び図 2に示す仕様 データ解析手段 600により実行される。
[0041] (1)次に、命令のオペコードフィールドのビット幅を決定する(ステップ Stl)。
[0042] ここでは、命令 kのオペコードフィールドのビット幅 opcode_length[k]を以下のように 疋義する。
[0043] opcode_length[k]=N-total_operands_length[k] (k=0 1 · · · S_ 1 )
この処理は、図 1及び図 2に示すオペコードビット幅決定手段 100により実行される
[0044] (2)次に、命令をソートする(ステップ St2)
[0045] ここでは、 total_operands_length[k]にもとづいて、全ての命令をソートする。ソート後 の命令の番号を iで表す。最も多くのビットをオペランドに使用する命令の番号 iを 0と する。最も少ないビットをオペランドに使用する命令の番号 iを S-1とする。
[0046] この処理は、図 1及び図 2に示す命令並び替え手段 200により実行される。
[0047] (3)次に、命令のオペコードフィールドの値を決定する(ステップ St3)
[0048] ここでは、 0番目の命令から順番にオペコードフィールドの値 opcode_value[i]を決定 する。この処理は、図 1に示すオペコード値決定手段 300、又は図 2に示す第 1のォ ぺコードサブフィールド値決定手段 400と第 2のオペコードサブフィールド値決定手 段 500によりそれぞれ実行される。
[0049] 上記の手順において、オペコードフィールドを命令のビットパターンの Most Signific ant Bit(MSB)側に配置する場合、図 4 (a)のようにオペコードフィールドを配置する。 一方、オペコードフィールドを命令のビットパターンの Least Significant Bit(LSB)側に 配置する場合、図 4 (b)のようにオペコードフィールドの値をビットリバースした値を配 。
[0050] 図 4 (a)及び(b)において、 opcode_length[i]は命令 iのオペコードのビット幅を、 opco de_value[i]は命令 iのオペコードの値を、 operand_0[i]は命令 iの 0番目のオペランドの 内容を、 operand_l[i]は命令 iの 1番目のオペランドの内容を、 operand_q[i]は命令 iの q 番目のオペランドの内容を、 bitrev(X,Y)は Xの下位 Yビットをビットリバースした値を、 それぞれ表す。
[0051] 上記の手順のうち、(3)オペコードフィールドの値を決定する方法(ステップ St3)は いくつかある。以降でその方法について説明する。
[0052] [第一のオペコード決定方法]
最初に、第一のオペコード決定方法について説明する。
[0053] このオペコード決定方法では、まず、前述の方法にしたがって、(1)オペコードフィ 一ルドのビット幅の決定、(2)命令のソート、を行なう。その後で、以下のようにして、(
3)各命令のオペコードのィ直 opcode_value[i]を決定する。
[0054] このオペコード決定方法のフローチャートを図 5に示す。図 5において、 iは命令の 番号を、 Sは命令の総数を、 opcode_value[i]は命令 iのオペコードの値を、 opcode_leng th[i]は命令 iのオペコードのビット幅を、それぞれ表す。
[005¾」 まず、 opcode— value[0]へ 0を代入する (スアップ Stl 1)。
[0056] 続いて、命令の番号 iを 1から S-1まで順番に変えながら、 opcode_value[i]を以下のよ うに決定する(ステップ Stl 2〜Stl 5)。
[0057] opcode— value[i]=(、opcode— value[i_l]+l)くく (opcode— length|_i」_opcode—length[i_l]))
すなわち、 opcode_value[i_l]に 1を加算する演算を行う一方、 opcode_length[i]から o pCOde_length[i-l]を減算する演算を行う。そして、前者の演算値を後者の演算値分だ け左にシフトさせる演算を行い、その演算値を opcode_value[i]に代入する。このように して、各命令のオペコードの値を決定する。
[0058] 上記の第一のオペコード決定方法によるオペコード割り当ての例を図 6と図 7に示 す。図 6は 14個の命令のビットパターンを表す(S=14)。図 6において、 Ra、 Rb、 Rcはレ ジスタの番号を表すオペランド 'フィールドである。 IMM6, IMM4, IMM2は数値を表す オペランド.フィールドである。図 6において、各命令の語長は 16ビットである(N=16)。 図 6において、ビットパターンの MSB側に書かれた 0や 1のビットパターンがオペコード を表す。
[0059] 図 6のような命令の語長とオペランド 'フィールドのビット幅をもつ命令セットの仕様 データが与えられたとして、第一のオペコード決定方法により命令 U、 V、 W、 A、 B、 C、 D、 E、 F、 G、 H、 P、 Q、 Tのオペコードのィ直を決定する。
[0060] 図 6の命令を opcode_length[i]にもとづいて並び替え、図 5のステップ Stl 1から Stl 5までの処理を実行すると図 7が得られる。図 7に示すように、各命令のオペコードの 値 opcode_value[i] (i=0、 · · ·、 13)は、他のどの命令のオペコードの値とも重複していな い。したがって、第一のオペコード決定方法で生成されたオペコードによって、各命 令を正しく識另リすること力 Sできる。
[0061] 図 6は命令の仕様データの一つの表現形態である。必ずしも仕様データを図 6のよ うに記述する必要はない。テキストファイルとして仕様データを記述してもよい。
[0062] 上記のように第一のオペコード決定方法は、非常に単純であることが特徴である。
さらに、このオペコード決定方法には、下記の他のオペコード決定方法よりも多くの 種類のオペコードを表現できるという利点がある。
[0063] なお、第一のオペコード決定方法で生成されたオペコードは、そのデコードが多少 複雑になる。すなわち、上記のオペコードをデコードするには引き算と比較演算が必 要になる。命令を 1サイクルでデコードするには、複数の引き算と比較演算を同時に 実行する必要があるので、下記の他のオペコード決定方法に比べてオペコードのデ コード回路の規模が大きくなる。
[0064] [第二のオペコード決定方法]
次に、第二のオペコード決定方法につ!/、て説明する。 [0065] このオペコード決定方法では、まず、前述の方法にしたがって、(1)オペコードフィ 一ルドのビット幅の決定 (ステップ Stl)、 (2)命令のソート(ステップ St2)、を行なう。 その後で、以下のようにして、(3)各命令のオペコードの値 opcode_value[i]を決定す
[0066] このオペコード決定方法のフローチャートを図 8に示す。図 8において、 iは命令の 番号を、 Sは命令の総数を、 opcode_value[i]は命令 iのオペコードの値を、 opcode_leng th[i]は命令 iのオペコードのビット幅を、それぞれ表す。
[0067] まず、 opcode_value[0]へ 0を代入する(ステップ St21)。
[0068] 続いて、命令の番号 iを 1から S-1まで順番に変えながら、命令 iのオペコードの値 opc ode_value[i]を以下のように決定する(ステップ St22〜St30)。
[0069] ステップ St23において、 opcode_length[i]が opcode_length[ l]と同じかどうかを
判断する。
[0070] opcode_length[i]が opcode_length [ト 1]と同じなら(ステップ St23: YES)、 opcode.val ue[i_ l]に 1を加算する演算を行い、その演算値を opcode_value[i]へ代入する(ステツ プ St24)。すなわち、 opcode_value[i_ l]に 1を加算した値を opcode_length[i]とする。
[0071] 一方、 opcode_length[i]が opcode_length[i- l]と異なるなら(ステップ St23 : NO)、 opc ode— vaiue[i」=(opcode— value|_i_ l]くく (opcode— iength[i」_opcode— lengtn[i_ l]))と Tる (ス ~ ップ St25)。すなわち、 opcode_length[i]から opcode_length[i- l]を減算する演算を行う 。そして、その演算値分だけ、 opcode_value[i_ l]を左にシフトさせる演算を行い、その 演算値を opcode_value[i]へ代入する。つづいて、ステップ St26を実行する。
[0072] ステップ St26において、(1くく (opcode_length[i]_ opcode_length[i- 1]》という値よりも、 命令 iと同じオペコード長をもつ命令の数以上の最小の 2のべき乗の値(min— power— of —2(num— of— inst— having— opcode— length(opcode—length[i]》)力、大き!/、力、どつ力、半 IJ断し、大 きい方の値を Zとする。
[0073] ステップ St26の判定が YESの場合、 Z=min_power_of_2(num_of_inst_having_opcode_l ength(opcode— length[i]))として、 opcode— value[i]=、opcode—valueLi」+Z)&( (Z_ l))といつ計 算式によって opcode— value[i]を求める。
[0074] 一方、ステップ St26の判定が NOの場合、 Z=( lくく (opvode_length[i]-opcode_length[ i-l]》として、 opcode_value[i]=(opcode_value[i]+Z)&(〜(Z-l))という計算式によって opco de_value[i]を求める(ステップ St28)。
[0075] 以上のようにして、各命令のオペコードの値を決定する。
[0076] 上記の第二のオペコード決定方法によるオペコード割り当ての例を図 6と図 9に示 す。図 6の命令を仕様データとして、それらの命令を opcode_length[i]にもとづいて並 び替え、図 8のステップ St21から St30までの処理を実行すると図 9が得られる。
[0077] 図 9に示すように、各命令のオペコードの値 opcode_value[i] (i=0、 · · ·、 13)は、他のど の命令のオペコードの値とも重複していない。したがって、このオペコード決定方法 で生成されたオペコードを使って、各命令を正しく識別することができる。
[0078] 上記のように第二のオペコード決定方法は、第一のオペコード決定方法よりも多少 複雑である。しかし、第二のオペコード決定方法は第一のオペコード決定方法よりも 、生成されたオペコードをデコードするのが簡単である。なぜなら、第二のオペコード 決定方法によって生成されたオペコードは、同じオペコードのビット幅をもつォペコー ドのグループを表すビット列と、そのグループの中における命令のインデックスを表す ビット列とから構成されているためである。これにより、オペコードを二つのビット列に 分けて考えることができるため、オペコードを階層的にデコードできる。
[0079] すなわち、第二のオペコード決定方法で生成されたオペコードをデコードする際に は、まず同じオペコードのビット幅をもつオペコードのグループを表すビット列をデコ ードする。そして、最も長いビット列をもつグループを選択し、次にそのグループの中 における命令のインデックスを表すビット列をデコードする。第二のオペコード決定方 法で生成されたオペコードをデコードする際には、引き算が必要ない。よって、論理 演算とシフト演算だけでデコード回路を作ることができるので、第一のオペコード決定 方法に比べて第二のオペコード決定方法のデコード回路は簡単になる。
[0080] [第三のオペコード決定方法]
次に、第三のオペコード決定方法につ!/、て説明する。
[0081] このオペコード決定方法では、まず、前述の方法にしたがって、(1)オペコードフィ 一ルドのビット幅の決定 (ステップ Stl)、(2)命令のソート(ステップ St2)、を行なう。 その後で、以下のようにして、(3)各命令のオペコードの値 opcode_value[i]を決定す [0082] このオペコード決定方法のフローチャートを図 10に示す。図 10において、 iは命令 の番号を、 Sは命令の総数を、 opcode_value[i]は命令 iのオペコードの値を、 opcode_le ngth[i]は命令 iのオペコードのビット幅を、それぞれ表す。
[0083] まず、 opcode_value[0]へ 0を代入する(ステップ St31)。
[0084] 続いて、命令の番号 iを 1から S-1まで順番に変えながら、 opcode_value[i]を以下のよ うにして決定する(ステップ St32〜St38)。
[0085] ステップ St23において、 opcode_length[i]が opcode_length[i-l]と同じかどうか判断 する。
[0086] opcode_length[i]が opcode_length [ト 1]と同じなら(ステップ St23: YES)、 opcode.val ue[i_l]に 1を加算する演算を行い、その演算値を opcode_value[i]へ代入する(ステツ プ St24)。
[0087] 一方、 opcode_length[i]が opcode_length[i-l]と異なるなら(ステップ St23: NO)、命 令 iと同じオペコード長をもつ命令の数以上の最小の 2のべき乗の値(min_power_of_2( num— of— inst— having— opcode— length(opcode—length|_i—l]))を Zとする (スアップ Std5)。つ づレ、てステップ 36を実行する。
[0088] スァップ 36にね .レヽて、 opcode— value[i]=(、opcode—value[i_l」+Z)くく (opcode— iength[i]_o pcode_length[i-l]》と!/、う計算式にもとづ!/、て opcode_value[i]を求める。
[0089] 以上のようにして、各命令のオペコードの値を決定する。
[0090] 上記の第三のオペコード決定方法によるオペコード割り当ての例を図 6と図 11に示 す。図 6の命令を仕様データとして、それらの命令を opcode_length[i]にもとづいて並 び替え、図 8のステップ St31から St38までの処理を実行すると図 11が得られる。
[0091] 図 11に示すように、各命令のオペコードの値 opcode_value[i] (i=0、 · · ·、 13)は、他の どの命令のオペコードの値とも重複していない。したがって、このオペコード決定方法 で生成されたオペコードを使って、各命令を正しく識別することができる。
[0092] 第三のオペコード決定方法によって生成されたオペコードをデコードするには、引 き算と比較演算が必要になる。この点は第一のオペコード決定方法と同様である。
[0093] なお、第三のオペコード決定方法は、第一や第二のオペコード決定方法に比べる と、第一のオペコード決定方法よりもオペコード決定方法が単純でなぐ第二のオペ コード決定方法よりもオペコードのデコードが簡単ではない。
[0094] [第四のオペコード決定方法]
次に、第四のオペコード決定方法について説明する。
[0095] このオペコード決定方法では、オペコードフィールドを二つのサブフィールドに分け る。一つはグループ.サブフィールドで、もう一つはインデックス.サブフィールドとする 。グループ.サブフィールドを MSB側に配置し、インデックス .サブフィールドを LSB側 に配置する。この方法では、インデックス 'サブフィールドとグループ 'サブフィールド を別々に決定する。
[0096] このオペコード決定方法のフローチャートを図 12に示す。同図に示すように、この 方法は、インデックス ·サブフィールドのビット幅を決定する手順と(ステップ St41)、ィ ンデッタス ·サブフィールドの値を決定する手順と(ステップ St42)、グループ 'サブフ ィールドのビット幅を決定する手順と(ステップ St43)、グループ.サブフィールドのビ ット幅にもとづいて命令を並び替える手順と(ステップ St44)、グループ 'サブフィール ドの値を決定する手順と (ステップ St45)、力、ら構成される。
[0097] ここで、二つのサブフィールドに関する記号を以下のように定義する。
[0098] [定義 10]命令 iのグループ.サブフィールドの長さを、 opcode_sub_grp_length[i]とす
[0099] [定義 11]命令 iのグループ.サブフィールドの値を、 opcode_sub_grp_value[i]とする。
[0100] [定義 12]命令 iのインデックス 'サブフィールドの長さを、 opcode_sub_idx_length[i]と する。
[0101] [定義 13]命令 iのインデックス 'サブフィールドの値を、 opcode_sub_idx_value[i]とす
[0102] [定義 14]全ての命令について、インデックス.サブフィールドの長さを以下のように 決める(ステップ St41)。
[0103] opcode_sub_idx_lengtnLi]=min_power_oT_2(num_of_inst_having_opcode_iength(opcoae_l ength[i]))
[定義 15]全ての命令につ!/、て、グループ 'サブフィールドの長さを以下のように決 [0104] 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のインデックス ·サブフィールド の値を、それぞれ表す。
Figure imgf000017_0001
[[00110066]] 続続いいてて、、命命令令のの番番号号 iiをを 11かからら SS--11ままでで順順番番にに変変ええななががらら、、 ooppccooddee__ssuubb__iiddxx__vvaalluuee[[ii]]をを 以以下下ののよよううににししてて決決定定すするる((スステテッッププ SStt5522〜〜SStt5577))。。
[[00110077]] スステテッッププ SStt5533ににおおいいてて、、 ooppccooddee__lleennggtthh[[ii]]がが ooppccooddee__lleennggtthh[[ ll]]とと同同じじかかどどううかか判判断断 すするる。。
[[00110088]] ooppccooddee__lleennggtthh[[ii]]がが ooppccooddee__lleennggtthh [[トト 11]]とと同同じじなならら((スステテッッププ SStt5533 :: YYEESS))、、 ooppccooddee..ssuubb —— iiddxx__vvaalluuee[[ii__ll]]にに 11をを加加算算すするる演演算算をを行行いい、、そそのの演演算算値値をを ooppccooddee__ssuubb__iiddxx__vvaalluuee[[ii]]へへ代代 入入すするる((スステテッッププ SStt5544))。。
[[00110099]] 一一方方、、 ooppccooddee__lleennggtthh[[ii]]がが ooppccooddee__lleennggtthh[[ii--ll]]とと異異ななるるなならら((スステテッッププ SStt5533:: NNOO))、、 ooppcc
Figure imgf000017_0002
[0110] 次に、グループ.サブフィールドのビット幅にもとづいて命令を並び替える手順につ いて説明する。命令 iのグループ 'サブフィールドの長さ opcode_sub_grp_length[i]にも とづいて全ての命令を並び替える。並び替えられた後の命令の番号を nとする。最も 多くのビットをグループ.サブフィールドに使用する命令の番号 nを 0、最も少ないビッ トをグループ 'サブフィールドに使用する命令の番号 nを S-1とする。
[0111] 次に、グループ ·サブフィールドの値を決定する手順を以下に示す。この手順に対 応するフローチャートを図 14に示す。図 14において、 nは命令の番号を、 Sは命令の 総数を、 opcode_value[n]は命令 nのオペコードの値を、 opcode_length[n]は命令 nのォ ぺコードのビット幅を、 opcode_sub_grp_value[n]は命令 nのグループ 'サブフィールドの 値を、 opcode_sub_grp_length[n]は命令 nのグループ 'サブフィールドのビット幅を、そ れぞれ表す。 [0112] ままず" 、、 ooppccooddee—— ssuubb—— ggrrpp——vvaalluuee[[00]]へへ *
[0113] 続続いいてて、、命命令令のの番番号号 nnをを 11かからら SS--llままでで順順番番にに変変ええななががらら、、 ooppccooddee__ssuubb__ggrrpp__vvaalluuee[[nn]]をを 以以下下ののよよううににししてて決決定定すするる((スステテッッププ SStt6622〜〜SStt6666))。。
[0114] スステテッッププ SStt6633ににおおいいてて、、 ooppccooddee__lleennggtthh[[nn]]がが ooppccooddee__lleennggtthh[[nn--ll]]とと同同じじかかどどううかか判判断断 すするる。。
[0115] ooppccooddee—— lleennggtthh[[nn]]力力、、 ooppccooddee—— lleennggtthh[[nn—— 11]]とと同同ししななりり、、ススアアッッププ:: りり 33:: YYEE≥≥>>ノノ、、 ooppccooddee—— ssuu bb—— ggrrpp—— vvaalluuee[[nn-- 11」」をを ooppccooddee—— ssuubb—— ggrrpp—— vvaaiiuuee[[nn]]ヘヘイイ 入入すするる ((ススアアッッププ SStt6644))。。
[0116] 一一方方、、 ooppccooddee__lleennggtthh[[nn]]力力 ¾¾ppccooddee__lleennggtthh[[nn--ll]]とと異異ななるるなならら((スステテッッププ SStt6633:: NNOO))、、 oopp ccooddee_—ssuubb_—ggrrpp_—vvaalluuee[[nn]]==((((ooppccooddee_—ssuubb_—ggrrpp_—vvaalluuee[[nn-_ll]]++ll))\《<^、ooppccooddee_—ssuubb_—ggrrpp_—iieennggtthh[[nn]]-_oo ppccooddee—— ssuubb—— ggrrpp—— lleennggtthh[[nn—— 11]]))))とと!!//、、つつ計計算算式式ににももととつつ!!//ヽヽ飞飞 ooppccooddee—— ssuubb—— ggrrpp—— vvaalluuee[[nn]]をを求求めめ るる((スステテッッププ SStt6655))。。
[0117] 以以上上ののよよううににししてて、、各各命命令令ののオオペペココーードドのの値値をを決決定定すするる。。
[0118] 上上記記のの第第四四ののオオペペココーードド決決定定方方法法にによよるるオオペペココーードド割割りり当当ててのの例例をを図図 1155かからら図図 1188 にに示示すす。。
[0119] 図図 1155はは 1144個個のの命命令令ののビビッットトパパタターーンンをを表表すす((SS==1144))。。図図 1155ににおおいいてて、、 RRaa、、 RRbb、、 RRccはは レレジジススタタのの番番号号をを表表すすオオペペラランンドド ''フフィィーールルドドででああるる。。 IIMMMM66、、 IIMMMM44,, IIMMMM22はは数数値値をを表表 すすオオペペラランンドド ''フフィィーールルドドででああるる。。各各命命令令のの語語長長はは 1166ビビッットトででああるる((NN==1166))。。命命令令ビビッットト パパタターーンンのの LLSSBB側側ににオオペペラランンドドをを配配置置しし、、命命令令ビビッットトパパタターーンンのの MMSSBB側側ににオオペペココーードドフフ ィィーールルドドをを配配置置すするる。。
[0120] 図図 1155のの命命令令をを仕仕様様デデーータタととししてて、、そそれれららのの命命令令をを ooppccooddee__lleennggtthh[[ii]]ににももととづづいいてて並並 びび替替ええ、、図図 1133ののスステテッッププ SStt5511かからら SStt5577ままででのの処処理理をを実実行行すするるとと図図 1166がが得得らられれるる。。 図図 1166はは図図 1155のの命命令令にに対対すするるイインンデデッッククスス ..ササブブフフィィーールルドドのの値値をを表表すす。。
[0121] つつづづいいてて、、イインンデデッッククスス ··ササブブフフィィーールルドドのの値値がが求求ままっったた図図 1166のの命命令令をを使使っってて、、そそれれ ららのの命命令令ののググルルーーププ..ササブブフフィィーールルドドののビビッットト幅幅をを求求めめるる。。そそししてて、、ググルルーーププ..ササブブフフィィ 一一ルルドドののビビッットト幅幅ににももととづづいいてて命命令令をを並並びび替替ええるるとと図図 1177がが得得らられれるる。。
[0122] つつづづいいてて、、図図 1177のの命命令令にに対対ししてて図図 1144ののスステテッッププ SStt6611かかららスステテッッププ SStt6677ままででのの処処 理理をを実実行行すするるとと図図 1188がが得得らられれるる。。図図 1188はは図図 1177のの命命令令にに対対すするるググルルーーププ ··ササブブフフィィーー ルルドドのの値値をを表表すす。。以以上上のの処処理理にによよっってて、、各各命命令令ののイインンデデッッククスス ''ササブブフフィィーールルドドととダダルル ープ.サブフィールドの値が求まる。そして、インデックス.サブフィールドとグループ. サブフィールドとを連結したビット列がオペコードの値となる。
[0123] 図 18に示すように、グループ ·サブフィールドの値 opcode_sub_grp_value[i] (i=0、 · · ·、
13)と、インデックス ·サブフィールドの値 opcode_sub_idx_value[i] (i=0、 · · ·、 13)とで構 成される各命令のオペコードの値は、他のどの命令のオペコードの値とも重複してい ない。したがって、このオペコード決定方法を使って、各命令をオペコードによって正 しく識另すること力でさる。
[0124] 第四のオペコード決定方法は、同じオペコードのビット幅をもつオペコードのグルー プを表すビット列と、そのグループの中における命令のインデックスを表すビット列と 力、ら構成される。これは、第二のオペコードと同じ特徴である。したがって、第二のォ ぺコードと同様に、オペコードをデコードするのが簡単である。オペコードのデコード 処理には引き算が必要無ぐ論理演算とシフト演算だけでオペコードをデコードでき
[0125] さらに、第四のオペコード決定方法によって生成されたオペコードには、短いオペ コードのグループ.サブフィールドが別の長いオペコードのグループ.サブフィールド に部分的に一致することがない、という特徴がある。これは第二のオペコード決定方 法にはない特徴である。この特徴によって、第二のオペコード決定方法よりもデコー ド処理が簡単になる。
[0126] すなわち、第二のオペコード決定方法で生成されたオペコードをデコードする際に は、まず同じオペコードのビット幅をもつオペコードのグループを表すビット列をデコ ードし、最も長いビット列をもつグループを選択する必要がある。なぜなら、同じオペ コードのビット幅をもつオペコードのグループを表すビット列が部分的に一致している ため、それらの中から最もふさわしいグループを選択しなければならないからである。 第二のオペコード決定方法に比べて、第四のオペコード決定方法は、表現できるォ ぺコードの種類が少ない。命令語長が 24ビットや 32ビットなどの場合には、この点は あまり問題にならないだろう。
[0127] 次に、上記第一〜第四のオペコード決定方法のうち、何れのオペコード決定方法 を選択するかにつ!/、て説明する。 [0128] 一般的には、デコード処理が簡単になるようなオペコード決定方法を選択するべき である。これまでに述べたオペコード決定方法の中では、第四のオペコード決定方 法のデコード処理が最も容易である。もし、表現可能なオペコードの数を多くしたい 場合には、第二のオペコード決定方法を選択してもよい。
[0129] 以上、本発明の実施例を詳細に説明したが、本発明は、代表的に例示した上述の 実施例に限定されるものではなぐ当業者であれば、特許請求の範囲の記載内容に 基づき、本発明の要旨を逸脱しない範囲内で種々の態様に変形、変更、応用するこ とができ、これらの変形例、変更例、応用例も本発明の権利範囲に属するものである
[0130] [変形例]
これまでに述べた実施例では、命令のビットパターンの MSB側にオペコードが配置 される。しかし、オペコードの位置は MSB側である必要はない。命令のビットパターン の LSB側にオペコードを配置してもよい。あるいは、命令のビットパターンの中間的な 位置にオペコードを配置してもよい。あるいは、オペコードをいくつかの断片に分けて 命令のビットパターンの中に配置してもよい。
[0131] [応用例]
本発明の実施例を特許文献 3にあるようなプロセッサのハードウェア構成生成ツー ルゃソフトウェア開発ツール生成ツールに応用することも可能である。こうしたツーノレ はプロセッサの仕様からハードウェア構成あるいはソフトウェア開発ツールを生成する 。プロセッサの仕様には命令セットの仕様も含まれる。特許文献 3では命令セットの仕 様にオペコードのビット幅や値が含まれていた力 本発明の実施例を使えばォペコ ードのビット幅と値を自動的に決定することができる。そして決定されたオペコードを 正しくデコードしたりエンコードしたりするためのハードウェア構成やソフトウェア開発 ツールを生成するといつた応用も可能になる。
[0132] 本発明の実施例に係る命令オペコード生成システムを構成する各手段の少なくとも 一部の機能を、コンピュータのプログラムコードを用いて実現する場合、かかるプログ ラムコード及びこれを記録するコンピュータ読み取り可能な記録媒体は、本発明の範 疇に含まれる。この場合のプログラムコードは、上記の機能をコンピュータに実現させ るものであればよい。例えば、オペレーティングシステム(OS)等の他のプログラムコ ードと連携して上記の機能が実現されてもよい。また、このようなプログラムコードを記 録するコンピュータ読み取り可能な記録媒体としては、例えば ROM (read only memo ry)等の半導体メモリ、ディスク型の記録媒体 (ハードディスク等の磁気ディスク、光デ イスク、光磁気ディスク等)、テープ型の記録媒体等、いずれの形態の記録媒体でも 適用可能である。
[0133] また、本発明の実施例に係る命令オペコード生成システムを構成するプログラムコ ードの命令を実行するコンピュータ機についても、本発明の範疇に含まれる。このコ ンピュータ機は、プログラム制御で動作するプロセッサ(CPU)と、制御プログラムや 制御データ等を格納する記憶領域を有するメモリと、各種入出力装置 (例えば、ハー ドディスク等の外部記録装置、通信モデムや LAN (local area network)インタフエ一 ス等の通信装置、 CRT (cathode ray tube)や液晶ディスプレイ等の表示装置、キー ボードやマウス等の入力装置等の各種周辺装置の少なくとも一部とを用いて実現す ることが可能である。この場合、上記各手段の機能を実現するために用いられるプロ セッサ、メモリ、及び各種入出力装置は、本発明の範疇に含まれる。このコンピュータ 機は、スタンドアロン型のものでも、ネットワークに通信可能に接続された複数のコン ピュータ機から構成されるものでも、いずれの形態でも適用可能である。
[0134] この出願は、 2006年 11月 21日に出願された日本出願特願 2006— 314260号を 基礎とする優先権を主張し、その開示の全てをここに取り込む。
産業上の利用可能性
[0135] 本発明を使用すれば、命令セットの仕様記述から各命令のオペコードを自動的に 生成すること力 Sできる。プロセッサの仕様記述からプロセッサのハードウェア記述を生 成するようなシステムにおいて本発明を使用することが可能である。あるいは、命令セ ットの使用記述からアセンブラやコンパイラなどのソフトウェア開発ツールを生成する ようなシステムにおいても本発明を使用することが可能である。

Claims

請求の範囲
[1] プロセッサの命令セットに関する仕様データにもとづいて、前記命令セットの各命令 のォペコ一ドに割り当てるビット幅を決めるォペコ一ドビット幅決定手段と、
前記オペコードのビット幅にしたがって前記各命令を分類する命令分類手段と、 前記各命令の分類にもとづいて、その各命令のオペコードの値を決定するォペコ ード値決定手段と、
を備えることを特徴とする命令オペコード生成システム。
[2] 請求項 1に記載の命令オペコード生成システムであって、
前記仕様データを解釈するための仕様データ解析手段と、
前記仕様データ解析手段と前記オペコードビット幅決定手段と前記命令分類手段 と前記オペコード値決定手段とが出力するデータを記憶するための中間データ記憶 手段と、
をさらに備えることを特徴とする命令オペコード生成システム。
[3] 請求項 2に記載の命令オペコード生成システムにおいて、
前記オペコ一ド値決定手段は、
前記オペコードを二つのサブフィールドで構成してそれぞれのサブフィールドの値 を前記各命令の分類にもとづいて決定する手段、
を備えることを特徴とする命令オペコード生成システム。
[4] 請求項 2または請求項 3に記載の命令オペコード生成システムであって、
前記プロセッサの命令セットに関する仕様データには、命令の語長と、命令がもつ オペランドの個数と、各オペランドのビット幅と、が含まれ、
前記オペコード値決定手段は、前記命令の語長と、前記命令がもつオペランドの 個数と、前記各オペランドのビット幅とを含む前記プロセッサの命令セットに関する仕 様データにもとづいて、各命令のオペコードを決定することを特徴とする命令オペコ ード生成システム。
[5] 請求項 4に記載の命令オペコード生成システムにおいて、
前記命令の番号を kとし、前記命令の総数を Sとし、前記命令の語長を Nとし、前記 命令 kの全てのオペランドを表すために使用するビットパターンの幅 total_operands_le ngth[k]とし、前記命令 kのオペコードフィールドの長さを opcode_length[k]ビットとし、 前記命令 kのォペコ一ドフィールドの値を opcode_value [k]とし、前記オペコ一ドフィ一 ノレドの長さ力 ビットである命令の数を num_of_inst_having_opcode_length(x)とし、ィ直 x以 上の 2のべき乗の最小値を min_power_of_2(x)としたとき、
前記オペコ一ドビット幅決定手段は、前記命令 kのォペコ一ドフィールドのビット幅 0 pcode— iength[k]を、
opcode— length[k」=N_total— operands— length[k」 (k=0,丄,… _ 1 )
により求め、
前記命令分類手段は、前記命令 kの全てのオペランドを表すために使用するビット パターンの幅 total_operands_length[k]にもとづいて全ての前記命令を並び替え、 並び替えられた後の前記命令の番号を iとし、最も多くのビットをオペランドに使用す る命令の番号 iを 0とし、最も少ないビットをオペランドに使用する命令の番号 iを S-1と したとさ、
前記オペコード値決定手段は、 0番目の命令から S-1番目の命令まで順番に命令 i のオペコードフィールドの値 opcode_Value[i]を決定する、ことを特徴とする命令オペコ ード生成システム。
[6] 請求項 5に記載の命令オペコード生成システムにおいて、
前記命令 iのォペコ一ドフィ一ルドの値 opcode_value [i]を決定する手段は、 opcode_value[0]へ 0を代入後、前記命令の番号 iを 1から S-1まで順番に変えながら、 opcode— value |_1」を、
opcode— value[i]=(、opcode— value[i_l]+l)くく (opcode— lengthLi」_opcode—length[i_l])) により決定することを特徴とする命令オペコード生成システム。
[7] 請求項 5に記載の命令オペコード生成システムにおいて、
前記命令 iのォペコ一ドフィ一ルドの値 opcode_value [i]を決定する手段は、 opcode_value[0]へ 0を代入後、前記命令の番号 iを 1から S-1まで順番に変えながら、 opcode— value |_1」を、
(1; opcode— length[i」力 ^opcode— length [ト 1]と じどきに、 opcode— value [i]=opcode _value[i_l]+lにより決定し、 (2) opcode— length[i^ pcode— length[i_l]と異なるときに、
(1くく (opcode_length[i]_ opcode_length[i- 1]》と、命令 iと同じオペコード長をもつ命令の 数以上の最 zj、の 2のべき乗 min— power— of— 2(num— of— inst— having— opcode— length(opcode— length[i]))との大きい方のィ直を Zとして、 opcode— value[i]=((opcode—value[i_l]くく (opcode _length[i]-opcode_length[i-l]))+Z)&r(Z-l》により決定することを特徴とする命令 オペコード生成システム。
請求項 5に記載の命令オペコード生成システムにおいて、
前記命令 iのォペコ一ドフィ一ルドの値 opcode_value [i]を決定する手段は、 opcode_value[0]へ 0を代入後、命令の番号 iを 1から S-1まで順番に変えながら、 opco de— value|_i」を、
(1) opcode— lengtnu]力、 opcode— length|_i_l]と同しときに、 opcode— value |_i」=opcode—valu e[i_l]+lにより決定し、
(2) opcode_length[i]が opcode_length[i-l]と異なるときに、命令 iと同じオペコード長 をもつ命令の数以上の敢 /J、の 2のべき乗 (min— power— of— 2(num— of— inst— having— opcode— length、opcode— length[i_l]))を とし" C、 opcode— value[i]=(、opcode—value[i_l]+Z)くく (opco de_length[i]-opcode_length[i-l]))により決定することを特徴とする命令オペコード生成 システム。
請求項 5に記載の命令オペコード生成システムにおいて、
前記オペコードフィールドはグループ 'サブフィールドとインデックス ·サブフィールド とに区分され、
前記命令 iのォペコ一ドフィ一ルドの値 opcode_value [i]を決定する手段は、前記イン デッタス ·サブフィールドの値を決定する手段と、前記グループ ·サブフィールドの値 を決定する手段とを有し、
前記命令 iのインデックス ·サブフィールドの長さを opcode_sub_idx_length[i]とし、前 記命令 iのインデックス ·サブフィールドの値を opcode_sub_idx_value[i]とし、全ての 命令につ! /、てインアッタス 'サフクイ一ノレドの R を opcode— sub— idx— length|_i」=min— pow er— of— 2(num— of— inst— having— opcode— length(opcode—length|_i」))とし、冃 ij'g己命令 ιのクノレ一 プ .サブフィールドの長さを 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まで順番に変えなが ら、 opcoae— sub— idx— value |_1」を、
(1; opcode— length[i」力 ^opcode— length [ト 1]と |Ftjじどきに、 opcode— sub— idx—value[i]=opc ode— sub— idx— value [i— 1]+ 1により決定し、
(2) opcode— length[i]力 pcode— length[i_l]と異なるときに、 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」を、
( ノ opcode— length[n]力、 opcoae— length[n_l]と |ri]しどさに、
opcode— su b—grp— value [n」 =opcode— sub— grp— value [n— 1]ίこより決疋し、
(2) opcode— length[n!^opcode— length[n_l]と異なるときに、
opcode_sub_grp_value[n]=((opcode_sub_grp_value[n-l]+l)<<(opcode_sub_grp_length[n] -opcode_sub_grp_length[n- 1]))により決定することを特徴とする命令オペコード生成シ ステム。
[10] プロセッサの命令に関する仕様データにもとづいて、そのプロセッサのハードウェア 構成定義又はソフトウェア開発ツールを生成するシステムであって、
請求項 1から 9のいずれかに記載の命令オペコード生成システムを用いて、前記プ 口セッサの命令セットに関する仕様データにもとづいて、前記命令セットを構成する各 命令のオペコードの値を決定することを特徴とするシステム。 [11] プロセッサの命令セットに関する仕様データにもとづいて、
前記仕様データを解釈するための仕様データ解析ステップと、
前記命令セットの各命令のオペコードに割り当てるビット幅を決めるステップと、 前記オペコードのビット幅にしたがって前記各命令を分類するステップと、 前記各命令の分類にもとづいて、その各命令のオペコードの値を決定するステップ と、
を備えることを特徴とする命令オペコード生成方法。
[12] 請求項 11に記載の命令オペコード生成方法にお!/、て、
前記オペコード値決定ステップは、
前記オペコードを二つのサブフィールドで構成してそれぞれのサブフィールドの値 を前記各命令の分類にもとづいて決定するステップと、
を備えることを特徴とする命令オペコード生成方法。
[13] 請求項 11または請求項 12に記載の命令オペコード生成方法であって、
前記プロセッサの命令セットに関する仕様データには、命令の語長と、命令がもつ オペランドの個数と、各オペランドのビット幅と、が含まれ、
前記オペコード値決定ステップは、前記命令の語長と、前記命令がもつオペランド の個数と、前記各オペランドのビット幅とを含む前記プロセッサの命令セットに関する 仕様データにもとづいて、各命令のオペコードを決定することを特徴とする命令オペ コード生成方法。
[14] 請求項 11から請求項 13のいずれかに記載の命令オペコード生成方法をコンビュ ータに実行させることを特徴とする命令オペコード生成プログラム。
[15] プロセッサの命令に関する仕様データにもとづいて、そのプロセッサのハードウェア 構成定義又はソフトウェア開発ツールをコンピュータに生成させるプログラムであって 請求項 14に記載の命令オペコード生成プログラムを用いて、前記プロセッサの命 令セットに関する仕様データにもとづいて、前記命令セットを構成する各命令のオペ コードの値を決定することを特徴とするプログラム。
PCT/JP2007/072413 2006-11-21 2007-11-19 Système de génération de code d'opération de commande WO2008062768A1 (fr)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2008545398A JP5218063B2 (ja) 2006-11-21 2007-11-19 命令オペコード生成システム
US12/515,439 US8935512B2 (en) 2006-11-21 2007-11-19 Instruction operation code generation system
EP07832143A EP2096533A4 (en) 2006-11-21 2007-11-19 CONTROL OPERATION CODE GENERATION SYSTEM

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2006314260 2006-11-21
JP2006-314260 2006-11-21

Publications (1)

Publication Number Publication Date
WO2008062768A1 true WO2008062768A1 (fr) 2008-05-29

Family

ID=39429698

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2007/072413 WO2008062768A1 (fr) 2006-11-21 2007-11-19 Système de génération de code d'opération de commande

Country Status (6)

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

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI513282B (zh) * 2013-11-21 2015-12-11 Mstar Semiconductor Inc 快取記憶體管理裝置及應用該快取記憶體管理裝置之動態影像系統及方法
US10831503B2 (en) 2018-11-06 2020-11-10 International Business Machines Corporation Saving and restoring machine state between multiple executions of an instruction
US10831478B2 (en) * 2018-11-06 2020-11-10 International Business Machines Corporation Sort and merge instruction for a general-purpose processor
US10831502B2 (en) 2018-11-06 2020-11-10 International Business Machines Corporation Migration of partially completed instructions
CN111258633B (zh) * 2018-11-30 2022-08-09 上海寒武纪信息科技有限公司 乘法器、数据处理方法、芯片及电子设备
CN110007962A (zh) * 2019-03-08 2019-07-12 浙江大学 一种基于代码自动生成的指令集模拟方法
CN113656071B (zh) * 2021-10-18 2022-02-08 深圳市智想科技有限公司 一种基于risc架构的cpu指令集系统及cpu系统

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6477683B1 (en) 1999-02-05 2002-11-05 Tensilica, Inc. Automated processor generation system for designing a configurable processor and method for the same
JP2003518280A (ja) 1999-02-05 2003-06-03 テンシリカ インコーポレイテッド 構成可能なプロセッサを設計するための自動プロセッサ生成システムおよび生成方法
JP2003241975A (ja) * 2002-02-21 2003-08-29 Matsushita Electric Ind Co Ltd コンパイラ装置および半導体集積回路
JP2003288203A (ja) * 2002-03-27 2003-10-10 Asahi Kasei Corp プロセッサの開発支援装置
JP2003323463A (ja) 2002-04-26 2003-11-14 Toshiba Corp システムlsi開発環境生成方法及びそのプログラム
US6862563B1 (en) 1998-10-14 2005-03-01 Arc International Method and apparatus for managing the configuration and functionality of a semiconductor design
JP2006314260A (ja) 2005-05-13 2006-11-24 Meiji Milk Prod Co Ltd チロシン含有飲料の結晶析出の抑制方法

Family Cites Families (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03271829A (ja) * 1990-03-20 1991-12-03 Fujitsu Ltd 情報処理装置
DE69431998T2 (de) * 1993-11-05 2004-08-05 Intergraph Hardware Technologies Co., Las Vegas Superskalare Rechnerarchitektur mit Softwarescheduling
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
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
AU2001245720A1 (en) * 2000-03-15 2001-09-24 Arc International Plc 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
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 (ja) 2004-04-05 2005-10-20 Renesas Technology Corp データ処理装置の開発方法、データプロセッサの開発支援プログラム、設計データの提供方法、及びデータ処理システムの開発方法
US20070038984A1 (en) * 2005-08-12 2007-02-15 Gschwind Michael K Methods for generating code for an architecture encoding an extended register specification
JP2007122626A (ja) * 2005-10-31 2007-05-17 Matsushita Electric Ind Co Ltd マイクロプロセッサ

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
JP2003518280A (ja) 1999-02-05 2003-06-03 テンシリカ インコーポレイテッド 構成可能なプロセッサを設計するための自動プロセッサ生成システムおよび生成方法
JP2003241975A (ja) * 2002-02-21 2003-08-29 Matsushita Electric Ind Co Ltd コンパイラ装置および半導体集積回路
JP2003288203A (ja) * 2002-03-27 2003-10-10 Asahi Kasei Corp プロセッサの開発支援装置
JP2003323463A (ja) 2002-04-26 2003-11-14 Toshiba Corp システムlsi開発環境生成方法及びそのプログラム
JP2006314260A (ja) 2005-05-13 2006-11-24 Meiji Milk Prod Co Ltd チロシン含有飲料の結晶析出の抑制方法

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
ANDREAS HOFFMANN ET AL.: "A Survey on Modeling Issues Using the Machine Description Language Lisa", PROCEEDINGS OF ICASSP 2001, vol. 2, 7 May 2001 (2001-05-07), pages 1137 - 1140, XP010803709, DOI: doi:10.1109/ICASSP.2001.941122
BENINI L. ET AL.: "Automatic selection of instruction op-codes of low-power core processors", IEE PROCEEDINGS COMPUTERS & DIGITAL TECHNIQUES, vol. 146, no. 4, July 1999 (1999-07-01), pages 173 - 178, XP000926871 *
KOJI INOUE ET AL.: "REDUCING POWER CONSTUMPTION OF INSTRUCTION ROMS BY EXPLOITING INSTRUCTION FREQUENCY", 2002 ASIA-PACIFIC CONFERENCE ON CIRCUITS AND SYSTEMS, 2002. APCCAS'02. IEEE, October 2002 (2002-10-01), XP010620772 *
S. PEES ET AL.: "LISA-Machine Description Language for Cycle-Accurate Models of Programmable DSP Architectures", 36TH DESIGN AUTOMATION CONFERENCE (DAC 99), June 1999 (1999-06-01), pages 933 - 938
See also references of EP2096533A4 *

Also Published As

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

Similar Documents

Publication Publication Date Title
WO2008062768A1 (fr) Système de génération de code d&#39;opération de commande
JP5646737B2 (ja) 条件付き比較命令
US5918035A (en) Method for processor modeling in code generation and instruction set simulation
CN100414493C (zh) 用于并行数据转换的方法、设备及指令
JP6237278B2 (ja) コンパイルプログラム、コンパイル方法およびコンパイル装置
JPH096609A (ja) プログラム実行装置およびプログラム変換方法
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
US6519742B1 (en) Local naming for HDL compilation
JPH0877221A (ja) 消費電力を低減する有限状態マシンを設計するシステム及び方法
US8127281B2 (en) Method and apparatus for efficient multiple-pattern based matching and transformation of intermediate language expression trees
KR20010024576A (ko) 기계 기술로부터의 명령군 구조의 시뮬레이터 및 어셈블러생성 방법
Harman Verifying a simple pipelined microprocessor using Maude
US9317298B2 (en) Generation of instruction set from architecture description
Nohl et al. Instruction encoding synthesis for architecture exploration using hierarchical processor models
US7480809B2 (en) Reducing power consumption of a microprocessor
US20030142555A1 (en) System and method for small read only data
US7774748B1 (en) System and method for automatic conversion of a partially-explicit instruction set to an explicit instruction set
US20230070947A1 (en) Convolutional neural network compiler for programmable functional array (pfa) processors
JP6958038B2 (ja) シミュレーションプログラム、方法、及び装置
US20040111680A1 (en) Method for creating ROM soft IP for being built in micro controller soft IP and recording media having program for executing the same
US20040162965A1 (en) Information processing unit
Jeng et al. FACE: Fine-tuned architecture codesign environment for ASIP development
JP6222374B2 (ja) コード変換プログラム、コード変換装置およびコード変換方法
Thomas et al. Intermediate, Assembler Language Programming Macro Expansions, and Expression Translation
CN117270870A (zh) 基于混和精度张量运算指令的编译优化方法,装置及设备

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 200780043241.2

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 07832143

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2008545398

Country of ref document: JP

WWE Wipo information: entry into national phase

Ref document number: 12515439

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 2007832143

Country of ref document: EP