JP2005092467A - Processor and interrupt control method for the same - Google Patents

Processor and interrupt control method for the same Download PDF

Info

Publication number
JP2005092467A
JP2005092467A JP2003323783A JP2003323783A JP2005092467A JP 2005092467 A JP2005092467 A JP 2005092467A JP 2003323783 A JP2003323783 A JP 2003323783A JP 2003323783 A JP2003323783 A JP 2003323783A JP 2005092467 A JP2005092467 A JP 2005092467A
Authority
JP
Japan
Prior art keywords
instruction
vector
processing
interrupt
execution
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2003323783A
Other languages
Japanese (ja)
Other versions
JP4063182B2 (en
Inventor
Mitsunari Todoroki
晃成 轟
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.)
Seiko Epson Corp
Original Assignee
Seiko Epson 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 Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2003323783A priority Critical patent/JP4063182B2/en
Publication of JP2005092467A publication Critical patent/JP2005092467A/en
Application granted granted Critical
Publication of JP4063182B2 publication Critical patent/JP4063182B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To execute safe interrupt handling in a processor highly responsively. <P>SOLUTION: Upon an external interrupt during the processing of a vector instruction, the processor 1 holds external interrupt handling until finishing the vector instruction processing. The external interrupt handling is executed after the vector instruction processing in progress is finished. This can prevent the situation wherein interrupt handling causes incorrect values of a vector instruction computation result to enable the safe execution of interrupt handling. A vector instruction execution detection part 109 implemented as hardware in the processor 1 detects whether a vector instruction is processed or not, and according to the detection result, the execution of interrupt handling is controlled. This can provide higher processing responsiveness than the software control of interrupt handling. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、割り込み処理を行うプロセッサおよびその割り込み制御方法に関する。   The present invention relates to a processor that performs interrupt processing and an interrupt control method thereof.

従来、ベクトル命令やマルチサイクル命令といった複数サイクルにわたる命令を実行可能なプロセッサにおいて、割り込み処理が行われている。
このような割り込み処理には、プロセッサ外部から入力される外部割込み処理と、プロセッサ内部において発生する例外処理とがある。
図12は、割り込み処理を実行可能な従来のプロセッサ200の構成を示す図である。
Conventionally, interrupt processing is performed in a processor capable of executing an instruction over a plurality of cycles such as a vector instruction and a multi-cycle instruction.
Such interrupt processing includes external interrupt processing input from outside the processor and exception processing that occurs inside the processor.
FIG. 12 is a diagram showing a configuration of a conventional processor 200 capable of executing interrupt processing.

図12において、プロセッサ200は、フェッチ部201と、デコード部202と、ALU(Arithmetic and Logical Unit)部203と、乗算部204と、加減算部205と、ロード部206と、ストア部207と、レジスタファイル部208と、プログラム制御部209と、例外管理部210と、外部割り込み制御部211とを含んで構成される。
フェッチ部201は、不図示のメモリから命令コードをフェッチする。そして、フェッチ部201は、フェッチした命令コードを一時的に記憶した後、デコード部202に出力する。
In FIG. 12, a processor 200 includes a fetch unit 201, a decode unit 202, an ALU (Arithmetic and Logical Unit) unit 203, a multiplication unit 204, an addition / subtraction unit 205, a load unit 206, a store unit 207, and a register. A file unit 208, a program control unit 209, an exception management unit 210, and an external interrupt control unit 211 are configured.
The fetch unit 201 fetches an instruction code from a memory (not shown). The fetch unit 201 temporarily stores the fetched instruction code, and then outputs the instruction code to the decoding unit 202.

デコード部202は、フェッチ部201から入力された命令コードをデコードし、デコード結果を、ALU部203、乗算部204、加減算部205、ロード部206およびストア部207に出力する。また、デコード部202は、同様に、デコード結果をプログラム制御部209に出力する。
ALU部203は、デコード部202から入力されたデコード結果が論理演算である場合に、デコード結果に基づいて、レジスタファイル部208から演算するデータを読み出す。そして、ALU部203は、読み出したデータの論理演算を実行し、演算結果をレジスタファイル部208に出力する。
The decoding unit 202 decodes the instruction code input from the fetch unit 201 and outputs the decoding result to the ALU unit 203, the multiplication unit 204, the addition / subtraction unit 205, the load unit 206, and the store unit 207. Similarly, the decoding unit 202 outputs the decoding result to the program control unit 209.
When the decoding result input from the decoding unit 202 is a logical operation, the ALU unit 203 reads data to be calculated from the register file unit 208 based on the decoding result. Then, the ALU unit 203 performs a logical operation on the read data and outputs the operation result to the register file unit 208.

乗算部204は、デコード部202から入力されたデコード結果が乗算である場合に、デコード結果に基づいて、レジスタファイル部208から乗算するデータを読み出す。そして、乗算部204は、読み出したデータの乗算を実行し、乗算結果をレジスタファイル部208に出力する。
加減算部205は、デコード部202から入力されたデコード結果が加算あるいは減算である場合に、デコード結果に基づいて、レジスタファイル部208から加算あるいは減算するデータを読み出す。そして、加減算部205は、読み出したデータの加算あるいは減算を実行し、加減算結果をレジスタファイル部208に出力する。
When the decoding result input from the decoding unit 202 is multiplication, the multiplication unit 204 reads data to be multiplied from the register file unit 208 based on the decoding result. Then, the multiplication unit 204 performs multiplication of the read data and outputs the multiplication result to the register file unit 208.
The addition / subtraction unit 205 reads data to be added or subtracted from the register file unit 208 based on the decoding result when the decoding result input from the decoding unit 202 is addition or subtraction. Then, the addition / subtraction unit 205 performs addition or subtraction of the read data, and outputs the addition / subtraction result to the register file unit 208.

ロード部206は、デコード部202から入力されたデコード結果がロード命令である場合に、デコード結果に基づいて、ロード命令の対象となるアドレスをメモリに出力する。そして、ロード部206は、そのアドレスのデータがメモリから入力されると、入力されたデータをレジスタファイル部208に出力する。
ストア部207は、デコード部202から入力されたデコード結果がストア命令である場合に、デコード結果に基づいて、ストア命令の対象となるデータをレジスタファイル部208から読み出す。そして、ストア部207は、ストア命令の対象となるアドレスおよびレジスタファイル部208から読み出したデータをメモリに出力する。
When the decoding result input from the decoding unit 202 is a load instruction, the load unit 206 outputs an address that is a target of the load instruction to the memory based on the decoding result. Then, when the data at the address is input from the memory, the load unit 206 outputs the input data to the register file unit 208.
When the decoding result input from the decoding unit 202 is a store instruction, the store unit 207 reads data that is the target of the store instruction from the register file unit 208 based on the decoding result. Then, the store unit 207 outputs the address that is the target of the store instruction and the data read from the register file unit 208 to the memory.

レジスタファイル部208は、所定数のスカラレジスタおよびベクトルレジスタを備え、ALU部203、乗算部204、加減算部205、ロード部206およびストア部207の演算対象となるデータを記憶する。また、レジスタファイル部208には、プログラム制御部209から、データの読み出しあるいは書き込みを行うための制御信号が入力される。   The register file unit 208 includes a predetermined number of scalar registers and vector registers, and stores data to be operated by the ALU unit 203, the multiplication unit 204, the addition / subtraction unit 205, the load unit 206, and the store unit 207. Further, a control signal for reading or writing data is input from the program control unit 209 to the register file unit 208.

プログラム制御部209は、プロセッサ200全体を制御するものであり、プログラムカウンタ209aと、ステータスレジスタ209bと、割り込み処理用プログラムカウンタ209cと、割り込みベクタ209dとを含んで構成される。
プログラムカウンタ(PC)209aは、次に実行するプログラムのアドレスを記憶するレジスタである。
The program control unit 209 controls the entire processor 200, and includes a program counter 209a, a status register 209b, an interrupt processing program counter 209c, and an interrupt vector 209d.
The program counter (PC) 209a is a register that stores an address of a program to be executed next.

ステータスレジスタ(ST)209bは、プロセッサ200の動作状態に関するデータを記憶している。例えば、ステータスレジスタ209bは、割り込み処理を許可する状態であるか否かを示す割り込み許可フラグ(MIE)や、割り込み処理の発生時に、割り込み処理発生前の割り込み許可フラグを記憶しておく退避用許可フラグ(PMIE)を記憶している。   The status register (ST) 209b stores data related to the operating state of the processor 200. For example, the status register 209b saves an interrupt permission flag (MIE) indicating whether or not interrupt processing is permitted, and an interrupt permission flag that stores an interrupt permission flag before the occurrence of interrupt processing when the interrupt processing occurs. The flag (PMIE) is stored.

割り込み処理用プログラムカウンタ(EPC)209cは、割り込み処理が発生した場合に、プログラムカウンタ209aに記憶されているアドレスを退避しておくためのレジスタである。
割り込みベクタ209dは、割り込み処理の種類に応じた分岐先のプログラムのアドレスをテーブル形式で記憶している。
The interrupt processing program counter (EPC) 209c is a register for saving an address stored in the program counter 209a when interrupt processing occurs.
The interrupt vector 209d stores a branch destination program address corresponding to the type of interrupt processing in a table format.

このような構成によって、プログラム制御部209は、デコード部202から入力されるデコード結果に基づいて、レジスタファイル部208におけるデータの読み出しあるいは書き込みを制御したり、次に実行するプログラムが記憶されたアドレスをメモリに出力したりする。
また、プログラム制御部209は、プロセッサ200の演算内容を示す信号を例外管理部210に出力し、例外管理部210から例外処理であることを示す信号が入力された場合、割り込み処理を実行する。
With this configuration, the program control unit 209 controls the reading or writing of data in the register file unit 208 based on the decoding result input from the decoding unit 202, or stores the program to be executed next. Or output to memory.
In addition, the program control unit 209 outputs a signal indicating the calculation contents of the processor 200 to the exception management unit 210, and executes an interrupt process when a signal indicating exception processing is input from the exception management unit 210.

