JP2002318686A - Processor - Google Patents

Processor

Info

Publication number
JP2002318686A
JP2002318686A JP2001121308A JP2001121308A JP2002318686A JP 2002318686 A JP2002318686 A JP 2002318686A JP 2001121308 A JP2001121308 A JP 2001121308A JP 2001121308 A JP2001121308 A JP 2001121308A JP 2002318686 A JP2002318686 A JP 2002318686A
Authority
JP
Japan
Prior art keywords
instruction
data
definition
processor
read
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.)
Abandoned
Application number
JP2001121308A
Other languages
Japanese (ja)
Inventor
Koji Ozaki
浩治 尾崎
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.)
Sony Corp
Original Assignee
Sony 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 Sony Corp filed Critical Sony Corp
Priority to JP2001121308A priority Critical patent/JP2002318686A/en
Priority to PCT/JP2002/003930 priority patent/WO2002086652A1/en
Publication of JP2002318686A publication Critical patent/JP2002318686A/en
Abandoned legal-status Critical Current

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

Abstract

PROBLEM TO BE SOLVED: To provide a processor capable of enhancing execution speed by shortening read time of instruction data. SOLUTION: In a control part 2 of the processor 1, it is constituted so that an instruction decoder 21 issues an instruction to a data path part 3 by providing an instruction definition storage memory 24 and using definition information stored in the instruction definition storage memory 24 when an instruction issuing device 23 judges that an instruction read from an external memory 6 is a defined instruction. Thus, data quantity of the instruction to be read is reduced and the read time is shortened by defining a plurality of instructions to be frequently used in the instruction definition storage memory 24 by short data quantity. In addition, the instructions becomes executable by other processors with different instruction systems without changing a program main body and diversity of the program is enhanced by replacing the definition information of the instruction definition storage memory 24.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明はプロセッサに関し、
特に命令体系を動的に変更し、読み込む命令のデータ量
を削減することにより、実行速度の向上を実現すること
ができるプロセッサに関する。
TECHNICAL FIELD The present invention relates to a processor.
In particular, the present invention relates to a processor capable of realizing an improvement in execution speed by dynamically changing an instruction system and reducing a data amount of an instruction to be read.

【0002】[0002]

【従来の技術】現在、コンピュータや携帯端末はもとよ
り、あらゆる電子機器においてマイクロプロセッサが用
いられている。このようなマイクロプロセッサは、それ
ぞれ固有の命令体系を持っており、プログラムもその命
令内容に合わせて作成されることで読み込んだ命令に従
って動作する。マイクロプロセッサが持っている命令
は、マイクロプロセッサができた時点で決まっており、
固定されていて、通常は変更することができない。
2. Description of the Related Art At present, microprocessors are used not only in computers and portable terminals but also in all electronic devices. Such a microprocessor has a unique instruction system, and a program operates according to the read instruction by being created in accordance with the instruction content. The instructions that the microprocessor has are determined when the microprocessor is created,
Fixed and cannot usually be changed.

【0003】また、最近では、起動時に特殊なプログラ
ムを読み込み、命令をプロセッサ固有の命令に内部で変
換できるマイクロプロセッサが実用化されている。この
命令の変更は、起動時に特殊なプログラムを読み込むこ
とにより実現しているため、命令の変更は起動時のみに
限られる。
[0003] Recently, a microprocessor capable of reading a special program at the time of startup and internally converting an instruction into an instruction peculiar to the processor has been put into practical use. Since the change of the instruction is realized by reading a special program at the time of startup, the change of the instruction is limited only at the time of startup.

【0004】[0004]

【発明が解決しようとする課題】従来のプロセッサで
は、プログラムによらず命令体系が一定のため、性質の
まったく異なるプログラムを切り替えて使用する場合
に、ある命令体系のプロセッサでは1つまたは少ない命
令で演算実行が可能であっても、別の命令体系のプロセ
ッサでは多くの命令が必要であったりすることがあり、
後者の場合には、読み込む命令のデータ量が多くなるた
め、命令の読み込みに時間を取られ、実行速度があがら
ないという問題があった。
In a conventional processor, the instruction system is constant regardless of the program. Therefore, when a program having completely different properties is used by switching, a processor having a certain instruction system requires one or a small number of instructions. Even if operations can be performed, processors with different instruction systems may require many instructions,
In the latter case, since the data amount of the instruction to be read becomes large, there is a problem that it takes time to read the instruction and the execution speed does not increase.

【0005】本発明はこのような点に鑑みてなされたも
のであり、プログラムによって命令体系を動的に変更す
ることで、プログラムの命令を簡素化し、命令データの
読み込み時間を短縮して実行速度を向上するとともに、
アーキテクチャの異なるプロセッサ間でのプログラムの
流用度を向上させることができるプロセッサを提供する
ことを目的とする。
The present invention has been made in view of the above circumstances, and dynamically changes an instruction system by a program, thereby simplifying the instructions of the program, shortening the time for reading instruction data, and reducing the execution speed. While improving
An object of the present invention is to provide a processor capable of improving the degree of diversion of a program between processors having different architectures.

【0006】[0006]