さらに、プログラム制御部209は、プロセッサの動作状態を示す信号を外部割り込み制御部211に出力する。また、プログラム制御部209は、外部割り込み制御部211から割り込み処理の要因と、割り込みレベルとが入力された場合、外部割り込みの実行が可能な動作状態であれば、割り込み処理を実行する。
例外管理部210は、プログラム制御部209から入力される演算内容を示す信号に基づいて、その演算において、アドレス例外(アドレスの参照範囲の違反)、予約命令例外(定義されていない命令の入力)および零除算等の内部例外が発生しているか否かを検出する。そして、例外管理部210は、内部例外が発生している場合、発生している内部例外に対応する例外処理を示す信号をプログラム制御部209に出力する。
Further, the program control unit 209 outputs a signal indicating the operation state of the processor to the external interrupt control unit 211. Further, the program control unit 209 executes interrupt processing if an interrupt processing factor and an interrupt level are input from the external interrupt control unit 211 and the external control unit 209 is in an operating state capable of executing external interrupts.
Based on the signal indicating the calculation contents input from the program control unit 209, the exception management unit 210 performs an address exception (violation of the address reference range) and a reserved instruction exception (input of an undefined instruction) in the calculation. And whether or not an internal exception such as division by zero has occurred. Then, when an internal exception occurs, the exception management unit 210 outputs a signal indicating exception processing corresponding to the generated internal exception to the program control unit 209.

外部割り込み制御部211は、プロセッサ200に接続された各種デバイスから入力される外部割り込みの要求信号を受け取る。そして、外部割り込み制御部211は、受け取った外部割り込みの要求信号に基づいて、割り込み処理の要因と、割り込みレベルとをプログラム制御部209に出力する。
以上のような構成において、プロセッサ200は、例外処理あるいは外部割り込みのいずれかの割り込み処理が発生すると、図13に示すように、実行中の命令に関するデータを一旦退避させ、割り込み処理を実行する。具体的には、図13において、通常のプログラムの実行中に割り込み処理が発生すると、プロセッサ200は、退避用許可フラグ(PMIE)に割り込み許可フラグ(MIE)をセットし、割り込み許可フラグには、割り込みの禁止を示す“0”をセットする。また、プロセッサ200は、割り込み処理用プログラムカウンタ209cにプログラムカウンタ209aの値をセットし、プログラムカウンタ209aに割り込み処理の命令を示すアドレスをセットする。
The external interrupt control unit 211 receives an external interrupt request signal input from various devices connected to the processor 200. Then, the external interrupt control unit 211 outputs the interrupt processing factor and the interrupt level to the program control unit 209 based on the received external interrupt request signal.
In the configuration as described above, when an interrupt process such as an exception process or an external interrupt occurs, the processor 200 temporarily saves data related to the instruction being executed and executes the interrupt process as shown in FIG. Specifically, in FIG. 13, when an interrupt process occurs during execution of a normal program, the processor 200 sets an interrupt permission flag (MIE) in the save permission flag (PMIE), and the interrupt permission flag includes Set “0” to indicate that interrupt is prohibited. Further, the processor 200 sets the value of the program counter 209a in the interrupt processing program counter 209c, and sets an address indicating an interrupt processing instruction in the program counter 209a.

そして、プロセッサ200は、割り込み処理を実行し、その後、退避させていたデータを復帰させ、割り込み処理の発生前に実行していた処理を継続する。即ち、退避用許可フラグの値を割り込み許可フラグに戻し、割り込み処理用プログラムカウンタ209cに退避していたアドレスをプログラムカウンタ209aに戻す。そして、割り込み処理前の動作を再開する。   Then, the processor 200 executes the interrupt process, and thereafter restores the saved data, and continues the process that was being executed before the occurrence of the interrupt process. That is, the value of the save enable flag is returned to the interrupt enable flag, and the address saved in the interrupt processing program counter 209c is returned to the program counter 209a. Then, the operation before the interrupt process is resumed.

ここで、ベクトル命令やマルチサイクル命令のように、実行結果が得られるまでに複数サイクルを要する処理を実行している状態で割り込み処理が発生すると、割り込み処理の実行後、割り込み処理の発生前に実行していた処理が適切に継続できない場合があった。
例えば、ベクトル命令の演算結果をスカラレジスタに書き込み、その演算結果を順にストアしていく処理の実行中に割り込み処理が発生したとする。
Here, if an interrupt process occurs while executing a process that requires multiple cycles until an execution result is obtained, such as a vector instruction or a multi-cycle instruction, after the interrupt process is executed, before the interrupt process occurs The process that was being executed could not continue properly.
For example, it is assumed that an interrupt process occurs during execution of a process of writing the operation result of a vector instruction to a scalar register and storing the operation result in order.

このとき、割り込み処理が発生しなければ、スカラレジスタに書き込まれた演算結果がサイクル毎にストアされ、適切なベクトルデータが得られることとなる。一方、割り込み処理が発生した場合には、割り込み処理の実行中に、スカラレジスタ内の演算結果が順次変化し、割り込み処理の実行後には、ベクトル命令の最後の演算結果がスカラレジスタに記憶されている状態となる。そして、その演算結果が、ベクトル命令の演算結果としてサイクル毎にストアされていくこととなる。そのため、割り込み処理が発生した場合、割り込み処理の発生後にストアされたデータは全て同一の値(最後の演算結果)となり、適切なベクトルデータが得られない事態が生じていた。   At this time, if no interrupt processing occurs, the operation result written to the scalar register is stored for each cycle, and appropriate vector data is obtained. On the other hand, when interrupt processing occurs, the operation results in the scalar register change sequentially during execution of interrupt processing, and after execution of interrupt processing, the last operation result of the vector instruction is stored in the scalar register. It becomes a state. Then, the calculation result is stored as the calculation result of the vector instruction for each cycle. For this reason, when interrupt processing occurs, all the data stored after the interrupt processing occurs have the same value (the last calculation result), and appropriate vector data cannot be obtained.

このような問題を解決するため、参考文献「構造化コンピュータ構成 第4版」(ピアソン・エデュケーション、アンドリュー・S・タネンバウム著)に記載された技術が知られている。
本文献においては、割り込み処理の実行をソフトウェアで禁止することにより、上述のような不正な結果が生ずることを防止する技術が開示されている。
アンドリュー・S・タネンバウム著「構造化コンピュータ構成 第4版」ピアソン・エデュケーション
In order to solve such a problem, a technique described in a reference document “Structured computer configuration 4th edition” (Pearson Education, written by Andrew S. Tannenbaum) is known.
This document discloses a technique for preventing the above-described incorrect result from occurring by prohibiting execution of interrupt processing by software.
Andrew S. Tannenbaum "Structured Computer Configuration 4th Edition" Pearson Education

しかしながら、上述の文献に記載された技術においては、割り込み処理において不正な結果が生ずることは防止できる(安全に割り込み処理を実行できる)ものの、割り込み処理の実行をソフトウェアで制御することから、割り込み処理の実行を制御する際の応答速度が低下するという問題が生ずる。
即ち、従来のプロセッサにおいては、高い応答性をもって、安全に割り込み処理を実行することが困難であった。
However, in the technique described in the above-mentioned document, it is possible to prevent an illegal result from being generated in interrupt processing (safe interrupt processing can be executed safely), but interrupt processing is controlled by software. There arises a problem that the response speed in controlling the execution of is reduced.
That is, in the conventional processor, it is difficult to safely execute interrupt processing with high responsiveness.

本発明の課題は、プロセッサにおける割り込み処理を、高い応答性をもって安全に実行することである。   An object of the present invention is to safely execute interrupt processing in a processor with high responsiveness.

以上の課題を解決するため、本発明は、
ベクトル命令あるいはマルチサイクル命令を処理可能であり、その処理中に割り込み処理を実行可能なプロセッサであって、前記ベクトル命令あるいはマルチサイクル命令の処理中であるか否かを検出する実行検出手段(例えば、図1,図8のベクトル命令実行検出部109あるいは図5,図11のマルチサイクル命令実行検出部113)と、前記実行検出手段によって、前記ベクトル命令あるいはマルチサイクル命令の処理中であることが検出された場合に、該ベクトル命令あるいはマルチサイクル命令の処理が終了するまで割り込み処理の実行を保留させることが可能な割り込み制御手段(例えば、図1,図5,図8あるいは図11のプログラム制御部110)とを含むことを特徴としている。
In order to solve the above problems, the present invention provides:
A processor capable of processing a vector instruction or a multi-cycle instruction and capable of executing an interrupt process during the process, and detecting whether or not the vector instruction or the multi-cycle instruction is being processed (for example, The vector instruction execution detecting unit 109 in FIGS. 1 and 8 or the multi-cycle instruction execution detecting unit 113 in FIGS. 5 and 11 and the execution detecting unit are processing the vector instruction or multi-cycle instruction. Interrupt control means (for example, program control in FIG. 1, FIG. 5, FIG. 8 or FIG. 11) that, if detected, can suspend execution of interrupt processing until the processing of the vector instruction or multi-cycle instruction is completed. Part 110).

また、本発明は、
ベクトル命令あるいはマルチサイクル命令を処理可能であり、その処理中に割り込み処理を実行可能なプロセッサにおける割り込み制御方法であって、前記ベクトル命令あるいはマルチサイクル命令の処理中であるか否かを検出する実行検出ステップと、前記実行検出ステップにおいて、前記ベクトル命令あるいはマルチサイクル命令の処理中であることが検出された場合に、該ベクトル命令あるいはマルチサイクル命令の処理が終了するまで割り込み処理の実行を保留させる割り込み制御ステップとを含むことを特徴としている。
The present invention also provides:
An interrupt control method in a processor capable of processing a vector instruction or a multi-cycle instruction and executing an interrupt process during the processing, and detecting whether the vector instruction or the multi-cycle instruction is being processed When it is detected in the detection step and the execution detection step that the vector instruction or multicycle instruction is being processed, the execution of the interrupt process is suspended until the processing of the vector instruction or multicycle instruction is completed. And an interrupt control step.