【課題を解決するための手段】本発明によれば、外部メ
モリから命令を取得し、演算を行うデータパス部に対し
て命令の発行を行う制御部を備えたプロセッサにおい
て、一つ以上の既存の命令を異なるデータで表現して定
義した定義情報を記憶する記憶手段と、取得した命令が
定義された命令か否かを判断する判断手段と、前記取得
した命令が定義された命令と判断された場合に前記記憶
手段に記憶された定義情報のデータを用いて前記データ
パス部に命令を発行する命令発行手段と、を備えること
を特徴とするプロセッサが提供される。
According to the present invention, there is provided a processor having a control unit for acquiring an instruction from an external memory and issuing the instruction to a data path unit for performing an operation. Storage means for storing definition information defined by expressing the instruction in different data, determination means for determining whether or not the obtained instruction is a defined instruction, and determining that the obtained instruction is a defined instruction. And a command issuing unit for issuing an instruction to the data path unit using the data of the definition information stored in the storage unit in the event that the processor is provided.

【0007】上記構成によれば、記憶手段に複数の命令
を一つの命令に定義した定義情報を記憶しておき、取得
した命令が定義された命令である場合には、記憶された
定義情報のデータを用いて命令を発行するように構成し
た。記憶手段に記憶される定義情報は、よく使用する命
令を短データ量で再定義することで、プロセッサ固有の
命令体系をプログラムの性質に応じて自由に変更でき
る。これにより、再定義した短データ量の命令を使用す
ることにより、プログラム全体のデータ量を少なくする
ことができ、命令の取得時間を短縮することができる。
また、複数の命令を一つの命令に定義することによりパ
イプラインの乱れが減少し、プログラムの実行速度を向
上させることができる。また、命令定義された命令のみ
を使用することで、プログラムのプロセッサ依存をなく
すことができる。
According to the above arrangement, the storage means stores definition information in which a plurality of instructions are defined as one instruction, and when the acquired instruction is a defined instruction, the stored definition information is stored in the storage means. An instruction is issued using data. The definition information stored in the storage unit can freely change the instruction system unique to the processor according to the characteristics of the program by redefining frequently used instructions with a short data amount. Thus, by using the redefined instruction having a short data amount, the data amount of the entire program can be reduced, and the acquisition time of the instruction can be shortened.
In addition, by defining a plurality of instructions as one instruction, the disturbance of the pipeline is reduced, and the execution speed of the program can be improved. Further, by using only the instruction defined by the instruction, it is possible to eliminate the dependence of the program on the processor.

【0008】[0008]

【発明の実施の形態】以下、本発明の実施の形態を図面
を参照して説明する。図1は本発明のプロセッサの構成
を示した概略ブロック図である。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a schematic block diagram showing the configuration of the processor of the present invention.

【0009】プロセッサ1は、命令の取得と命令の発行
とを行う制御部2と、命令に従って演算を実行するデー
タパス部3と、外部からプログラムなどを読み込んだり
演算結果を出力するための外部バスインタフェース部4
とから構成される。このプロセッサ1の外には、外部バ
スインタフェース部4からアドレスバス51およびデー
タバス52を介してメモリ6が接続されている。
The processor 1 includes a control unit 2 for acquiring an instruction and issuing an instruction, a data path unit 3 for executing an operation according to the instruction, and an external bus for reading a program or the like from the outside and outputting the operation result. Interface section 4
It is composed of Outside the processor 1, a memory 6 is connected from the external bus interface unit 4 via an address bus 51 and a data bus 52.

【0010】制御部2は、命令デコーダ21と、アドレ
ス生成器22と、命令発行器23とから構成され、本発
明のプロセッサでは、さらに、一つ以上の既存の命令、
すなわちプロセッサ固有の命令を異なるデータで表現し
て定義した命令の定義情報を記憶する命令定義格納メモ
リ24を備えている。
The control unit 2 comprises an instruction decoder 21, an address generator 22, and an instruction issuer 23. In the processor of the present invention, one or more existing instructions,
That is, an instruction definition storage memory 24 is provided for storing instruction definition information in which instructions unique to the processor are represented by different data and defined.

【0011】命令デコーダ21は、命令のデコードを行
い、命令実行のための内部の制御信号を作成する。アド
レス生成器22は、命令の実行アドレスを生成する。命
令発行器23は、取得した命令が定義された命令か否か
を判断し、定義された命令の場合は、命令定義格納メモ
リ24を参照し、命令デコーダ21に対して定義された
命令を発行する。そうでないときはそのままその命令を
発行する。
The instruction decoder 21 decodes an instruction and generates an internal control signal for executing the instruction. The address generator 22 generates an execution address of an instruction. The instruction issuer 23 determines whether the acquired instruction is a defined instruction. If the instruction is a defined instruction, the instruction issuer 23 refers to the instruction definition storage memory 24 and issues the defined instruction to the instruction decoder 21. I do. If not, the instruction is issued as it is.

【0012】データパス部3は、演算器31と汎用レジ
スタ32とから構成されている。演算器31は、命令デ
コーダ21からの命令に従って各種演算を行い、汎用レ
ジスタ32は、演算途中および演算結果の各種データを
格納する。
The data path unit 3 comprises an arithmetic unit 31 and a general-purpose register 32. The arithmetic unit 31 performs various operations according to the instruction from the instruction decoder 21, and the general-purpose register 32 stores various data during the operation and the operation result.

【0013】外部バスインタフェース部4は、内部の信
号を外部のバス信号に変換し、外部、ここではメモリ6
とのデータの読み書きを行う。外部のメモリ6は、命令
61とデータ62とを格納しており、外部バスインタフ
ェース部4がアドレスバス51を介して要求するアドレ
スの命令61またはデータ62をデータバス52を介し
て供給する。
The external bus interface unit 4 converts an internal signal into an external bus signal,
To read and write data. The external memory 6 stores an instruction 61 and data 62, and supplies an instruction 61 or data 62 of an address requested by the external bus interface unit 4 via the address bus 51 via the data bus 52.

【0014】以上の構成のプロセッサ1において、その
命令実行の流れをフローチャートに基づいて説明する。
図2は本発明のプロセッサの命令実行の流れを示すフロ
ーチャートである。
The flow of instruction execution in the processor 1 having the above configuration will be described with reference to flowcharts.
FIG. 2 is a flowchart showing the flow of instruction execution of the processor of the present invention.

【0015】まず、プロセッサ1は、アドレス生成器2
2が命令を取得するためのアドレスを生成する(ステッ
プS1)。アドレス生成器22によって生成されたアド
レスは、命令発行器23によって外部バスインタフェー
ス部4に出され、それに基づきメモリ6にアクセスして
メモリ6から指定アドレスを含む所定量のデータを読み
込む(ステップS2)。
First, the processor 1 includes an address generator 2
2 generates an address for acquiring an instruction (step S1). The address generated by the address generator 22 is output to the external bus interface unit 4 by the instruction issuer 23, and accesses the memory 6 based on the address to read a predetermined amount of data including the specified address from the memory 6 (step S2). .

【0016】次に、命令発行器23は、読み込んだデー
タ中の命令が命令定義を実行する命令定義実行命令かど
うかを判断し(ステップS3)、命令定義実行命令のと
きには、命令定義の新たな定義情報を命令定義格納メモ
リ24へ格納し(ステップS4)、命令定義実行命令で
なければ、ステップS4をパスする。
Next, the instruction issuer 23 determines whether the instruction in the read data is an instruction definition execution instruction for executing the instruction definition (step S3). The definition information is stored in the instruction definition storage memory 24 (step S4), and if it is not an instruction definition execution instruction, step S4 is passed.

【0017】次に、命令発行器23は、読み込んだデー
タ中の命令が定義された命令かどうかを判断する(ステ
ップS5)。ここで、読み込んだ命令が定義された命令
でなければ、命令発行器23は、読み込んだ命令をその
まま命令デコーダ21に渡す。命令デコーダ21は、渡
された命令をデコードして、内部の制御信号を生成し
(ステップS6)、データパス部3の演算器31にその
内部の制御信号を渡す。データパス部3の演算器31
は、内部の制御信号に基づき命令の実行を行い(ステッ
プS7)、実行した演算結果を汎用レジスタ32に書き
戻して(ステップS8)、一連の動作を完了する。ちな
みに、上記の動作の中で、ステップS1,S2,S6〜
S8については、従来のプロセッサが行っていた動作と
同じ動作である。
Next, the instruction issuer 23 determines whether the instruction in the read data is a defined instruction (step S5). Here, if the read instruction is not a defined instruction, the instruction issuer 23 passes the read instruction to the instruction decoder 21 as it is. The instruction decoder 21 decodes the received instruction, generates an internal control signal (Step S6), and passes the internal control signal to the arithmetic unit 31 of the data path unit 3. Arithmetic unit 31 of data path unit 3
Executes the instruction based on the internal control signal (step S7), writes the executed operation result back to the general-purpose register 32 (step S8), and completes a series of operations. By the way, in the above operation, steps S1, S2, S6 ~
S8 is the same operation as that performed by the conventional processor.

【0018】ステップS5の判断において、読み込んだ
命令が定義された命令である場合には、命令発行器23
は、命令定義格納メモリ24にアクセスして、そこから
定義された命令を読み込み(ステップS9)、その定義
された命令を使って演算を実行する。すなわち、その定
義された命令は、命令発行器23によって命令デコーダ
21に渡され、そこでデコードされ(ステップS1
0)、データパス部3の演算器31において、デコード
された命令の実行を行い(ステップS11)、実行した
演算結果を汎用レジスタ32に書き戻す(ステップS1
2)。そして、定義された命令の場合は複数の命令が定
義されている場合があるので、命令定義が終了したかど
うかが判断され(ステップS13)、終了していない場
合には、ステップS9に戻ってステップS9〜S12の
処理を繰り返し、終了していれば、ここで終了となる。
If it is determined in step S5 that the read instruction is a defined instruction, the instruction issuer 23
Accesses the instruction definition storage memory 24, reads the defined instruction therefrom (step S9), and executes an operation using the defined instruction. That is, the defined instruction is passed to the instruction decoder 21 by the instruction issuer 23, where it is decoded (step S1).
0), the arithmetic unit 31 of the data path unit 3 executes the decoded instruction (step S11), and writes the executed operation result back to the general-purpose register 32 (step S1).
2). Then, in the case of the defined instruction, since a plurality of instructions may be defined, it is determined whether or not the instruction definition is completed (step S13). If not, the process returns to step S9. The processes of steps S9 to S12 are repeated, and if completed, the process is completed here.

【0019】次に、プロセッサ1が持っている命令とプ
ログラムに記述される命令とについて、その例を挙げて
従来の場合と比較しながら説明する。図3はプロセッサ
の命令およびプログラムでの命令の例を示す図である。
Next, the instructions of the processor 1 and the instructions described in the program will be described by way of examples and in comparison with the conventional case. FIG. 3 is a diagram showing examples of instructions of a processor and instructions in a program.