これにより、ベクトル命令あるいはマルチサイクル命令の処理中に割り込みが発生した場合、そのベクトル命令あるいはマルチサイクル命令の処理が終了するまで、割り込み処理が保留される。そして、処理中であるベクトル命令あるいはマルチサイクル命令の処理が終了すると、割り込み処理が実行される。
したがって、割り込み処理が行われることにより、ベクトル命令の演算結果が不正な値となる事態を防止することができ、安全に割り込み処理を実行することが可能となる。
As a result, when an interrupt occurs during the processing of a vector instruction or multicycle instruction, the interrupt processing is suspended until the processing of the vector instruction or multicycle instruction is completed. When the processing of the vector instruction or multicycle instruction being processed is completed, the interrupt process is executed.
Therefore, by performing the interrupt process, it is possible to prevent a situation in which the operation result of the vector instruction becomes an illegal value, and it is possible to execute the interrupt process safely.

また、これにより、プロセッサ内部に実装される実行検出手段(あるいは実行検出ステップ)によって、ベクトル命令あるいはマルチサイクル命令の処理が行われているか否かが検出され、その検出結果に基づいて割り込み処理の実行が制御される。
したがって、ソフトウェアによって割り込み処理の制御を行う場合に比べ、高い応答性をもって処理することが可能となる。
This also detects whether or not a vector instruction or multi-cycle instruction is being processed by the execution detection means (or execution detection step) implemented in the processor, and based on the detection result, interrupt processing is performed. Execution is controlled.
Therefore, it is possible to perform processing with higher responsiveness than when interrupt processing is controlled by software.

即ち、本発明によれば、プロセッサにおける割り込み処理を、高い応答性をもって安全に実行することが可能となる。
また、処理されている前記ベクトル命令あるいはマルチサイクル命令に引き続く命令が、ベクトル命令あるいはマルチサイクル命令であるか否かを検出する連続実行検出手段(例えば、図8のベクトル命令連続実行検出部109aあるいは図11のマルチサイクル命令連続実行検出部113a)をさらに含み、前記割り込み制御手段は、前記連続実行検出手段によって、処理されている前記ベクトル命令あるいはマルチサイクル命令に引き続く命令が、ベクトル命令あるいはマルチサイクル命令であることが検出された場合に、処理されている前記ベクトル命令あるいはマルチサイクル命令の処理と、それに引き続く命令の処理とが終了するまで割り込み処理の実行を保留させることが可能であることを特徴としている。
That is, according to the present invention, it is possible to safely execute interrupt processing in a processor with high responsiveness.
Further, continuous execution detecting means for detecting whether the instruction following the vector instruction or multicycle instruction being processed is a vector instruction or multicycle instruction (for example, the vector instruction continuous execution detecting unit 109a in FIG. 8 or 11 further includes a multi-cycle instruction continuous execution detecting unit 113a), wherein the interrupt control means receives a vector instruction or a multi-cycle instruction following the vector instruction or multi-cycle instruction being processed by the continuous execution detecting means. When it is detected that the instruction is an instruction, it is possible to suspend execution of the interrupt process until the processing of the vector instruction or multicycle instruction being processed and the subsequent instruction are completed. It is a feature.

また、処理されている前記ベクトル命令あるいはマルチサイクル命令に引き続く命令が、ベクトル命令あるいはマルチサイクル命令であるか否かを検出する連続実行検出ステップをさらに含み、前記割り込み制御ステップにおいては、処理されている前記ベクトル命令あるいはマルチサイクル命令に引き続く命令が、ベクトル命令あるいはマルチサイクル命令であることが検出された場合に、処理されている前記ベクトル命令あるいはマルチサイクル命令の処理と、それに引き続く命令の処理とが終了するまで割り込み処理の実行を保留させることを特徴としている。   Further, it further includes a continuous execution detecting step for detecting whether an instruction subsequent to the vector instruction or multi-cycle instruction being processed is a vector instruction or a multi-cycle instruction. In the interrupt control step, When it is detected that an instruction subsequent to the vector instruction or multi-cycle instruction is a vector instruction or multi-cycle instruction; It is characterized in that execution of interrupt processing is suspended until the process ends.

これにより、ベクトル命令あるいはマルチサイクル命令の処理中に割り込みが発生した場合、ベクトル命令あるいはマルチサイクル命令の連続実行中の状態でなくなるまで、割り込み処理が保留される。そして、ベクトル命令あるいはマルチサイクル命令の連続実行中の状態でなくなると、割り込み処理が実行される。
したがって、連続して行われるベクトル命令あるいはマルチサイクル命令それぞれが、レジスタを共用する場合にも、より確実に、ベクトル命令の演算結果が不正な値となる事態を防止することができ、安全に割り込み処理を実行することが可能となる。
As a result, when an interrupt occurs during processing of a vector instruction or multicycle instruction, the interrupt processing is suspended until the vector instruction or multicycle instruction is not being continuously executed. When the vector instruction or the multi-cycle instruction is not being continuously executed, the interrupt process is executed.
Therefore, even when consecutive vector instructions or multi-cycle instructions share a register, it is possible to prevent a situation in which the operation result of a vector instruction becomes an illegal value more reliably and to interrupt safely. Processing can be executed.

また、処理されている前記ベクトル命令あるいはマルチサイクル命令に関与するデータと、それに引き続く命令に関与するデータとの依存関係を判定する判定手段(例えば、データの依存関係を確認する機能を有する場合の図1,図8のベクトル命令実行検出部109あるいは図5,図11のマルチサイクル命令実行検出部113)をさらに含み、前記割り込み制御手段は、前記判定手段によって、前記依存関係があると判定された場合、割り込み処理の実行を保留し、前記依存関係がないと判定された場合、割り込み処理を実行することを特徴としている。   Also, determination means for determining the dependency relationship between the data related to the vector instruction or multi-cycle instruction being processed and the data related to the subsequent instruction (for example, in the case of having a function of checking the data dependency relationship) 1 and FIG. 8 or the multi-cycle instruction execution detection unit 113 in FIG. 5 and FIG. 11, and the interrupt control means is determined by the determination means to have the dependency. In such a case, the execution of the interrupt process is suspended, and the interrupt process is executed when it is determined that there is no dependency.

また、処理されている前記ベクトル命令あるいはマルチサイクル命令に関与するデータと、それに引き続く命令に関与するデータとの依存関係を判定する判定ステップをさらに含み、前記割り込み制御ステップにおいては、前記依存関係があると判定された場合、割り込み処理の実行を保留し、前記依存関係がないと判定された場合、割り込み処理を実行することを特徴としている。   The method further includes a determination step of determining a dependency relationship between the data related to the vector instruction or multicycle instruction being processed and the data related to the subsequent instruction. In the interrupt control step, the dependency relationship is If it is determined that there is an interrupt process, the interrupt process is suspended, and if it is determined that there is no dependency, the interrupt process is executed.

これにより、割り込み処理が実行されるまでの保留時間が長期化する事態を防止することが可能となる。
また、前記判定手段は、処理されているベクトル命令あるいはマルチサイクル命令のデスティネーションレジスタと、引き続く命令のソースレジスタとの関連性に基づいて、前記依存関係を判定することを特徴としている。
As a result, it is possible to prevent a situation in which the holding time until the interrupt process is executed becomes long.
The determining means determines the dependency relationship based on a relationship between a destination register of a vector instruction or multi-cycle instruction being processed and a source register of a subsequent instruction.

また、前記判定ステップにおいては、処理されているベクトル命令あるいはマルチサイクル命令のデスティネーションレジスタと、引き続く命令のソースレジスタとの関連性に基づいて、前記依存関係を判定することを特徴としている。
これにより、連続するベクトル命令あるいはマルチサイクル命令の具体的な処理内容に応じて、適切に割り込み処理を実行することが可能となる。
In the determination step, the dependency relationship is determined based on the relationship between the destination register of the vector instruction or multicycle instruction being processed and the source register of the subsequent instruction.
This makes it possible to appropriately execute interrupt processing according to the specific processing contents of successive vector instructions or multicycle instructions.

なお、例えば、ベクトル命令の実行結果を、スカラレジスタを介して、引き続く命令が使用している関係や、先行する命令のデスティネーションレジスタに対し、レジスタの多重割り当てが行われている関係である場合には、処理されているベクトル命令あるいはマルチサイクル命令のデスティネーションレジスタと、引き続く命令のソースレジスタとが関連性を有すると言える。   In addition, for example, when the execution result of a vector instruction is a relationship that a subsequent instruction uses through a scalar register or a relationship in which multiple assignments of a register are performed to a destination register of a preceding instruction Can be said to be related to the destination register of the vector instruction or multi-cycle instruction being processed and the source register of the subsequent instruction.

以下、図を参照して本発明に係るプロセッサの実施の形態を説明する。
(第1の実施の形態)
初めに、本発明の第1の実施の形態について説明する。
まず、構成を説明する。
図1は、本実施の形態に係るプロセッサ1の構成を示す図である。
Hereinafter, an embodiment of a processor according to the present invention will be described with reference to the drawings.
(First embodiment)
First, a first embodiment of the present invention will be described.
First, the configuration will be described.
FIG. 1 is a diagram showing a configuration of the processor 1 according to the present embodiment.

図1において、プロセッサ1は、フェッチ部101と、デコード部102と、ALU部103と、乗算部104と、加減算部105と、ロード部106と、ストア部107と、レジスタファイル部108と、ベクトル命令実行検出部109と、プログラム制御部110と、例外管理部111と、外部割り込み制御部112とを含んで構成される。
図1において、プロセッサ1は、図12に示す従来のプロセッサ200に、ベクトル命令実行検出部109が付加された構成である。そのため、ベクトル命令実行検出部109に関連する構成についてのみ説明し、従来と同様の構成部分については、説明を省略する。
In FIG. 1, a processor 1 includes a fetch unit 101, a decode unit 102, an ALU unit 103, a multiplication unit 104, an addition / subtraction unit 105, a load unit 106, a store unit 107, a register file unit 108, a vector The instruction execution detection unit 109, the program control unit 110, the exception management unit 111, and the external interrupt control unit 112 are included.
In FIG. 1, the processor 1 has a configuration in which a vector instruction execution detection unit 109 is added to the conventional processor 200 shown in FIG. Therefore, only the configuration related to the vector instruction execution detection unit 109 will be described, and the description of the same configuration as the conventional one will be omitted.