【0020】ここで、プロセッサ1は、A,B,Cとい
う命令を持っているとする。従来のプログラムでの命令
は、図示のように、プロセッサ1が持っている命令を組
み合わせてプログラムができていて、そのプログラムが
たとえば「A,B,B」と「A,C,C」という順番の
命令からなる処理の単位がいくつか組み合わされて記述
されていたとする。
Here, it is assumed that the processor 1 has instructions A, B, and C. As shown in the drawing, the instructions in the conventional program are formed by combining the instructions of the processor 1 and the programs are arranged in the order of “A, B, B” and “A, C, C”. It is assumed that a description is made in combination with some units of processing consisting of these instructions.

【0021】このような場合、本発明でのプログラムの
命令では、まず、処理の単位ごとに命令定義を行う。図
示の例では、「P」という命令は、「A,B,B」を行
う、「Q」という命令は、「A,C,C」を行う、と定
義している。これにより、命令A,B,Cを持つプロセ
ッサ1は、あたかも、「ABB」とか「ACC」という
命令体系を持っているかのように振る舞うことができ
る。
In such a case, in the instruction of the program according to the present invention, first, an instruction is defined for each processing unit. In the illustrated example, the instruction “P” is defined to perform “A, B, B”, and the instruction “Q” is defined to perform “A, C, C”. As a result, the processor 1 having the instructions A, B, and C can behave as if it has the instruction system of “ABB” or “ACC”.

【0022】したがって、本発明でのプログラムの命令
は、「Pを行う」、「Qを行う」といった処理の単位ご
との命令で済むため、実行する部分の命令のデータ量が
少なくなる。読み込む命令のデータ量が少ないため、命
令の読み込み時間が短くなり、実行時間の短縮に繋がる
とともに、プログラムを格納しておくメモリ6の容量を
小さくすることができる。
Therefore, the program instructions in the present invention need only be instructions for each unit of processing such as "perform P" and "perform Q", so that the data amount of the instructions to be executed is reduced. Since the data amount of the read instruction is small, the read time of the instruction is shortened, which leads to the reduction of the execution time and the capacity of the memory 6 for storing the program can be reduced.

【0023】また、図示はしないが、キャッシュを搭載
したプロセッサでは、キャッシュに格納される命令は、
従来のプログラムでは、「ABB」および「ACC」自
体を格納してしまうのに対し、本発明でのプログラムの
場合には、命令Pおよび命令Qを格納するため、命令自
身も短くなり、キャッシュの有効利用にもなる。
Although not shown, in a processor equipped with a cache, instructions stored in the cache are:
In the conventional program, “ABB” and “ACC” are stored, whereas in the case of the program of the present invention, since the instructions P and Q are stored, the instructions themselves are also shortened, and It can be used effectively.

【0024】さらに、図示の例ではそれぞれ3つの命令
を定義した命令P、Qは、「本発明の命令コード」の欄
に示したように、ハフマン符号でそれぞれ圧縮されたコ
ードで示している。これに対し、ハフマン符号化されて
いない従来の命令コードは、すべてビット長が同じにな
っている。なお、各命令コードは、先頭に「B’」を付
して数値の表記が2進数であることを示している。
Further, in the illustrated example, the instructions P and Q each defining three instructions are represented by codes compressed by Huffman codes as shown in the column of "instruction code of the present invention". On the other hand, the conventional instruction codes that are not Huffman-coded have the same bit length. Each instruction code is prefixed with “B ′” to indicate that the numerical notation is a binary number.

【0025】このように、命令の定義情報が圧縮されて
格納されている場合、この定義された命令を読み込む命
令発行器23には、圧縮されたデータを伸長する機能を
備えており、命令発行器23は、読み込んだ命令を伸長
してから命令デコーダ21に渡すことになる。
As described above, when the definition information of an instruction is stored in a compressed form, the instruction issuer 23 for reading the defined instruction has a function of expanding the compressed data. The unit 23 decompresses the read instruction and passes it to the instruction decoder 21.

【0026】また、本発明でのプログラムでは、定義部
分の後に記述される実行部分において、命令P、Qの命
令コードの符号長を命令の出現頻度に依存するようにし
ている。図示の例では、プログラムの命令の中で命令Q
の数が命令Pの数よりも多いため、命令Qの符号長は命
令Pの符号長よりも短くなっている。
In the program according to the present invention, the code lengths of the instruction codes of the instructions P and Q in the execution part described after the definition part depend on the frequency of appearance of the instructions. In the example shown in FIG.
Is greater than the number of instructions P, the code length of instruction Q is shorter than the code length of instruction P.

【0027】図4は別のプロセッサの命令およびプログ
ラムでの命令の例を示す図である。ここで、プロセッサ
1aは、D,E,Fという命令を持っているとする。従
来のプログラムでの命令は、このプロセッサ1aが持っ
ている命令を組み合わせてプログラムができていて、そ
のプログラムがたとえば「D,E,E」と「D,F,
F」という順番の命令からなる処理の単位がいくつか組
み合わせて記述されていたとする。
FIG. 4 is a diagram showing examples of instructions of another processor and instructions in a program. Here, it is assumed that the processor 1a has instructions D, E, and F. Instructions in the conventional program are programmed by combining instructions of the processor 1a, and the program is composed of, for example, "D, E, E" and "D, F,
It is assumed that a unit of processing consisting of instructions in the order of "F" is described in combination.