ALU部103、乗算部104、加減算部105、ロード部106およびストア部107は、それぞれにおいて実行している命令がベクトル命令であるか否かを示す実行ステータス信号をベクトル命令実行検出部109に出力する。
ベクトル命令実行検出部109は、プロセッサ1内部にハードウェアとして備えられており、ベクトル命令実行検出部109には、命令を実行しているALU部103、乗算部104、加減算部105、ロード部106およびストア部107から実行ステータス信号が入力される。
The ALU unit 103, the multiplication unit 104, the addition / subtraction unit 105, the load unit 106, and the store unit 107 each output an execution status signal indicating whether or not the instruction being executed is a vector instruction to the vector instruction execution detection unit 109 To do.
The vector instruction execution detection unit 109 is provided as hardware in the processor 1. The vector instruction execution detection unit 109 includes an ALU unit 103 that executes instructions, a multiplication unit 104, an addition / subtraction unit 105, and a load unit 106. An execution status signal is input from the store unit 107.

そして、ベクトル命令実行検出部109は、実行している命令がベクトル命令である旨を示す実行ステータス信号が入力された場合、外部割り込み処理を実行させない旨の指示信号(以下、「割り込み禁止信号」と言う。)をプログラム制御部110に出力する。
なお、デコード部102によってデコードされた命令コードの内容に基づいて、その命令がベクトル命令であるか否かを判定できることから、デコード部102からベクトル命令実行検出部109に実行ステータス信号を入力することも可能である。
When the execution status signal indicating that the instruction being executed is a vector instruction is input, the vector instruction execution detection unit 109 receives an instruction signal (hereinafter referred to as “interrupt disable signal”) indicating that external interrupt processing is not to be executed. Is output to the program control unit 110.
Since it can be determined whether or not the instruction is a vector instruction based on the content of the instruction code decoded by the decoding unit 102, an execution status signal is input from the decoding unit 102 to the vector instruction execution detection unit 109. Is also possible.

プログラム制御部110は、ベクトル命令実行検出部109から割り込み禁止信号が入力されると、実行中のベクトル命令の処理が終了するまで、外部割り込み処理の実行を保留する。そして、プログラム制御部110は、実行中のベクトル命令の処理が終了すると、外部割り込み処理を実行する。
次に、動作を説明する。
When an interrupt prohibition signal is input from the vector instruction execution detection unit 109, the program control unit 110 suspends execution of external interrupt processing until the processing of the currently executing vector instruction is completed. Then, the program control unit 110 executes external interrupt processing when the processing of the currently executing vector instruction is completed.
Next, the operation will be described.

プロセッサ1は、主としてプログラム制御部110の制御によって、割り込み処理の動作に対応する状態遷移を行う。
図2は、プロセッサ1の動作を示す状態遷移図である。
図2において、プロセッサ1は、状態S1〜S5を遷移する。
状態S1(Reset)は、割り込み処理としてプロセッサ1のリセットが行われた場合の第1サイクルを実行する状態であり、引き続き状態S2に遷移する。
The processor 1 performs state transition corresponding to the operation of interrupt processing mainly under the control of the program control unit 110.
FIG. 2 is a state transition diagram showing the operation of the processor 1.
In FIG. 2, the processor 1 transitions between states S1 to S5.
The state S1 (Reset) is a state in which the first cycle is executed when the processor 1 is reset as an interrupt process, and the state continues to transition to the state S2.

状態S2(Normal)は、割り込みが発生していない、通常の動作状態である。状態S2において、外部割り込みが発生した場合(MI-Event)、ベクトル命令の実行中でなければ状態S3に遷移し、例外処理等、外部割り込み以外の割り込みが発生すると(NMI-Event)、状態S5に遷移する。また、状態S2において、リセットが行われた場合(IntReset)、状態S1に遷移する。ここで、状態S2において、外部割り込みが発生した場合に、ベクトル命令の処理中であるときには、ベクトル命令の処理が終了するまで状態S2を継続する。   State S2 (Normal) is a normal operating state in which no interrupt has occurred. In the state S2, when an external interrupt occurs (MI-Event), if a vector instruction is not being executed, the state transitions to the state S3. When an interrupt other than an external interrupt such as exception handling occurs (NMI-Event), the state S5 Transition to. Further, when the reset is performed in the state S2 (IntReset), the state transits to the state S1. Here, in the state S2, when an external interrupt occurs and the vector instruction is being processed, the state S2 is continued until the processing of the vector instruction is completed.

状態S3(MI)は、外部割り込み処理を実行する状態である。状態S3において、外部割り込み処理が終了すると、状態S4に遷移し、リセットが行われた場合、状態S1に遷移する。
状態S4(MI-PostProc)は、外部割り込み処理の実行後、プロセッサ1の動作タイミングを調整する状態である。状態S4において、動作タイミングの調整後、状態S2に遷移し、外部割り込み以外の割り込みが発生すると、状態S5に遷移する。また、状態S4において、リセットが行われた場合、状態S1に遷移する。
State S3 (MI) is a state in which external interrupt processing is executed. In the state S3, when the external interrupt process ends, the state transits to the state S4, and when the reset is performed, the state transits to the state S1.
State S4 (MI-PostProc) is a state in which the operation timing of the processor 1 is adjusted after execution of the external interrupt process. In state S4, after adjusting the operation timing, the state transitions to state S2, and when an interrupt other than an external interrupt occurs, the state transitions to state S5. Moreover, when reset is performed in state S4, it changes to state S1.

状態S5(NMI)は、例外処理等、外部割り込み以外の割り込み処理を実行する状態である。状態S5において、外部割り込み以外の割り込み処理の実行後、状態S2に遷移し、リセットが行われた場合、状態S1に遷移する。
図2に示すように各状態を遷移する結果、プロセッサ1は、割り込み処理に関し、具体的に以下のような動作を行う。
State S5 (NMI) is a state in which interrupt processing other than external interrupt, such as exception processing, is executed. In state S5, after executing interrupt processing other than external interrupt, the state transitions to state S2, and when reset is performed, the state transitions to state S1.
As a result of the transition of each state as shown in FIG. 2, the processor 1 specifically performs the following operation regarding the interrupt processing.

図3は、ベクトル命令の処理中に外部割り込みが発生した場合の動作例を示すタイミングチャートである。
図3においては、クロック信号(CLK)によって規定されるサイクル毎に、命令コード(Inst1〜11)が順次入力される。各命令コードは、フェッチアドレスの演算(Fadr)、フェッチ(F)、デコード(D)および実行(E)の各ステージによって構成される。また、命令コードInst2は、4ワードのデータを読み込むベクトル命令であり、実行ステージは4サイクル(E1〜E4)にわたっている。
FIG. 3 is a timing chart showing an operation example when an external interrupt occurs during processing of a vector instruction.
In FIG. 3, instruction codes (Inst 1 to 11) are sequentially input every cycle defined by the clock signal (CLK). Each instruction code is composed of stages of fetch address calculation (Fadr), fetch (F), decode (D), and execution (E). The instruction code Inst2 is a vector instruction for reading data of 4 words, and the execution stage extends over 4 cycles (E1 to E4).

図3において、サイクル“1”〜“3”では、プロセッサ1に命令コードInst1〜3が順に入力され、通常の動作を行っている。
そして、サイクル“4”において、外部割り込みが発生すると(IRQ-EN=1)、ベクトル命令である命令コードInst2の処理中であることから、外部割り込み処理を保留し、命令コードInst2の最後の実行ステージが開始されるサイクル“8”まで通常の動作を継続する。
3, in cycles “1” to “3”, instruction codes Inst1 to Inst3 are sequentially input to the processor 1 to perform normal operations.
Then, in cycle “4”, when an external interrupt occurs (IRQ-EN = 1), since the instruction code Inst2 which is a vector instruction is being processed, external interrupt processing is suspended and the last execution of the instruction code Inst2 Normal operation continues until cycle “8” when the stage is started.

サイクル“8”において、プロセッサ1は、外部割り込み処理Inst8を開始し、外部割り込み処理のフェッチアドレスを演算する。また、サイクル“7”におけるプログラムカウンタ(PC)の値等を含む動作状態は、一旦退避される。
そして、プロセッサ1は、外部割り込み処理に関連する命令コードInst8〜10をサイクル“8”〜“10”で処理し、サイクル“11”から、通常の動作状態に戻る。
In cycle “8”, the processor 1 starts the external interrupt process Inst8 and calculates the fetch address of the external interrupt process. In addition, the operation state including the value of the program counter (PC) in the cycle “7” is temporarily saved.
Then, the processor 1 processes the instruction codes Inst8 to 10 related to the external interrupt processing in the cycles “8” to “10”, and returns to the normal operation state from the cycle “11”.

以上のように、本実施の形態に係るプロセッサ1は、ベクトル命令の処理中に外部割り込みが発生した場合、図4に示すように、そのベクトル命令の処理が終了するまで、外部割り込み処理を保留する。そして、処理中であるベクトル命令の処理が終了すると、外部割り込み処理を実行する。
したがって、割り込み処理が行われることにより、ベクトル命令の演算結果が不正な値となる事態を防止することができ、安全に割り込み処理を実行することが可能となる。
As described above, when an external interrupt occurs during the processing of a vector instruction, the processor 1 according to the present embodiment suspends the external interrupt processing until the processing of the vector instruction ends as shown in FIG. To do. When the processing of the vector instruction being processed ends, external interrupt processing is executed.
Therefore, by performing the interrupt process, it is possible to prevent a situation in which the operation result of the vector instruction becomes an illegal value, and it is possible to execute the interrupt process safely.

また、プロセッサ1は、プロセッサ1内部にハードウェアとして実装されるベクトル命令実行検出部109によって、ベクトル命令の処理が行われているか否かを検出し、その検出結果に基づいて割り込み処理の実行を制御する。
したがって、ソフトウェアによって割り込み処理の制御を行う場合に比べ、高い応答性をもって処理することが可能となる。また、プロセッサ1に実行させるプログラムを記述する際に、割り込み処理に関するプログラムの記述を容易なものとすることができると共に、割り込み処理に関するプログラムミスを防止することが可能となる。
Further, the processor 1 detects whether or not vector instruction processing is being performed by the vector instruction execution detection unit 109 implemented as hardware in the processor 1, and executes interrupt processing based on the detection result. Control.
Therefore, it is possible to perform processing with higher responsiveness than when interrupt processing is controlled by software. In addition, when describing a program to be executed by the processor 1, it is possible to easily describe a program related to interrupt processing and to prevent a program error related to interrupt processing.

なお、プロセッサ1においてマルチサイクル命令を処理する場合にも、上述のような、ベクトル命令における場合と同様の割り込み処理の制御を行うことが可能である。
即ち、図5に示すように、プロセッサ1において、図1のベクトル命令実行検出部109に対応するマルチサイクル命令実行検出部113を備え、ALU部103等、演算を行う各機能部から、マルチサイクル命令が実行されているか否かを示す実行ステータス信号を入力させる。
Even when the processor 1 processes a multi-cycle instruction, it is possible to perform the same interrupt processing control as in the case of a vector instruction as described above.
That is, as shown in FIG. 5, the processor 1 includes a multi-cycle instruction execution detection unit 113 corresponding to the vector instruction execution detection unit 109 of FIG. An execution status signal indicating whether or not the instruction is being executed is input.

そして、ALU部103等の各機能部から、実行している命令がマルチサイクル命令である旨の実行ステータス信号が入力された場合、マルチサイクル命令実行検出部113が、割り込み禁止信号をプログラム制御部110に出力する。
このような構成とすることにより、プロセッサ2は、割り込み処理に関し、具体的には、以下のような動作を行う。
When an execution status signal indicating that the instruction being executed is a multi-cycle instruction is input from each functional unit such as the ALU unit 103, the multi-cycle instruction execution detection unit 113 sends an interrupt prohibition signal to the program control unit. To 110.
With such a configuration, the processor 2 specifically performs the following operation regarding the interrupt processing.

図6は、マルチサイクル命令の処理中に割り込み処理が発生した場合の動作例を示すタイミングチャートである。
図6においては、クロック信号(CLK)によって規定されるサイクル毎に、
MP %SR2,%SR0,%SR1;
ADD %SR4,%SR3,%SR2;
SUB %SR5,%SR3,%SR2;
ADD %SR7,%SR6,%SR2;
SUB %SR8,%SR6,%SR2;
の順で命令が入力されている。
(ただし、第1行は、スカラレジスタSR0およびスカラレジスタSR1の値を乗算し、スカラレジスタSR2に格納する命令であり、第2行は、スカラレジスタSR3の値にスカラレジスタSR2の値を加算し、スカラレジスタSR4に格納する命令である。また、第3行は、スカラレジスタSR3の値からスカラレジスタSR2の値を減算し、スカラレジスタSR5に格納する命令であり、第4行は、スカラレジスタSR6の値にスカラレジスタSR2の値を加算し、スカラレジスタSR7に格納する命令である。さらに、第5行は、スカラレジスタSR6の値からスカラレジスタSR2の値を減算し、スカラレジスタSR8に格納する命令である。)
そして、これらの命令において、第1行は、実行ステージが4サイクルわたるマルチサイクル命令であり、そのデスティネーションレジスタSR2が、第2行から第4行の命令において、ソースレジスタとして多重割り当てされている。
FIG. 6 is a timing chart showing an operation example when an interrupt process occurs during the processing of a multi-cycle instruction.
In FIG. 6, every cycle defined by the clock signal (CLK),
MP% SR2,% SR0,% SR1;
ADD% SR4,% SR3,% SR2;
SUB% SR5,% SR3,% SR2;
ADD% SR7,% SR6,% SR2;
SUB% SR8,% SR6,% SR2;
Instructions are entered in the order.
(However, the first line is an instruction that multiplies the values of the scalar register SR0 and the scalar register SR1 and stores the result in the scalar register SR2. The second line adds the value of the scalar register SR2 to the value of the scalar register SR3. The third line is an instruction for subtracting the value of the scalar register SR2 from the value of the scalar register SR3 and storing it in the scalar register SR5, and the fourth line is the instruction for storing the scalar register SR4. An instruction for adding the value of the scalar register SR2 to the value of SR6 and storing it in the scalar register SR7 Further, the fifth line subtracts the value of the scalar register SR2 from the value of the scalar register SR6 and stores it in the scalar register SR8. Is an instruction to do.)
In these instructions, the first line is a multi-cycle instruction whose execution stage extends over four cycles, and the destination register SR2 is multiple-assigned as a source register in the instructions from the second line to the fourth line. .

ここで、サイクル“4”において、外部割り込み処理が発生すると、マルチサイクル命令(第1行の命令)の処理中であることから、外部割り込み処理を保留し、マルチサイクル命令の最後の実行ステージが開始されるサイクル“7”まで通常の動作を継続する。
そして、サイクル“7”において、プロセッサ2は、外部割り込み処理を開始する。
そのため、第2行から第4行の命令において使用するスカラレジスタSR2の値は、第1行の命令の実行結果が反映されていない状態であり、第5行の命令において使用するスカラレジスタSR2の値は、第1行の命令の実行結果が反映されている状態である。即ち、スカラレジスタSR2に関する多重割り当てが適切に処理されている。
Here, when external interrupt processing occurs in cycle “4”, the multi-cycle instruction (instruction on the first line) is being processed, so external interrupt processing is suspended and the last execution stage of the multi-cycle instruction is Normal operation continues until cycle "7" to be started.
Then, in the cycle “7”, the processor 2 starts external interrupt processing.
Therefore, the value of the scalar register SR2 used in the second to fourth line instructions does not reflect the execution result of the first line instruction, and the value of the scalar register SR2 used in the fifth line instruction is not reflected. The value is a state in which the execution result of the instruction on the first line is reflected. That is, the multiple assignment related to the scalar register SR2 is appropriately processed.

一方、従来のように、マルチサイクル命令の処理中であるか否かに関わらず、外部割り込み処理を実行する場合、図7に示すように、第2行から第4行の命令において使用するスカラレジスタSR2の値も、第1行の命令の実行結果が反映された状態となってしまい、スカラレジスタSR2に関する多重割り当てが適切に処理されないこととなる。
したがって、上述のベクトル命令の場合と同様に、本発明により、マルチサイクル命令の処理中に外部割り込み処理が行われることによって生ずる不具合を解消することができる。
(第2の実施の形態)
次に、本発明の第2の実施の形態について説明する。
On the other hand, when executing external interrupt processing regardless of whether or not a multi-cycle instruction is being processed as in the prior art, as shown in FIG. 7, the scalars used in the second to fourth line instructions are used. The value of the register SR2 is also in a state in which the execution result of the instruction on the first line is reflected, and the multiple assignment relating to the scalar register SR2 is not appropriately processed.
Therefore, as in the case of the vector instruction described above, the present invention can solve the problem caused by the external interrupt processing being performed during the processing of the multi-cycle instruction.
(Second Embodiment)
Next, a second embodiment of the present invention will be described.

図8は、本実施の形態に係るプロセッサ2の構成を示す図である。
図8において、プロセッサ2は、第1の実施の形態におけるプロセッサ1において、ベクトル命令実行検出部109にベクトル命令連続実行検出部109aが付加された構成である。そのため、ベクトル命令連続実行検出部109aに関連する構成についてのみ説明し、プロセッサ1と同様の構成部分については、説明を省略する。
FIG. 8 is a diagram showing a configuration of the processor 2 according to the present embodiment.
In FIG. 8, the processor 2 has a configuration in which a vector instruction continuous execution detection unit 109 a is added to the vector instruction execution detection unit 109 in the processor 1 in the first embodiment. Therefore, only the configuration related to the vector instruction continuous execution detection unit 109a will be described, and the description of the same components as the processor 1 will be omitted.

デコード部102は、現在実行中である命令コードに引き続く命令コード(以下、「後続命令コード」と言う。)のデコード結果に基づいて、その命令コードがベクトル命令であるか否かを判定する。そして、デコード部102は、現在実行中である命令コードに引き続く命令(以下、「後続命令」と言う。)がベクトル命令であるか否かを示す連続実行ステータス信号をベクトル命令連続実行検出部109aに出力する。   The decoding unit 102 determines whether or not the instruction code is a vector instruction based on a decoding result of an instruction code subsequent to the instruction code currently being executed (hereinafter referred to as “subsequent instruction code”). Then, the decoding unit 102 outputs a continuous execution status signal indicating whether or not an instruction subsequent to the instruction code currently being executed (hereinafter referred to as “subsequent instruction”) is a vector instruction, to the vector instruction continuous execution detecting unit 109a. Output to.

ベクトル命令実行検出部109は、ベクトル命令連続実行検出部109aをさらに含んで構成される。
ベクトル命令連続実行検出部109aは、デコード部102から入力される連続実行ステータス信号に基づいて、後続命令がベクトル命令であるか否かを判定する。
そして、ベクトル命令連続実行検出部109aによって、後続命令がベクトル命令であると判定された場合、ベクトル命令実行検出部109は、現在実行中である命令コードがベクトル命令であるときには、後続命令の処理が終了するまで外部割り込み処理を実行させない旨の指示信号(以下、「連続割り込み禁止信号」と言う。)をプログラム制御部110に出力する。
The vector instruction execution detection unit 109 further includes a vector instruction continuous execution detection unit 109a.
Based on the continuous execution status signal input from the decoding unit 102, the vector instruction continuous execution detection unit 109a determines whether the subsequent instruction is a vector instruction.
When the vector instruction continuous execution detection unit 109a determines that the subsequent instruction is a vector instruction, the vector instruction execution detection unit 109 processes the subsequent instruction when the currently executed instruction code is a vector instruction. An instruction signal indicating that external interrupt processing is not to be executed (hereinafter referred to as “continuous interrupt prohibition signal”) is output to the program control unit 110 until the process ends.

プログラム制御部110は、ベクトル命令実行検出部109から連続割り込み禁止信号が入力されると、実行中のベクトル命令の処理および後続命令の処理が終了するまで、外部割り込み処理の実行を保留する。そして、プログラム制御部110は、後続命令に引き続く命令がベクトル命令である場合、上述の処理を同様に行うことにより、外部割り込み処理の実行をそのまま保留し続け、後続命令に引き続く命令がベクトル命令でない場合に、外部割り込み処理を実行する。   When the continuous interrupt inhibition signal is input from the vector instruction execution detection unit 109, the program control unit 110 suspends execution of external interrupt processing until the processing of the currently executing vector instruction and the processing of the subsequent instruction are completed. Then, when the instruction subsequent to the subsequent instruction is a vector instruction, the program control unit 110 continues to hold the execution of the external interrupt process as it is by performing the above-described processing in the same manner, and the instruction subsequent to the subsequent instruction is not a vector instruction. In this case, external interrupt processing is executed.