【0028】このプロセッサ1aのためのプログラムの
場合、図3に示したプログラムと比較して、従来プログ
ラムでの命令はまったく同様の部分がないことが分か
る。しかし、プロセッサ1およびプロセッサ1aの本発
明でのプログラムの欄を比較すると分かるように、命令
の定義部分以外はまったく同じである。このように、プ
ログラムを定義部分と実行部分とを分けた構成にしたこ
とで、定義部分だけを書き替えることによって、別のプ
ロセッサ1aで動作するプログラムを作ることができ
る。したがって、プロセッサ1用のプログラムをプロセ
ッサ1a用のものに移植する際には、基本的には定義部
分の変更だけで済むことになる。
In the case of the program for the processor 1a, it can be seen that the instructions in the conventional program do not have exactly the same parts as compared with the program shown in FIG. However, as can be seen by comparing the columns of the program of the present invention between the processor 1 and the processor 1a, they are exactly the same except for the definition part of the instruction. As described above, by dividing the program into the definition part and the execution part, it is possible to create a program that operates on another processor 1a by rewriting only the definition part. Therefore, when a program for the processor 1 is ported to a program for the processor 1a, basically, only the definition part needs to be changed.

【0029】しかも、例に挙げたプログラムのように非
常に単純なものでない場合には、プログラムは、命令の
定義より命令実行が圧倒的に多くなり、同じ部分がほと
んどとなる。よって、プロセッサ1で動作していたプロ
グラムをプロセッサ1aで動作させたい場合、命令定義
の部分を変更するだけで、動作をさせることができるよ
うになるため、プログラムの流用性が大幅に高まる。
In addition, when the program is not very simple, such as the program described in the example, the execution of the program is overwhelmingly larger than the definition of the instruction, and the program is almost the same. Therefore, when a program that has been operating on the processor 1 is to be operated on the processor 1a, the operation can be performed only by changing the instruction definition portion, and the applicability of the program is greatly increased.

【0030】なお、上記の実施の形態では、すべての定
義情報を命令定義格納メモリ24に格納するようにした
が、たとえばタスクあるいは命令の体系が変わったとき
に、この命令定義格納メモリ24に全部入り切らない場
合がある。定義情報が命令定義格納メモリ24の記憶容
量を越えて入力されるような場合には、今まで使ってい
た定義情報を一旦外部のメモリに待避しておき、必要な
ときに、命令定義格納メモリ24に書き戻すようにして
もよい。この場合、たとえば命令発行器23が命令定義
格納メモリ24の空き容量および新たに読み込んだ定義
情報のデータ量を監視していて、命令定義格納メモリ2
4に新たに読み込んだ定義情報を格納できない場合に、
格納されていた定義情報を外部のメモリ、たとえばメモ
リ6に移動したり、あるいは、必要時に、待避していた
定義情報をメモリ6から命令定義格納メモリ24に移し
替えたりするようにしてもよい。
In the above embodiment, all the definition information is stored in the instruction definition storage memory 24. However, when the task or instruction system changes, for example, all the definition information is stored in the instruction definition storage memory 24. May not fit. If the definition information is input beyond the storage capacity of the instruction definition storage memory 24, the definition information used so far is temporarily saved in an external memory, and the instruction definition storage memory is stored when necessary. 24. In this case, for example, the instruction issuer 23 monitors the free space of the instruction definition storage memory 24 and the data amount of the newly read definition information.
4 cannot store the newly read definition information,
The stored definition information may be moved to an external memory, for example, the memory 6, or the saved definition information may be transferred from the memory 6 to the instruction definition storage memory 24 when necessary.

【0031】また、上記の実施の形態では、命令定義格
納メモリ24に格納される定義情報をハフマン符号で圧
縮した例を示したが、圧縮符号として算術符号を用いて
もよい。
Further, in the above-described embodiment, an example in which the definition information stored in the instruction definition storage memory 24 is compressed by the Huffman code is shown, but an arithmetic code may be used as the compression code.

【0032】また、上記の実施の形態では、プログラム
の実行部分にある命令P、Qの命令コードの符号長を命
令の出現頻度に依存するようにしたが、その符号長は、
実行頻度に依存した形にしてもよい。
In the above embodiment, the code lengths of the instruction codes of the instructions P and Q in the execution part of the program depend on the frequency of occurrence of the instructions.
The form may depend on the execution frequency.

【0033】さらに、本発明によるプロセッサの構成
は、プロセッサ単体に限定されるものではなく、その周
辺処理機能を含んだマイクロプロセッサ、プログラムを
内蔵したマイクロコントローラなどにも同じように適用
することができる。
Further, the configuration of the processor according to the present invention is not limited to a single processor, but can be similarly applied to a microprocessor having a peripheral processing function, a microcontroller having a built-in program, and the like. .

【0034】また、図2に示すようなプロセッサが有す
べき機能の処理内容は、プロセッサで読み取り可能な記
録媒体、たとえばROM(Read Only Memory)に記録され
たプログラムに記述させておくことができる。このプロ
グラムをプロセッサで実行することにより、上記処理が
プロセッサで実現できる。なお、メモリ6内の命令61
およびデータ62については、このプロセッサ1が搭載
された装置内の記憶装置に格納されているプログラムあ
るいはネットワークを通じて他の装置の記憶装置から転
送されたプログラムとすることができる。
The processing contents of the functions that the processor should have as shown in FIG. 2 can be described in a recording medium readable by the processor, for example, a program recorded in a ROM (Read Only Memory). . By executing this program with a processor, the above processing can be realized with the processor. The instruction 61 in the memory 6
The data 62 can be a program stored in a storage device in a device in which the processor 1 is mounted, or a program transferred from a storage device of another device through a network.

【0035】[0035]