次に、動作を説明する。
プロセッサ2の動作を示す状態遷移図は、図2に示すプロセッサ1の状態遷移図において、状態S2の遷移条件が異なるものである。
即ち、図2において、状態S2(Normal)は、割り込みが発生していない、通常の動作状態である。状態S2において、外部割り込みが発生した場合、ベクトル命令の処理中であり、かつ、後続命令がベクトル命令であるとき(ベクトル命令の連続実行中)以外には状態S3に遷移し、例外処理等、外部割り込み以外の割り込みが発生すると、状態S5に遷移する。また、状態S2において、リセットが行われた場合、状態S1に遷移する。ここで、状態S2において、外部割り込みが発生した場合に、ベクトル命令の連続実行中であるときには、ベクトル命令の処理中であり、かつ、後続命令がベクトル命令である状態でなくなるまで状態S2を継続する。
Next, the operation will be described.
The state transition diagram showing the operation of the processor 2 is different from the state transition diagram of the processor 1 shown in FIG.
That is, in FIG. 2, the state S2 (Normal) is a normal operation state in which no interrupt has occurred. In the state S2, when an external interrupt occurs, a transition is made to the state S3 except when the vector instruction is being processed and the subsequent instruction is a vector instruction (during continuous execution of the vector instruction), When an interrupt other than an external interrupt occurs, the flow goes to the state S5. Further, when reset is performed in the state S2, the state transitions to the state S1. Here, in the state S2, when an external interrupt occurs, if the vector instruction is being continuously executed, the state S2 is continued until the vector instruction is being processed and the subsequent instruction is no longer a vector instruction. To do.

そして、このような状態遷移を行う結果、プロセッサ2は、割り込み処理に関し、具体的には、以下のような動作を行う。
図9は、連続するベクトル命令の処理中に割り込み処理が発生した場合の動作例を示すタイミングチャートである。
図9においては、クロック信号(CLK)によって規定されるサイクル毎に、命令コード(Inst1〜12)が順次入力される。各命令コードは、フェッチアドレスの演算(Fadr)、フェッチ(F)、デコード(D)および実行(E)の各ステージによって構成される。また、命令コードInst2は、2ワードのデータを読み込むベクトル命令であり、実行ステージは2サイクル(E1〜E2)にわたっている。さらに、命令コードInst3は、4ワードのデータを加算するベクトル命令であり、実行ステージは4サイクル(E1〜E4)にわたっている。
As a result of such state transition, the processor 2 specifically performs the following operation regarding the interrupt processing.
FIG. 9 is a timing chart showing an operation example when an interrupt process occurs during the processing of successive vector instructions.
In FIG. 9, instruction codes (Inst 1 to 12) are sequentially input every cycle defined by the clock signal (CLK). Each instruction code is composed of stages of fetch address calculation (Fadr), fetch (F), decode (D), and execution (E). The instruction code Inst2 is a vector instruction for reading data of two words, and the execution stage extends over two cycles (E1 to E2). Further, the instruction code Inst3 is a vector instruction for adding data of 4 words, and the execution stage extends over 4 cycles (E1 to E4).

図9において、サイクル“1”では、プロセッサ2に命令コードInst1が入力され、通常の動作を行っている。
そして、サイクル“2”において、ベクトル命令である命令コードInst2が入力され、続いて、サイクル“3”において、同様にベクトル命令である命令コードInst3が入力される。
In FIG. 9, in cycle “1”, the instruction code Inst1 is input to the processor 2 to perform normal operation.
Then, in cycle “2”, an instruction code Inst2 that is a vector instruction is input, and subsequently, in cycle “3”, an instruction code Inst3 that is also a vector instruction is input.

すると、命令コードInst2については、サイクル“6”まで処理が継続し、命令コードInst3については、サイクル“9”まで処理が継続される。
ここで、サイクル“4”において、外部割り込み処理が発生すると、ベクトル命令である命令コードInst2の処理中であり、後続命令もベクトル命令である命令コードInst3であることから、外部割り込み処理を保留し、命令コードInst3の最後の実行ステージが開始されるサイクル“9”まで通常の動作を継続する。
Then, the processing is continued until the cycle “6” for the instruction code Inst2, and the processing is continued until the cycle “9” for the instruction code Inst3.
Here, in the cycle “4”, when external interrupt processing occurs, the instruction code Inst2 that is a vector instruction is being processed, and the subsequent instruction is also the instruction code Inst3 that is a vector instruction. The normal operation is continued until the cycle “9” when the last execution stage of the instruction code Inst3 is started.

サイクル“9”において、プロセッサ2は、外部割り込み処理Inst9を開始し、外部割り込み処理のフェッチアドレスを演算する。また、サイクル“8”におけるプログラムカウンタ(PC)の値等を含む動作状態は、一旦退避される。
そして、プロセッサ2は、外部割り込み処理に関連する命令コードInst9〜11をサイクル“9”〜“11”で処理し、サイクル“12”から、通常の動作状態に戻る。
In cycle “9”, the processor 2 starts the external interrupt process Inst9 and calculates the fetch address of the external interrupt process. Further, the operation state including the value of the program counter (PC) in the cycle “8” is temporarily saved.
Then, the processor 2 processes the instruction codes Inst9 to 11 related to the external interrupt processing in cycles “9” to “11”, and returns to the normal operation state from the cycle “12”.

以上のように、本実施の形態に係るプロセッサ2は、ベクトル命令の処理中に外部割り込みが発生した場合、図10に示すように、ベクトル命令の連続実行中の状態でなくなるまで、外部割り込み処理を保留する。そして、ベクトル命令の連続実行中の状態でなくなると、外部割り込み処理を実行する。
したがって、連続して行われるベクトル命令それぞれが、レジスタを共用する場合にも、より確実に、ベクトル命令の演算結果が不正な値となる事態を防止することができ、安全に割り込み処理を実行することが可能となる。
As described above, when an external interrupt occurs during the processing of a vector instruction, the processor 2 according to the present embodiment performs external interrupt processing until the state where the vector instruction is not being continuously executed as shown in FIG. Hold on. When the vector instruction is not being continuously executed, external interrupt processing is executed.
Therefore, even when consecutive vector instructions share a register, it is possible to more reliably prevent a situation in which the operation result of the vector instruction is an invalid value, and safely execute interrupt processing. It becomes possible.

なお、プロセッサ2においてマルチサイクル命令を処理する場合にも、上述のような、ベクトル命令における場合と同様の割り込み処理の制御を行うことが可能である。
即ち、図11に示すように、プロセッサ2において、図8のベクトル命令実行検出部109およびベクトル命令連続実行検出部109aに対応するマルチサイクル命令実行検出部113およびマルチサイクル命令連続実行検出部113aを備え、デコード部102から、現在実行中である命令コードに引き続く命令コードがマルチサイクル命令であるか否かを示す連続実行ステータス信号を入力させる。
Even when the processor 2 processes a multi-cycle instruction, it is possible to perform the same interrupt processing control as in the case of a vector instruction as described above.
That is, as shown in FIG. 11, in the processor 2, the multi-cycle instruction execution detection unit 113 and the multi-cycle instruction continuous execution detection unit 113a corresponding to the vector instruction execution detection unit 109 and the vector instruction continuous execution detection unit 109a of FIG. And a continuous execution status signal indicating whether the instruction code subsequent to the instruction code currently being executed is a multi-cycle instruction is input from the decoding unit 102.

そして、デコード部102から、現在実行中である命令コードに引き続く命令コードがマルチサイクル命令である旨の実行ステータス信号が入力された場合、現在実行中である命令コードがマルチサイクル命令であるときには、マルチサイクル命令実行検出部113が、連続割り込み禁止信号をプログラム制御部110に出力する。
このような構成とすることにより、上述のベクトル命令の場合と同様に、マルチサイクル命令の連続実行中に外部割り込み処理が行われることによって生ずる不具合を解消することができる。
When an execution status signal indicating that the instruction code subsequent to the instruction code currently being executed is a multi-cycle instruction is input from the decoding unit 102, when the instruction code currently being executed is a multi-cycle instruction, The multicycle instruction execution detection unit 113 outputs a continuous interrupt inhibition signal to the program control unit 110.
By adopting such a configuration, similarly to the case of the vector instruction described above, it is possible to eliminate a problem caused by external interrupt processing being performed during continuous execution of multicycle instructions.

ここで、第1および第2の実施の形態においては、ベクトル命令またはマルチサイクル命令が実行されている場合もしくは連続して実行されている場合には、外部割り込み処理を常に保留することとして説明したが、この場合、外部割り込み処理が実行されるまでの保留時間が長期化する事態も想定される。
そこで、このような事態が発生することをより少なくするため、実行されているベクトル命令あるいはマルチサイクル命令と、引き続く命令とに関与するデータの依存関係を確認した上で、依存関係がなければ、ベクトル命令あるいはマルチサイクル命令の実行中に外部割り込み処理を開始することが可能である。このような依存関係の確認は、処理される各命令コードのデコード結果が入力されるベクトル命令実行検出部109あるいはマルチサイクル命令実行検出部113において行うことが可能である。
Here, in the first and second embodiments, it has been described that external interrupt processing is always suspended when a vector instruction or multi-cycle instruction is executed or continuously executed. However, in this case, there is a possibility that the holding time until the external interrupt processing is executed becomes longer.
Therefore, in order to reduce the occurrence of such a situation, after checking the dependency relationship of the data involved in the executed vector instruction or multi-cycle instruction and the subsequent instruction, if there is no dependency, External interrupt processing can be started during execution of a vector instruction or a multi-cycle instruction. Such dependency confirmation can be performed by the vector instruction execution detection unit 109 or the multicycle instruction execution detection unit 113 to which the decoding result of each instruction code to be processed is input.