【発明の効果】以上説明したように本発明では、一つ以
上の既存の命令を異なるデータで表現して定義した定義
情報を記憶する記憶手段を備え、取得した命令が定義さ
れた命令の場合に記憶手段を参照し、定義情報のデータ
を用いて命令を発行するように構成にした。これによ
り、よく使用する複数の命令を短データ量で定義して記
憶手段に記憶しておき、プログラムの命令には、その定
義して記憶した命令を使用することにより、プログラム
全体のデータ量を少なくすることができ、命令データの
読み込み時間を短縮することができるようになる。
As described above, according to the present invention, there is provided storage means for storing definition information in which one or more existing instructions are represented by different data and defined, and the acquired instruction is a defined instruction. The configuration is such that an instruction is issued using the data of the definition information by referring to the storage means. In this way, a plurality of frequently used instructions are defined in a short data amount and stored in the storage means, and the program instruction uses the defined and stored instruction to reduce the data amount of the entire program. Thus, the read time of the instruction data can be reduced.

【0036】また、プログラムにより各命令の使用頻度
は異なるため、タスクやプログラムの処理の性質が変化
した時点で、命令定義を変更することにより、より命令
データ量を減少させることができる。
Since the frequency of use of each instruction differs depending on the program, the amount of instruction data can be further reduced by changing the definition of the instruction when the nature of the processing of the task or the program changes.

【0037】また、従来、複数命令を共通化するため分
岐して行っていた処理を一つの命令に定義することによ
り、フェッチのやり直しなどによるパイプラインの乱れ
と、命令のデータ量が減少し、実行速度を向上すること
ができる。
In addition, by defining the processing which has been conventionally performed in a branching manner in order to make a plurality of instructions common, into one instruction, the disturbance of the pipeline due to the re-fetching and the like and the data amount of the instruction are reduced. Execution speed can be improved.

【0038】また、プロセッサで実行可能なプログラム
は、命令定義部とプログラム本体とに分け、命令定義部
のみを書き替えることで、プログラムのプロセッサ依存
を解消することができ、命令定義部を変更するだけで他
のプロセッサで実行可能となる。
The program executable by the processor is divided into an instruction definition part and a program body, and by rewriting only the instruction definition part, the dependence of the program on the processor can be eliminated, and the instruction definition part is changed. Just be able to run on other processors.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明のプロセッサの構成を示した概略ブロッ
ク図である。
FIG. 1 is a schematic block diagram showing a configuration of a processor according to the present invention.

【図2】本発明のプロセッサの命令実行の流れを示すフ
ローチャートである。
FIG. 2 is a flowchart showing a flow of instruction execution of the processor of the present invention.

【図3】プロセッサの命令およびプログラムでの命令の
例を示す図である。
FIG. 3 is a diagram showing an example of an instruction of a processor and an instruction in a program.

【図4】別のプロセッサの命令およびプログラムでの命
令の例を示す図である。
FIG. 4 is a diagram illustrating an example of an instruction of another processor and an instruction in a program.

【符号の説明】[Explanation of symbols]

1……プロセッサ、2……制御部、3……データパス
部、4……外部バスインタフェース部、6……メモリ、
21……命令デコーダ、22……アドレス生成器、23
……命令発行器、24……命令定義格納メモリ、31…
…演算器、32……汎用レジスタ、51……アドレスバ
ス、52……データバス。
1 ... processor 2 ... control unit 3 ... data path unit 4 ... external bus interface unit 6 ... memory
21 ... instruction decoder, 22 ... address generator, 23
.... Instruction issuer, 24 .... Instruction definition storage memory, 31 ...
.. Arithmetic unit, 32 general-purpose register, 51 address bus, 52 data bus.

Claims (10)