実行されているベクトル命令と、引き続く命令とに関与するデータについて、依存関係の有無を判定するための条件は、「先行する命令のデスティネーションレジスタがスカラレジスタであり、かつ、引き続く命令が、そのデスティネーションレジスタをソースレジスタとして使用しているか否か」である。例えば、
ADD[8] %SR0,%VR0,VR1;
ST[8] %SR0,{%SR6,%SR7};
(ただし、第1行は、ベクトルレジスタVR0の値にベクトルレジスタVR1の値を加算し、スカラレジスタSR0に順次格納する命令であり、第2行は、スカラレジスタSR0の値をスカラレジスタSR6,SR7によって示されるメモリアドレスにストアする命令である。)
という命令列の場合、第1行と第2行の間に割り込み処理が行われると、デスティネーションレジスタであるスカラレジスタSR0の値が割り込み処理中に順次変化してしまい、第2行の処理結果が不正なものとなる。
The condition for determining whether or not there is a dependency relationship between the data related to the vector instruction being executed and the succeeding instruction is as follows: "The destination register of the preceding instruction is a scalar register, and the succeeding instruction Whether or not the destination register is used as a source register. For example,
ADD [8]% SR0,% VR0, VR1;
ST [8]% SR0, {% SR6,% SR7};
(However, the first line is an instruction for adding the value of the vector register VR1 to the value of the vector register VR0 and sequentially storing the value in the scalar register SR0. The second line stores the value of the scalar register SR0 in the scalar registers SR6 and SR7. This is an instruction to store in the memory address indicated by
In the case of the instruction sequence, when interrupt processing is performed between the first row and the second row, the value of the scalar register SR0, which is the destination register, sequentially changes during the interrupt processing, and the processing result of the second row Is illegal.

なお、第1行および第2行のスカラレジスタSR0に代えて、ベクトルレジスタVR2を使用した場合、第2行で用いるベクトルレジスタVR2の値が正しい値に保たれ、第2行の処理結果は不正なものとはならない。
また、実行されているマルチサイクル命令と、引き続く命令とに関与するデータについて、依存関係の有無を判定するための条件は、「先行するマルチサイクル命令のデスティネーションレジスタがスカラレジスタであり、かつ、先行するマルチサイクル命令の結果がデスティネーションレジスタに書き込まれる前に、引き続く命令が、そのデスティネーションレジスタをソースレジスタとして使用しているか否か」である。即ち、マルチサイクル命令においてスカラレジスタの多重割り当てを行っている場合等である。例えば、
LD %SR0,{%SR6,%SR7};
ADD %SR2,%SR0,SR1;
ADD %SR3,%SR0,SR1;
(ただし、第1行は、スカラレジスタSR0に外部メモリのアドレス{%SR0,%SR7}から読み込んだデータを格納する命令であり、第2行は、スカラレジスタSR0の値にスカラレジスタSR1の値を加算し、スカラレジスタSR2に格納する命令である。また、第3行は、スカラレジスタSR0の値にスカラレジスタSR1の値を加算し、スカラレジスタSR3に格納する命令である。)
という命令列の場合、第1行は外部メモリからデータを読み込むマルチサイクル命令であり、その結果は、第3行の処理サイクルで反映されることとなる。つまり、第2行におけるスカラレジスタSR0と第3行におけるスカラレジスタSR0とは、異なる“変数”として扱われている。そのため、第1行と第2行との間に割り込み処理が行われると、第2行におけるスカラレジスタSR0と第3行におけるスカラレジスタSR0とは同一の“変数”となってしまい、第2行の処理結果が不正なものとなる。
When the vector register VR2 is used instead of the scalar register SR0 in the first row and the second row, the value of the vector register VR2 used in the second row is maintained at a correct value, and the processing result in the second row is invalid. It will not be a thing.
In addition, the condition for determining whether or not there is a dependency relationship between the data related to the executed multi-cycle instruction and the succeeding instruction is “the destination register of the preceding multi-cycle instruction is a scalar register, and Whether the subsequent instruction uses the destination register as a source register before the result of the preceding multi-cycle instruction is written to the destination register. That is, this is the case when multiple allocation of scalar registers is performed in a multi-cycle instruction. For example,
LD% SR0, {% SR6,% SR7};
ADD% SR2,% SR0, SR1;
ADD% SR3,% SR0, SR1;
(However, the first line is an instruction for storing data read from the address {% SR0,% SR7} of the external memory in the scalar register SR0, and the second line is the value of the scalar register SR1 in addition to the value of the scalar register SR0. The third line is an instruction for adding the value of the scalar register SR1 to the value of the scalar register SR0 and storing it in the scalar register SR3.)
In the case of the instruction sequence, the first row is a multi-cycle instruction for reading data from the external memory, and the result is reflected in the processing cycle of the third row. That is, the scalar register SR0 in the second row and the scalar register SR0 in the third row are handled as different “variables”. Therefore, if interrupt processing is performed between the first row and the second row, the scalar register SR0 in the second row and the scalar register SR0 in the third row become the same “variable”, and the second row The processing result is incorrect.

より具体的には、a,b,c,d,x,yを変数とすると、第1行は、c=d(スカラレジスタSR0に{%SR6,%SR7}のメモリアドレスの値を代入する)という処理であり、第2行は、x=a+b(第1行の処理結果が反映される前のスカラレジスタSR0の値とスカラレジスタSR1の値とを加算し、スカラレジスタSR2に代入する)という処理である。また、第3行は、y=c+b(第1行の処理結果が反映された後のスカラレジスタSR0の値とスカラレジスタSR1の値とを加算し、スカラレジスタSR2に代入する)という処理である。したがって、第1行と第2行との間に割り込み処理が行われると、本来異なるべき変数a,cが等しくなってしまい、SR2,3に格納される値(x,y)も、本来異なる値となるところが等しくなってしまう。   More specifically, if a, b, c, d, x, and y are variables, the first line substitutes the memory address value of c = d ({% SR6,% SR7} into the scalar register SR0). ), And the second line is x = a + b (the value of the scalar register SR0 and the value of the scalar register SR1 before the processing result of the first line is reflected is added and substituted into the scalar register SR2) This is the process. The third line is a process of y = c + b (the value of the scalar register SR0 and the value of the scalar register SR1 after the processing result of the first line is reflected is added and substituted into the scalar register SR2). . Therefore, if interrupt processing is performed between the first row and the second row, the variables a and c that should be different from each other become equal, and the values (x, y) stored in SR2 and SR3 are also originally different. The place where it becomes a value becomes equal.

したがって、上述のような依存関係を確認した上で、命令に関与するデータに依存関係がなければ、ベクトル命令あるいはマルチサイクル命令の実行中であっても、外部割り込み処理を実行させることが可能である。   Therefore, after confirming the dependency relationship as described above, if there is no dependency relationship with the data related to the instruction, external interrupt processing can be executed even during execution of a vector instruction or multicycle instruction. is there.

プロセッサ1の構成を示す図である。2 is a diagram illustrating a configuration of a processor 1. FIG. プロセッサ1の動作を示す状態遷移図である。FIG. 4 is a state transition diagram showing an operation of the processor 1. ベクトル命令の処理中に外部割り込みが発生した場合の動作例を示すタイミングチャートである。It is a timing chart showing an operation example when an external interrupt occurs during processing of a vector instruction. ベクトル命令の処理中に外部割り込みが発生した場合のプロセッサ1の動作を示す模式図である。It is a schematic diagram which shows operation | movement of the processor 1 when an external interrupt generate | occur | produces during the process of a vector instruction. マルチサイクル命令に対応する場合のプロセッサ1の構成を示す図である。It is a figure which shows the structure of the processor 1 in the case of respond | corresponding to a multi cycle instruction. マルチサイクル命令の処理中に割り込み処理が発生した場合の本発明の動作例を示すタイミングチャートである。It is a timing chart which shows the operation example of this invention when interruption processing generate | occur | produces during the process of a multi-cycle instruction | indication. マルチサイクル命令の処理中に割り込み処理が発生した場合の従来の動作例を示すタイミングチャートである。It is a timing chart which shows the example of the conventional operation | movement when an interruption process generate | occur | produces during the process of a multi-cycle instruction. プロセッサ2の構成を示す図である。2 is a diagram showing a configuration of a processor 2. FIG. 連続するベクトル命令の処理中に割り込み処理が発生した場合の本発明の動作例を示すタイミングチャートである。It is a timing chart which shows the operation example of this invention when interruption processing generate | occur | produces during the process of a continuous vector instruction. 連続するベクトル命令の処理中に割り込み処理が発生した場合のプロセッサ2の動作を示す模式図である。It is a schematic diagram which shows operation | movement of the processor 2 when an interruption process generate | occur | produces during the process of a continuous vector instruction. マルチサイクル命令に対応する場合のプロセッサ2の構成を示す図である。It is a figure which shows the structure of the processor 2 in the case of respond | corresponding to a multi cycle instruction. 割り込み処理を実行可能な従来のプロセッサ200の構成を示す図である。It is a figure which shows the structure of the conventional processor 200 which can perform an interrupt process. ベクトル命令の処理中に割り込みが発生した場合のプロセッサ200の動作を示す模式図である。FIG. 11 is a schematic diagram illustrating an operation of the processor 200 when an interrupt occurs during processing of a vector instruction.

符号の説明Explanation of symbols

1,2,200 プロセッサ、101,201 フェッチ部、102,202 デコード部、103,203 ALU部、104,204 乗算部、105,205 加減算部、106,206 ロード部、107,207 ストア部、108,208 レジスタファイル部、109 ベクトル命令実行検出部、109a ベクトル命令連続実行検出部、110,209 プログラム制御部、111,210 例外管理部、112,211 外部割り込み制御部、113 マルチサイクル命令実行検出部、113a マルチサイクル命令連続実行検出部、209a プログラムカウンタ、209b ステータスレジスタ、209c 割り込み処理用プログラムカウンタ、209d 割り込みベクタ 1,2,200 processor, 101,201 fetch unit, 102,202 decoding unit, 103,203 ALU unit, 104,204 multiplication unit, 105,205 addition / subtraction unit, 106,206 load unit, 107,207 store unit, 108 , 208 register file section, 109 vector instruction execution detection section, 109a vector instruction continuous execution detection section, 110, 209 program control section, 111, 210 exception management section, 112, 211 external interrupt control section, 113 multi-cycle instruction execution detection section 113a multi-cycle instruction continuous execution detection unit, 209a program counter, 209b status register, 209c interrupt processing program counter, 209d interrupt vector