【特許請求の範囲】[Claims] 【請求項1】 外部メモリから命令を取得し、演算を行
うデータパス部に対して命令の発行を行う制御部を備え
たプロセッサにおいて、 一つ以上の既存の命令を異なるデータで表現して定義し
た定義情報を記憶する記憶手段と、 取得した命令が定義された命令か否かを判断する判断手
段と、 前記取得した命令が定義された命令と判断された場合に
前記記憶手段に記憶された定義情報のデータを用いて前
記データパス部に命令を発行する命令発行手段と、 を備えることを特徴とするプロセッサ。
1. A processor having a control unit for acquiring an instruction from an external memory and issuing the instruction to a data path unit for performing an operation, wherein one or more existing instructions are represented by different data and defined. Storage means for storing the obtained definition information; determining means for determining whether the obtained instruction is a defined instruction; and storing the information in the storage means when the obtained instruction is determined to be the defined instruction. An instruction issuing means for issuing an instruction to the data path unit using data of definition information.
【請求項2】 命令を読み込むアドレスを生成するアド
レス生成器、生成された指定アドレスを含むデータを読
み込んで命令を発行する命令発行器および発行された命
令をデコードする命令デコーダを有する制御部と、前記
命令デコーダから発行された命令に基づいて命令を実行
するデータパス部とを備えたプロセッサにおいて、 前記制御部に、一つ以上の既存の命令を異なるデータで
表現して定義した命令の定義情報を記憶する命令定義格
納メモリを有し、 前記命令発行器は、読み込んだデータ中の命令が定義さ
れた命令か否かを判断し、定義された命令の場合には前
記命令定義格納メモリに記憶された前記定義情報のデー
タ中の命令を用い、読み込んだデータ中の命令が定義さ
れた命令でない場合には読み込んだデータ中の命令を用
いて命令を発行する機能を有していることを特徴とする
プロセッサ。
A control unit having an address generator for generating an address for reading the instruction, an instruction issuer for reading data including the generated specified address and issuing the instruction, and an instruction decoder for decoding the issued instruction; A data path unit for executing an instruction based on an instruction issued from the instruction decoder, wherein the control unit includes one or more existing instructions defined by different data. The instruction issuer determines whether an instruction in the read data is a defined instruction, and stores the instruction in the instruction definition storage memory if the instruction is a defined instruction. Using the instructions in the data of the defined information, and using the instructions in the read data if the instructions in the read data are not the defined instructions. Processor, characterized by having a function of issuing a decree.
【請求項3】 前記命令発行器は、読み込んだデータ中
の命令が命令定義を実行する命令定義実行命令の場合
に、前記命令定義の新たな定義情報を前記命令定義格納
メモリに格納する格納機能を有することを特徴とする請
求項1記載のプロセッサ。
3. A storage function for storing new definition information of the instruction definition in the instruction definition storage memory when the instruction in the read data is an instruction definition execution instruction for executing the instruction definition. The processor of claim 1, comprising:
【請求項4】 前記命令定義格納メモリに記憶される定
義情報のデータは圧縮符号であり、前記命令発行器は定
義情報のデータを伸長するデータ伸長機能を有している
ことを特徴とする請求項2記載のプロセッサ。
4. The data of the definition information stored in the instruction definition storage memory is a compression code, and the instruction issuer has a data decompression function of decompressing the data of the definition information. Item 3. The processor according to Item 2.
【請求項5】 前記圧縮符号は、ハフマン符号または算
術符号であることを特徴とする請求項4記載のプロセッ
サ。
5. The processor according to claim 4, wherein said compression code is a Huffman code or an arithmetic code.
【請求項6】 前記定義された命令に対する実行命令
は、符号長がプログラムでの出現頻度または実行頻度に
依存することを特徴とする請求項3記載のプロセッサ。
6. The processor according to claim 3, wherein the code length of the execution instruction corresponding to the defined instruction depends on the frequency of appearance or execution in a program.
【請求項7】 前記命令発行器は、前記命令定義格納メ
モリから前記命令の定義情報を前記プロセッサの外部に
読み出したり、前記プロセッサの外部から前記命令の定
義情報を前記命令定義格納メモリに書き込む機能を有し
ていることを特徴とする請求項2記載のプロセッサ。
7. The function of the instruction issuer to read the definition information of the instruction from the instruction definition storage memory to the outside of the processor, and to write the definition information of the instruction to the instruction definition storage memory from the outside of the processor. The processor according to claim 2, comprising:
【請求項8】 命令に従って動作を行うプロセッサの動
作方法において、 命令を読み込むアドレスを生成し、 生成された指定アドレスを含むデータを読み込み、 読み込んだデータ中の命令が命令定義を実行する命令定
義実行命令か否かを判断し、 読み込んだデータ中の命令が前記命令定義実行命令のと
きには一つ以上の既存の命令を異なるデータで表現して
定義した定義情報を記憶し、 読み込んだデータ中の命令が定義した命令か否かを判断
し、 読み込んだデータ中の命令が定義された命令の場合に記
憶された前記定義情報のデータ中の命令を用い、読み込
んだ命令が定義された命令でない場合には読み込んだ命
令を用いて演算実行の命令を発行する、 ようにしたことを特徴とするプロセッサの動作方法。
8. A method of operating a processor that operates in accordance with an instruction, comprising: generating an address for reading the instruction; reading data including the generated specified address; and executing an instruction definition in which the instruction in the read data executes the instruction definition. It is determined whether or not the instruction is an instruction. When the instruction in the read data is the instruction definition execution instruction, the definition information in which one or more existing instructions are represented by different data is stored, and the instruction in the read data is stored. Judge whether the instruction is a defined instruction, use the instruction in the data of the definition information stored when the instruction in the read data is a defined instruction, and when the read instruction is not the defined instruction Issuing an operation execution instruction using the read instruction.
【請求項9】 プロセッサに、命令を読み込むアドレス
を生成し、生成された指定アドレスを含むデータを読み
込み、読み込んだデータ中の命令が命令定義を実行する
命令定義実行命令か否かを判断し、読み込んだデータ中
の命令が前記命令定義実行命令のときには一つ以上の既
存の命令を異なるデータで表現して定義した定義情報を
記憶し、読み込んだデータ中の命令が定義した命令か否
かを判断し、読み込んだデータ中の命令が定義された命
令の場合に記憶された前記定義情報のデータ中の命令を
用い、読み込んだ命令が定義された命令でない場合には
読み込んだ命令を用いて演算実行の命令を発行する手順
を実行させるためのプログラムを記録したプロセッサ読
み取り可能な記録媒体。
9. A processor generates an address for reading an instruction, reads data including the generated specified address, and determines whether an instruction in the read data is an instruction definition execution instruction for executing an instruction definition. When the instruction in the read data is the instruction definition execution instruction, one or more existing instructions are represented by different data to store definition information, and whether the instruction in the read data is the defined instruction is determined. Judgment is performed using the instruction in the data of the stored definition information when the instruction in the read data is a defined instruction, and using the read instruction when the read instruction is not the defined instruction. A processor-readable recording medium recording a program for executing a procedure for issuing an execution instruction.
【請求項10】 プロセッサに、命令を読み込むアドレ
スを生成し、生成された指定アドレスを含むデータを読
み込み、読み込んだデータ中の命令が命令定義を実行す
る命令定義実行命令か否かを判断し、読み込んだデータ
中の命令が前記命令定義実行命令のときには一つ以上の
既存の命令を異なるデータで表現して定義した定義情報
を記憶し、読み込んだデータ中の命令が定義した命令か
否かを判断し、読み込んだデータ中の命令が定義された
命令の場合に記憶された前記定義情報のデータ中の命令
を用い、読み込んだ命令が定義された命令でない場合に
は読み込んだ命令を用いて演算実行の命令を発行する手
順を実行させるためのプログラム。
10. A processor generates an address for reading an instruction, reads data including the generated specified address, and determines whether an instruction in the read data is an instruction definition execution instruction for executing an instruction definition. When the instruction in the read data is the instruction definition execution instruction, one or more existing instructions are represented by different data to store definition information, and whether the instruction in the read data is the defined instruction is determined. Judgment is performed using the instruction in the data of the stored definition information when the instruction in the read data is a defined instruction, and using the read instruction when the read instruction is not the defined instruction. A program for executing a procedure for issuing an execution instruction.
JP2001121308A 2001-04-19 2001-04-19 Processor Abandoned JP2002318686A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2001121308A JP2002318686A (en) 2001-04-19 2001-04-19 Processor
PCT/JP2002/003930 WO2002086652A1 (en) 2001-04-19 2002-04-19 Processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001121308A JP2002318686A (en) 2001-04-19 2001-04-19 Processor

Publications (1)

Publication Number Publication Date
JP2002318686A true JP2002318686A (en) 2002-10-31

Family

ID=18971211

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001121308A Abandoned JP2002318686A (en) 2001-04-19 2001-04-19 Processor

Country Status (2)

Country Link
JP (1) JP2002318686A (en)
WO (1) WO2002086652A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006293673A (en) * 2005-04-11 2006-10-26 Toshiba Corp Microprocessor and its control method
JP2010130407A (en) * 2008-11-28 2010-06-10 Sony Corp Arithmetic decoding apparatus
JP2014056446A (en) * 2012-09-12 2014-03-27 Hitachi Information & Telecommunication Engineering Ltd Microprocessor, and compile processing method of program
CN104346133A (en) * 2013-08-01 2015-02-11 晶心科技股份有限公司 Method for compressing instruction and processor for executing compressed instruction

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01276233A (en) * 1988-04-27 1989-11-06 Nec Corp Microprocessor
JPH04370832A (en) * 1991-06-19 1992-12-24 Nec Corp Processor circuit
JPH06348490A (en) * 1993-06-08 1994-12-22 Hitachi Ltd Arithmetic processing method and microcomputer
JPH08194614A (en) * 1995-01-19 1996-07-30 Nec Corp Microcomputer
JP3201716B2 (en) * 1996-02-22 2001-08-27 シャープ株式会社 Computer equipment

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006293673A (en) * 2005-04-11 2006-10-26 Toshiba Corp Microprocessor and its control method
JP2010130407A (en) * 2008-11-28 2010-06-10 Sony Corp Arithmetic decoding apparatus
JP2014056446A (en) * 2012-09-12 2014-03-27 Hitachi Information & Telecommunication Engineering Ltd Microprocessor, and compile processing method of program
CN104346133A (en) * 2013-08-01 2015-02-11 晶心科技股份有限公司 Method for compressing instruction and processor for executing compressed instruction
JP2015038728A (en) * 2013-08-01 2015-02-26 晶心科技股▲ふん▼有限公司Andes Technology Corporation Method for compressing instruction and processor for executing compressed instruction
US9672041B2 (en) 2013-08-01 2017-06-06 Andes Technology Corporation Method for compressing variable-length instructions including PC-relative instructions and processor for executing compressed instructions using an instruction table

Also Published As

Publication number Publication date
WO2002086652A1 (en) 2002-10-31

Similar Documents

Publication Publication Date Title
JP3556556B2 (en) Instruction code conversion device and information processing system
US6301702B1 (en) Program execution apparatus and program conversion method
US20030033504A1 (en) Micro-controller for reading out compressed instruction code and program memory for compressing instruction code and storing therein
JPH0916471A (en) Processor
US10698854B1 (en) Secure and efficient application data processing
JP2773471B2 (en) Information processing device
CA3131257A1 (en) Spilling temporary results for accommodation of memory boundaries
JP2002318686A (en) Processor
US20080282071A1 (en) Microprocessor and register saving method
US6237080B1 (en) Executable programs
WO2020174300A1 (en) Functional completion when retrying non-interruptible instruction in bi-modal execution environment
JP3570287B2 (en) Microcomputer
JP7430195B2 (en) Maintaining compatibility of complex functionality across multiple machine generations
JP2011044163A (en) Expanded functionality of processor operation within fixed width instruction encoding
JP2001142696A (en) Instruction supplying device in microprocessor and instruction supplying method
JPH11163736A (en) Processor
JPH0713758A (en) Instruction decoding method
KR950003884B1 (en) Personal computer bus interface circuit
JPH05250156A (en) Risc processor
JPH08263263A (en) Data processor and compressed program generation device
JPH03277069A (en) Compression expansion controller
JPH05108478A (en) Memory access method
JPH08110901A (en) Microprocessor
JP2003015866A (en) Processor
JP2002229802A (en) Program converter, processor, storage device, and program

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040713

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040910

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20041005

A762 Written abandonment of application

Free format text: JAPANESE INTERMEDIATE CODE: A762

Effective date: 20041203