Claims (8)

ベクトル命令あるいはマルチサイクル命令を処理可能であり、その処理中に割り込み処理を実行可能なプロセッサであって、
前記ベクトル命令あるいはマルチサイクル命令の処理中であるか否かを検出する実行検出手段と、
前記実行検出手段によって、前記ベクトル命令あるいはマルチサイクル命令の処理中であることが検出された場合に、該ベクトル命令あるいはマルチサイクル命令の処理が終了するまで割り込み処理の実行を保留させることが可能な割り込み制御手段と、
を含むことを特徴とするプロセッサ。
A processor capable of processing vector instructions or multi-cycle instructions and capable of executing interrupt processing during the processing,
Execution detection means for detecting whether the vector instruction or the multi-cycle instruction is being processed;
When the execution detection means detects that the vector instruction or multicycle instruction is being processed, the execution of the interrupt process can be suspended until the processing of the vector instruction or multicycle instruction is completed. Interrupt control means;
A processor comprising:
処理されている前記ベクトル命令あるいはマルチサイクル命令に引き続く命令が、ベクトル命令あるいはマルチサイクル命令であるか否かを検出する連続実行検出手段をさらに含み、
前記割り込み制御手段は、前記連続実行検出手段によって、処理されている前記ベクトル命令あるいはマルチサイクル命令に引き続く命令が、ベクトル命令あるいはマルチサイクル命令であることが検出された場合に、処理されている前記ベクトル命令あるいはマルチサイクル命令の処理と、それに引き続く命令の処理とが終了するまで割り込み処理の実行を保留させることが可能であることを特徴とする請求項1記載のプロセッサ。
Further comprising continuous execution detecting means for detecting whether an instruction subsequent to the vector instruction or multi-cycle instruction being processed is a vector instruction or a multi-cycle instruction;
The interrupt control means is processed when the continuous execution detecting means detects that the instruction following the vector instruction or multicycle instruction being processed is a vector instruction or multicycle instruction. 2. The processor according to claim 1, wherein execution of interrupt processing can be suspended until processing of vector instructions or multi-cycle instructions and processing of subsequent instructions are completed.
処理されている前記ベクトル命令あるいはマルチサイクル命令に関与するデータと、それに引き続く命令に関与するデータとの依存関係を判定する判定手段をさらに含み、
前記割り込み制御手段は、前記判定手段によって、前記依存関係があると判定された場合、割り込み処理の実行を保留し、前記依存関係がないと判定された場合、割り込み処理を実行することを特徴とする請求項1または2記載のプロセッサ。
A determination means for determining a dependency relationship between data relating to the vector instruction or multi-cycle instruction being processed and data relating to a subsequent instruction;
The interrupt control means suspends execution of interrupt processing when the determination means determines that the dependency relationship exists, and executes interrupt processing when it is determined that the dependency relationship does not exist. The processor according to claim 1 or 2.
前記判定手段は、処理されているベクトル命令あるいはマルチサイクル命令のデスティネーションレジスタと、引き続く命令のソースレジスタとの関連性に基づいて、前記依存関係を判定することを特徴とする請求項3記載のプロセッサ。   4. The determination unit according to claim 3, wherein the determination unit determines the dependency relationship based on a relationship between a destination register of a vector instruction or multicycle instruction being processed and a source register of a subsequent instruction. Processor. ベクトル命令あるいはマルチサイクル命令を処理可能であり、その処理中に割り込み処理を実行可能なプロセッサにおける割り込み制御方法であって、
前記ベクトル命令あるいはマルチサイクル命令の処理中であるか否かを検出する実行検出ステップと、
前記実行検出ステップにおいて、前記ベクトル命令あるいはマルチサイクル命令の処理中であることが検出された場合に、該ベクトル命令あるいはマルチサイクル命令の処理が終了するまで割り込み処理の実行を保留させる割り込み制御ステップと、
を含むことを特徴とする割り込み制御方法。
An interrupt control method in a processor capable of processing vector instructions or multi-cycle instructions and capable of executing interrupt processing during the processing,
An execution detection step for detecting whether the vector instruction or the multi-cycle instruction is being processed;
An interrupt control step for suspending execution of interrupt processing until the processing of the vector instruction or multicycle instruction is completed when it is detected that the vector instruction or multicycle instruction is being processed in the execution detection step; ,
An interrupt control method comprising:
処理されている前記ベクトル命令あるいはマルチサイクル命令に引き続く命令が、ベクトル命令あるいはマルチサイクル命令であるか否かを検出する連続実行検出ステップをさらに含み、
前記割り込み制御ステップにおいては、処理されている前記ベクトル命令あるいはマルチサイクル命令に引き続く命令が、ベクトル命令あるいはマルチサイクル命令であることが検出された場合に、処理されている前記ベクトル命令あるいはマルチサイクル命令の処理と、それに引き続く命令の処理とが終了するまで割り込み処理の実行を保留させることを特徴とする割り込み制御方法。
A continuous execution detecting step for detecting whether an instruction subsequent to the vector instruction or multi-cycle instruction being processed is a vector instruction or a multi-cycle instruction;
In the interrupt control step, when it is detected that the instruction subsequent to the vector instruction or multicycle instruction being processed is a vector instruction or multicycle instruction, the vector instruction or multicycle instruction being processed is detected. An interrupt control method characterized in that execution of interrupt processing is suspended until the processing of the above and the subsequent instruction processing are completed.
処理されている前記ベクトル命令あるいはマルチサイクル命令に関与するデータと、それに引き続く命令に関与するデータとの依存関係を判定する判定ステップをさらに含み、
前記割り込み制御ステップにおいては、前記依存関係があると判定された場合、割り込み処理の実行を保留し、前記依存関係がないと判定された場合、割り込み処理を実行することを特徴とする請求項5または6記載の割り込み制御方法。
A determination step of determining a dependency relationship between the data related to the vector instruction or the multi-cycle instruction being processed and the data related to the subsequent instruction;
6. The interrupt control step of suspending execution of interrupt processing when it is determined that the dependency relationship is present, and executing interrupt processing when it is determined that the dependency relationship is not present. Or the interruption control method of 6.
前記判定ステップにおいては、処理されているベクトル命令あるいはマルチサイクル命令のデスティネーションレジスタと、引き続く命令のソースレジスタとの関連性に基づいて、前記依存関係を判定することを特徴とする請求項7記載の割り込み制御方法。   8. The determination step according to claim 7, wherein the dependency relationship is determined based on a relationship between a destination register of a vector instruction or multicycle instruction being processed and a source register of a subsequent instruction. Interrupt control method.
JP2003323783A 2003-09-16 2003-09-16 Processor and interrupt control method thereof Expired - Fee Related JP4063182B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003323783A JP4063182B2 (en) 2003-09-16 2003-09-16 Processor and interrupt control method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003323783A JP4063182B2 (en) 2003-09-16 2003-09-16 Processor and interrupt control method thereof

Publications (2)

Publication Number Publication Date
JP2005092467A true JP2005092467A (en) 2005-04-07
JP4063182B2 JP4063182B2 (en) 2008-03-19

Family

ID=34454723

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003323783A Expired - Fee Related JP4063182B2 (en) 2003-09-16 2003-09-16 Processor and interrupt control method thereof

Country Status (1)

Country Link
JP (1) JP4063182B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009205473A (en) * 2008-02-28 2009-09-10 Nec Corp Processing state management apparatus, processing state management method, and program
US9405549B2 (en) 2011-03-04 2016-08-02 Nec Corporation Deadlock avoidance method and deadlock avoidance mechanism
CN114968365A (en) * 2022-07-27 2022-08-30 广州智慧城市发展研究院 Adapter register unit and host adapter circuit comprising same

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009205473A (en) * 2008-02-28 2009-09-10 Nec Corp Processing state management apparatus, processing state management method, and program
US8539058B2 (en) 2008-02-28 2013-09-17 Nec Corporation Processing state management device, processing state management method, and program
US9405549B2 (en) 2011-03-04 2016-08-02 Nec Corporation Deadlock avoidance method and deadlock avoidance mechanism
CN114968365A (en) * 2022-07-27 2022-08-30 广州智慧城市发展研究院 Adapter register unit and host adapter circuit comprising same

Also Published As

Publication number Publication date
JP4063182B2 (en) 2008-03-19

Similar Documents

Publication Publication Date Title
EP0111776B1 (en) Interrupt processor
EP0423906B1 (en) Method of and apparatus for nullifying an instruction
JP3881763B2 (en) Data processing device
EP0269980B1 (en) Data processor for parallelly executing conflicting instructions
US5596733A (en) System for exception recovery using a conditional substitution instruction which inserts a replacement result in the destination of the excepting instruction
JP5611756B2 (en) Program flow control
JPH04275628A (en) Arithmetic processor
JPH06242948A (en) Pipeline processing computer
US20030120900A1 (en) Apparatus and method for a software pipeline loop procedure in a digital signal processor
US5634136A (en) Data processor and method of controlling the same
JP4063182B2 (en) Processor and interrupt control method thereof
JP2008299729A (en) Processor
TW201823972A (en) Vector generating instruction
US6851044B1 (en) System and method for eliminating write backs with buffer for exception processing
US20030084272A1 (en) Handling problematic events in a data processing apparatus
KR102379886B1 (en) Vector instruction processing
EP0573071A2 (en) A microprocessor
JP2721610B2 (en) Programmable controller
JP2503223B2 (en) Prior control method
JP2721611B2 (en) Programmable controller
JP3748191B2 (en) Computer and its control method
JP2005135089A (en) Processor
JP2021144426A (en) Processor and error detection method
JP2000305782A (en) Arithmetic unit
JPH04247523A (en) Device and method for processing exception

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060327

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20070403

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070803

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070911

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20071108

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20071211

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20071224

R150 Certificate of patent (=grant) or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20110111

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20110111

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20120111

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20120111

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20130111

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20130111

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20140111

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees