JP5511299B2 - Data arithmetic device control circuit and data arithmetic device - Google Patents
Data arithmetic device control circuit and data arithmetic device Download PDFInfo
- Publication number
- JP5511299B2 JP5511299B2 JP2009239281A JP2009239281A JP5511299B2 JP 5511299 B2 JP5511299 B2 JP 5511299B2 JP 2009239281 A JP2009239281 A JP 2009239281A JP 2009239281 A JP2009239281 A JP 2009239281A JP 5511299 B2 JP5511299 B2 JP 5511299B2
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- address
- register
- loop
- output
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 claims description 60
- 230000015654 memory Effects 0.000 claims description 57
- 238000012545 processing Methods 0.000 claims description 50
- 230000003252 repetitive effect Effects 0.000 claims description 19
- 238000012805 post-processing Methods 0.000 description 11
- 238000010586 diagram Methods 0.000 description 10
- 230000000694 effects Effects 0.000 description 4
- 238000004886 process control Methods 0.000 description 3
- 230000015556 catabolic process Effects 0.000 description 1
- 150000001875 compounds Chemical class 0.000 description 1
- 238000006731 degradation reaction Methods 0.000 description 1
- 238000012804 iterative process Methods 0.000 description 1
Images
Landscapes
- Executing Machine-Instructions (AREA)
- Advance Control (AREA)
Description
この発明は、一連の演算命令を演算器に繰り返し実行させる制御回路と、その制御回路と演算器を実装しているデータ演算装置とに関するものである。 The present invention relates to a control circuit that causes an arithmetic unit to repeatedly execute a series of arithmetic instructions, and a data arithmetic device in which the control circuit and the arithmetic unit are mounted.
一連の演算命令を繰り返し実行(ループ実行)するプログラムの場合、一般的に、ループの初期化部分と、演算処理の本体部分と、ループの後処理部分とから構成される。
図7は一般的なループ制御を行うプログラム例を示す説明図である。
図7のプログラムは、一連の演算命令である「命令C0〜C99」を100回ループ実行するものである。
In the case of a program that repeatedly executes a series of arithmetic instructions (loop execution), it is generally composed of a loop initialization part, a main part of arithmetic processing, and a post-processing part of the loop.
FIG. 7 is an explanatory diagram showing a program example for performing general loop control.
The program shown in FIG. 7 executes a series of “instructions C0 to C99”, which are a series of arithmetic instructions, in a loop execution 100 times.
即ち、図7のプログラムでは、ループの初期化部分において、一連の演算命令の繰り返し回数(ループ回数)として、“100”をループカウンタに設定する初期化処理を実行している。
次に、演算処理の本体部分において、一連の演算命令である「命令C0〜C99」を実行している。
ループの後処理部分では、一連の演算命令である「命令C0〜C99」が実行されると、ループカウンタのカウント値をデクリメントし、デクリメント後のカウント値が“0”であるか否かを判定する。
デクリメント後のカウント値が“0”でなければ、再度、演算処理の本体部分に戻り、デクリメント後のカウント値が“0”であれば、ループを抜けて、一連の演算命令の実行を終了する。
That is, in the program of FIG. 7, in the loop initialization part, an initialization process is executed in which “100” is set in the loop counter as the number of repetitions of a series of operation instructions (the number of loops).
Next, “instructions C0 to C99” which are a series of arithmetic instructions are executed in the main part of the arithmetic processing.
In the post-processing portion of the loop, when “instruction C0 to C99”, which is a series of operation instructions, is executed, the count value of the loop counter is decremented and it is determined whether or not the count value after decrement is “0”. To do.
If the count value after decrement is not “0”, the process returns to the main part of the arithmetic processing again. If the count value after decrement is “0”, the loop is exited and execution of a series of operation instructions is terminated. .
このとき、ループの初期化部分と後処理部分は、ループ実行を制御するための処理を実行する部分であって、実際に演算命令を実行する部分ではないため、演算処理の本体部分から見るとオーバーヘッドとなる。
特に、ループの後処理部分は、演算処理の本体部分を1回実行する毎に発生するため、ループ回数が多くなれば、その分だけオーバーヘッドも増加して性能が低下する。
At this time, the initialization part and the post-processing part of the loop are parts for executing the process for controlling the loop execution and not the part for actually executing the arithmetic instruction. Overhead.
In particular, the post-processing portion of the loop occurs every time the main body of the arithmetic processing is executed once. Therefore, if the number of loops increases, the overhead increases accordingly and the performance deteriorates.
以下の非特許文献1には、ループ制御による性能低下を抑制する方法として、“ループアンローリング”が開示されている。
“ループアンローリング”は、本来のループ1回分の演算処理を数回分まとめて新たな演算処理の本体部分を生成することで、ループの繰り返し回数を削減するものである。
これにより、トータルのオーバーヘッドが削減されて、データ演算の高速化を図ることができるが、ループの繰り返し回数を削減する分だけ、演算処理の本体部分の命令数が増加する。
Non-Patent Document 1 below discloses “loop unrolling” as a method of suppressing performance degradation due to loop control.
“Loop unrolling” is to reduce the number of iterations of a loop by creating a main part of a new operation process by combining a number of operations for one original loop.
As a result, the total overhead can be reduced and the speed of data operation can be increased. However, the number of instructions in the main part of the operation processing increases as the number of loop iterations is reduced.
例えば、一連の演算処理を100回繰り返すループ実行のオーバーヘッドを削減するために、“ループアンローリング”によって、4回分の演算処理をまとめて新たな演算処理の本体部分を生成すると、ループの繰り返し回数が4分の1の25回に削減されるため、ループ制御によるオーバーヘッドが4分の1に削減される。
ただし、4回分の演算処理をまとめれば、演算処理の本体部分の命令数が4倍に増加して、プログラム量が増加することになる。
For example, in order to reduce the overhead of loop execution that repeats a series of arithmetic processes 100 times, if “loop unrolling” is used to generate a main part of the arithmetic process by combining four arithmetic processes, the number of loop iterations Is reduced to 25 times, which is a quarter, so that the overhead due to loop control is reduced to a quarter.
However, if the arithmetic processing for four times is put together, the number of instructions in the main part of the arithmetic processing increases four times and the program amount increases.
なお、以下の特許文献1には、ループ情報にしたがってループ実行を行う専用のループ制御回路を設けているデータ演算装置が開示されている。 The following Patent Document 1 discloses a data arithmetic device provided with a dedicated loop control circuit that performs loop execution according to loop information.
従来のデータ演算装置の制御回路は以上のように構成されているので、ループ実行を行う専用のループ制御回路を設ければ、“ループアンローリング”のように、プログラム量の増加を招くことなく、ループ制御によるオーバーヘッドを削減することができる。しかし、ループ実行を伴わない演算命令の実行を制御する一般的な制御回路の他に、専用のループ制御回路を設ける必要があるため、ハードウェア規模の大型化を招いてしまうなどの課題があった。 Since the control circuit of the conventional data operation device is configured as described above, if a dedicated loop control circuit for performing loop execution is provided, the program amount does not increase as in “loop unrolling”. The overhead due to loop control can be reduced. However, it is necessary to provide a dedicated loop control circuit in addition to a general control circuit that controls the execution of arithmetic instructions that do not involve loop execution, resulting in an increase in hardware scale. It was.
この発明は上記のような課題を解決するためになされたもので、専用のループ制御回路を設けることなく、僅かなプログラム量の増加だけで、ループ制御によるオーバーヘッドを削減することができるデータ演算装置の制御回路及びデータ演算装置を得ることを目的とする。 The present invention has been made to solve the above-described problems, and is a data arithmetic apparatus capable of reducing the overhead due to loop control by providing only a slight increase in the program amount without providing a dedicated loop control circuit. It is an object to obtain a control circuit and a data operation device.
この発明に係るデータ演算装置の制御回路は、初期設定手段により設定されたスタートアドレスを読み出しアドレスに設定して、その読み出しアドレスを出力し、その後、その読み出しアドレスをインクリメントして、インクリメント後の読み出しアドレスを出力する処理を繰り返し実施するアドレス出力手段と、初期設定手段により設定された繰り返しの有無が“有”である場合、アドレス出力手段から出力された読み出しアドレスが初期設定手段により設定されたエンドアドレスと一致すると、1ループ終了通知を出力するとともに、現時点までに演算終了指示が出力されていなければ、アドレス出力手段により設定された読み出しアドレスをスタートアドレスに戻して、アドレス出力処理の継続をアドレス出力手段に指示し、初期設定手段により設定された繰り返しの有無が“無”である場合、アドレス出力手段から出力された読み出しアドレスが初期設定手段により設定されたエンドアドレスと一致すると、アドレス出力処理の停止をアドレス出力手段に指示する繰り返し処理制御手段とを設け、演算終了判定手段が、繰り返し処理制御手段による1ループ終了通知の出力回数と初期設定手段により設定された繰り返し回数を比較して繰り返し演算を終了するか否かを判定し、繰り返し演算を終了する際に演算終了指示を繰り返し処理制御手段に出力するようにしたものである。 The control circuit of the data arithmetic device according to the present invention sets the start address set by the initial setting means to the read address, outputs the read address, then increments the read address, and reads after the increment If the presence / absence of the repetition set by the initial setting means and the address output means for repeatedly performing the process of outputting the address is “Yes”, the read address output from the address output means is the end set by the initial setting means. If it matches the address, a one-loop end notification is output, and if no operation end instruction has been output so far, the read address set by the address output means is returned to the start address, and the continuation of the address output processing is addressed. Instruct the output means and make initial settings When the presence / absence of repetition set by the stage is “None”, when the read address output from the address output means matches the end address set by the initial setting means, the address output means is instructed to stop address output processing. Whether or not the calculation end determination means ends the repetition calculation by comparing the number of outputs of one loop end notification by the repetition processing control means with the number of repetitions set by the initial setting means. When the determination is made and the repetitive calculation is ended, a calculation end instruction is output to the repetitive processing control means.
この発明によれば、初期設定手段により設定されたスタートアドレスを読み出しアドレスに設定して、その読み出しアドレスを出力し、その後、その読み出しアドレスをインクリメントして、インクリメント後の読み出しアドレスを出力する処理を繰り返し実施するアドレス出力手段と、初期設定手段により設定された繰り返しの有無が“有”である場合、アドレス出力手段から出力された読み出しアドレスが初期設定手段により設定されたエンドアドレスと一致すると、1ループ終了通知を出力するとともに、現時点までに演算終了指示が出力されていなければ、アドレス出力手段により設定された読み出しアドレスをスタートアドレスに戻して、アドレス出力処理の継続をアドレス出力手段に指示し、初期設定手段により設定された繰り返しの有無が“無”である場合、アドレス出力手段から出力された読み出しアドレスが初期設定手段により設定されたエンドアドレスと一致すると、アドレス出力処理の停止をアドレス出力手段に指示する繰り返し処理制御手段とを設け、演算終了判定手段が、繰り返し処理制御手段による1ループ終了通知の出力回数と初期設定手段により設定された繰り返し回数を比較して繰り返し演算を終了するか否かを判定し、繰り返し演算を終了する際に演算終了指示を繰り返し処理制御手段に出力するように構成したので、専用のループ制御回路を設けることなく、僅かなプログラム量の増加だけで、ループ制御によるオーバーヘッドを削減することができる効果がある。 According to this invention, the start address set by the initial setting means is set as a read address, the read address is output, the read address is incremented, and the incremented read address is output. When the address output means to be repeatedly executed and the presence / absence of repetition set by the initial setting means are “present”, if the read address output from the address output means matches the end address set by the initial setting means, 1 A loop end notification is output, and if an operation end instruction has not been output by the present time, the read address set by the address output unit is returned to the start address, and the address output unit is instructed to continue the address output process. Repeat set by the initial setting means In the case where the presence / absence of the address is “None”, when the read address output from the address output unit coincides with the end address set by the initial setting unit, the repetitive process control unit instructs the address output unit to stop the address output process The calculation end determination means compares the number of outputs of one-loop end notification by the repetition processing control means with the number of repetitions set by the initial setting means, determines whether or not to end the repetition calculation, and repeats the calculation. Since the calculation end instruction is repeatedly output to the processing control means when ending the process, the overhead due to the loop control can be reduced with only a slight increase in the program amount without providing a dedicated loop control circuit. There is an effect that can be done.
実施の形態1.
図1はこの発明の実施の形態1によるデータ演算装置を示す構成図である。
図1において、制御回路1はシーケンス制御用のプログラムを実行することで、一連の演算命令を演算器2に発行して、演算器2の演算結果を取得する処理を実施する。
演算器2は制御回路1から発行された演算命令を実行して、その演算命令の演算結果を制御回路1に返す処理を実施する。
Embodiment 1 FIG.
FIG. 1 is a block diagram showing a data operation apparatus according to Embodiment 1 of the present invention.
In FIG. 1, the control circuit 1 executes a sequence control program, thereby issuing a series of arithmetic instructions to the
The
シーケンス制御部11はシーケンス制御用のプログラム内の命令が、演算用命令メモリ32に格納されている一連の演算命令を演算器2に実行させる演算開始命令であれば、一連の演算命令の中の先頭の演算命令が格納されている演算用命令メモリ32内のアドレスを示すスタートアドレスをレジスタ群22のスタートアドレスレジスタ22bに設定するとともに、一連の演算命令の中の最後の演算命令が格納されている演算用命令メモリ32内のアドレスを示すエンドアドレスをレジスタ群22のエンドアドレスレジスタ22cに設定し、また、一連の演算命令の繰り返しの有無を示すループ指示(ON/OFF)をレジスタ群22のループ指示レジスタ22aに設定する処理を実施する。また、シーケンス制御用のプログラム内の命令が、一連の演算命令の繰り返し回数(以下、「ループ回数」と称する)を設定する設定命令であれば、ループ回数を汎用レジスタ15に設定する処理を実施する。
また、シーケンス制御部11は演算器制御部21における演算命令の発行処理と並行して、ループ制御の後処理として、繰り返し演算(ループ実行)を終了するか否かを判定する処理を実施する。即ち、PC制御部23による「1ループ終了通知」の出力回数とループ回数を比較して繰り返し演算を終了するか否かを判定し、繰り返し演算を終了する際に「演算終了指示」をPC制御部23に出力する処理を実施する。
If the instruction in the sequence control program is an operation start instruction that causes the
In addition, the
シーケンス制御用命令メモリ12はシーケンス制御用のプログラムを格納している記録媒体である。
なお、シーケンス制御用のプログラムには、演算用命令メモリ32に格納されている一連の演算命令を演算器2に実行させる演算開始命令(スタートアドレス、エンドアドレス、ループ指示(ON/OFF)を含む命令)のほか、ループ回数を汎用レジスタ15に設定するための命令や、ループ制御の後処理として、繰り返し演算(ループ実行)を終了するか否かを判定するための命令や、内部演算器14が実行する単一演算命令(単一演算命令は、シーケンス制御に必要な演算を行う命令であり、例えば、2値の加算、減算、乗算、比較、レジスタの読み書きなどの命令が該当する)などが含まれている。
The sequence
The sequence control program includes a calculation start instruction (start address, end address, loop instruction (ON / OFF)) that causes the
演算器制御指示生成回路13はシーケンス制御用命令メモリ12により格納されているシーケンス制御用のプログラム内の命令が、演算用命令メモリ32に格納されている一連の演算命令を演算器2に実行させる演算開始命令であれば、書き込みイネーブルをレジスタ群22に出力することで、その演算開始命令のオペランドであるスタートアドレスをレジスタ群22のスタートアドレスレジスタ22bに設定し、その演算開始命令のオペランドであるエンドアドレスをレジスタ群22のエンドアドレスレジスタ22cに設定し、また、その演算開始命令のオペランドであるループ指示(ON/OFF)をレジスタ群22のループ指示レジスタ22aに設定する処理を実施する。
また、演算器制御指示生成回路13はスタートアドレス等の設定を完了したのち、内部演算器14の指示の下、「演算開始指示」又は「演算終了指示」をPC制御部23に出力する一方、PC制御部23から出力された「1ループ終了通知」を内部演算器14に転送する処理を実施する。
なお、演算器制御指示生成回路13は初期設定手段を構成している。
The arithmetic unit control
Further, after completing the setting of the start address and the like, the arithmetic unit control
The calculator control
内部演算器14はシーケンス制御用命令メモリ12により格納されているシーケンス制御用のプログラム内の命令が、ループ回数を設定する設定命令であれば、ループ回数を汎用レジスタ15に設定し、シーケンス制御用のプログラム内の命令が、単一演算命令であれば、その単一演算命令にしたがって単一演算を実行し、その演算結果を汎用レジスタ15に格納する処理を実施する。
また、内部演算器14はシーケンス制御用のプログラム内の命令が、ループ制御の後処理部分に相当する「do−while命令」であれば、演算器制御指示生成回路13による「1ループ終了通知」の転送回数と汎用レジスタ15に設定しているループ回数を比較して繰り返し演算(ループ実行)を終了するか否かを判定し、繰り返し演算を終了する際に、演算器制御指示生成回路13を介して、「演算終了指示」をPC制御部23に出力する処理を実施する。
さらに、内部演算器14は演算器2から返された演算結果を用いて、所定のシーケンス制御を実行する。
なお、内部演算器14は演算終了判定手段を構成している。
汎用レジスタ15はループ回数や単一演算の演算結果などを格納する記録媒体である。
If the instruction in the sequence control program stored in the sequence
Further, if the instruction in the sequence control program is a “do-while instruction” corresponding to a post-processing part of the loop control, the
Further, the
The
The general-
演算器制御部21はレジスタ群22、PC制御部23及び命令発行部31から構成されており、シーケンス制御部11の指示の下、一連の演算命令を演算器2に発行する処理を実施する。
レジスタ群22はループ指示(ON/OFF)を格納するループ指示レジスタ22aと、スタートアドレスを格納するスタートアドレスレジスタ22bと、エンドアドレスを格納するエンドアドレスレジスタ22cとから構成されている記録媒体である
PC制御部23はレジスタ群22を参照して、演算用命令メモリ32に格納されている演算命令を読み出すための読み出しアドレスを生成する処理を実施する。
The computing
The register group 22 is a recording medium including a
フラグ生成回路24は演算器制御指示生成回路13から「演算開始指示」が出力されると、実行フラグレジスタ25に“有効”(“1”)を設定し、また、スタートアドレスレジスタ22bからスタートアドレスを取得するとともに、エンドアドレスレジスタ22cからエンドアドレスを取得し、そのエンドアドレスからスタートアドレスを減算して、差分値(エンドアドレス−スタートアドレス)を算出する処理を実施する。
また、フラグ生成回路24は現PCレジスタ29のレジスタ値(初期状態では、レジスタ値は“0”)が上記差分値に到達すると、ループ指示レジスタ22aに格納されているループ指示が「ON」である場合、演算終了フラグレジスタ26が“無効”(“0”)であれば、実行フラグレジスタ25に設定されている“有効”(“1”)を維持し、演算終了フラグレジスタ26が“有効”(“1”)であれば、実行フラグレジスタ25に設定されている“有効”(“1”)を“無効”(“0”)に変更する処理を実施する。
一方、ループ指示レジスタ22aに格納されているループ指示が「OFF」である場合、実行フラグレジスタ25に設定されている“有効”(“1”)を“無効”(“0”)に変更する処理を実施する。
また、フラグ生成回路24は演算器制御指示生成回路13から「演算終了指示」が出力されると、演算終了フラグレジスタ26に“有効”(“1”)を設定する処理を実施する。
When the “calculation start instruction” is output from the arithmetic unit control
When the register value of the current PC register 29 (the register value is “0” in the initial state) reaches the difference value, the
On the other hand, when the loop instruction stored in the
Further, the
実行フラグレジスタ25は初期状態では“無効”(“0”)が設定されており、フラグ生成回路24によって、適宜設定状態が変更される。
演算終了フラグレジスタ26は初期状態では“無効”(“0”)が設定されており、フラグ生成回路24によって、適宜設定状態が変更される。
The
The operation
PC生成回路27はスタートアドレスレジスタ22bからスタートアドレスを取得するとともに、エンドアドレスレジスタ22cからエンドアドレスを取得し、そのエンドアドレスからスタートアドレスを減算して、差分値(エンドアドレス−スタートアドレス)を算出する処理を実施する。
また、PC生成回路27は実行フラグレジスタ25が“有効”(“1”)である場合、次PCレジスタ28のレジスタ値(初期状態では、レジスタ値は“0”)を現PCレジスタ29に設定し、現PCレジスタ29のレジスタ値が上記差分値と一致しなければ、次PCレジスタ28のレジスタ値を1だけインクリメントする処理を実施する。
一方、現PCレジスタ29のレジスタ値が上記差分値と一致すれば、次PCレジスタ28のレジスタ値を“0”にクリアするとともに、「1ループ終了通知」を演算器制御指示生成回路13に出力する処理を実施する。
The
The
On the other hand, if the register value of the current PC register 29 matches the difference value, the register value of the
次PCレジスタ28は初期状態ではカウント値が“0”に設定されており、そのカウント値がPC生成回路27によって1ずつインクリメントされ、あるいは、“0”にクリアされる。
現PCレジスタ29は初期状態ではカウント値が“0”に設定されており、そのカウント値がPC生成回路27によって次PCレジスタ28のレジスタ値に設定される。
アドレス生成回路30はスタートアドレスレジスタ22bからスタートアドレスを取得するとともに、現PCレジスタ29のレジスタ値を取得し、そのスタートアドレスと現PCレジスタ29のレジスタ値との加算値を読み出しアドレスとして命令発行部31に出力する処理を実施する。
The count value of the
The count value of the
The
なお、PC生成回路27、次PCレジスタ28、現PCレジスタ29及びアドレス生成回路30からアドレス出力手段が構成されている。
また、フラグ生成回路24、実行フラグレジスタ25、演算終了フラグレジスタ26、PC生成回路27、次PCレジスタ28及び現PCレジスタ29から繰り返し処理制御手段が構成されている。
The
The
命令発行部31は実行フラグレジスタ25が“有効”(“1”)である場合、演算用命令メモリ32に格納されている演算命令の中から、アドレス生成回路30から出力された読み出しアドレスに対応する演算命令を読み出し、その演算命令を演算器2に発行する処理を実施する。なお、命令発行部31は命令発行手段を構成している。
演算用命令メモリ32は演算器2に発行する一連の演算命令を格納している記録媒体である。
When the
The
ここで、図2は演算用命令メモリ32により格納されている一連の演算命令を示す説明図である。
図3はシーケンス制御用命令メモリ12により格納されているシーケンス制御用のプログラム内の命令を示す説明図である。
図3では、PROC_C(命令C0〜C99)を100回繰り返し実行し、PROC_D(命令D0〜D44)を1回実行する例を示している。
Here, FIG. 2 is an explanatory diagram showing a series of operation instructions stored in the
FIG. 3 is an explanatory diagram showing instructions in the sequence control program stored in the sequence
FIG. 3 shows an example in which PROC_C (instructions C0 to C99) is repeatedly executed 100 times and PROC_D (instructions D0 to D44) is executed once.
次に動作について説明する。
この実施の形態1では、説明の便宜上、シーケンス制御用のプログラム内の命令が図3の命令であり、演算用命令メモリ32により格納されている一連の演算命令が図2の命令であるものとして説明する。
Next, the operation will be described.
In the first embodiment, for convenience of explanation, it is assumed that the instructions in the program for sequence control are the instructions in FIG. 3, and the series of arithmetic instructions stored in the
制御回路1は、処理開始前に初期化され、レジスタ群22のループ指示レジスタ22a、スタートアドレスレジスタ22b及びエンドアドレスレジスタ22cには“0”が設定される。
また、実行フラグレジスタ25及び演算終了フラグレジスタ26には、“無効”(“0”)が設定され、次PCレジスタ28及び現PCレジスタ29のカウント値には、“0”が設定される。
The control circuit 1 is initialized before the processing starts, and “0” is set in the
Further, “invalid” (“0”) is set in the
シーケンス制御部11は、シーケンス制御用命令メモリ12により格納されているシーケンス制御用のプログラムを読み込み、そのプログラム内の命令を解析する。
図3の例では、最初に、PROC_C(命令C0〜C99)を100回繰り返すために、ループ回数を設定する設定命令(図3では、“ループカウンタを100に設定する”と記述されている)がプログラムに記述されているので、シーケンス制御部11の内部演算器14は、その設定命令にしたがってループ回数を汎用レジスタ15に設定する。
図3の例では、ループ回数として、“100”を汎用レジスタ15に設定する。
The
In the example of FIG. 3, first, a setting command for setting the number of loops in order to repeat PROC_C (commands C0 to C99) 100 times (in FIG. 3, “setting the loop counter to 100” is described). Is described in the program, the internal
In the example of FIG. 3, “100” is set in the general-
次に、PROC_C(命令C0〜C99)の演算開始命令(記述(1))がプログラムに記述されているので、シーケンス制御部11の演算器制御指示生成回路13は、書き込みイネーブルをレジスタ群22に出力することで、その演算開始命令のオペランド(スタートアドレス、エンドアドレス、ループ指示(ON/OFF))をレジスタ群22に設定する。
図3の例では、演算器制御指示生成回路13が書き込みイネーブルをレジスタ群22に出力することにより、スタートアドレス=0x0110をスタートアドレスレジスタ22bに設定し、エンドアドレス=0x0173をエンドアドレスレジスタ22cに設定し、また、ループ指示(LOOP=ON)をループ指示レジスタ22aに設定する。
Next, since the operation start instruction (description (1)) of PROC_C (instructions C0 to C99) is described in the program, the arithmetic unit control
In the example of FIG. 3, the arithmetic unit control
ここで、スタートアドレス=0x0110は、演算用命令メモリ32に格納されている命令C0(ループ先頭の演算命令)のアドレスを示し、エンドアドレス=0x0173は、演算用命令メモリ32に格納されている命令C99(ループ最後の演算命令)のアドレスを示している。また、ループ指示(LOOP=ON)は、ループ実行を行う旨を示している。
したがって、この演算開始命令は、命令C0〜C99のループ実行を意味している。
演算器制御指示生成回路13は、スタートアドレス等の設定を完了したのち、内部演算器14の指示の下、「演算開始指示」をPC制御部23のフラグ生成回路24に出力する。
Here, the start address = 0x0110 indicates the address of the instruction C0 (the operation instruction at the head of the loop) stored in the
Therefore, this operation start instruction means loop execution of the instructions C0 to C99.
After completing the setting of the start address and the like, the arithmetic unit control
フラグ生成回路24は、演算器制御指示生成回路13から「演算開始指示」が出力されると、実行フラグレジスタ25に“有効”(“1”)を設定する。
また、フラグ生成回路24は、スタートアドレスレジスタ22bからスタートアドレスを取得するとともに、エンドアドレスレジスタ22cからエンドアドレスを取得し、そのエンドアドレスからスタートアドレスを減算して、差分値(エンドアドレス−スタートアドレス)を算出する。
この例では、スタートアドレス=0x0110、エンドアドレス=0x0173であるため、差分値(エンドアドレス−スタートアドレス)は“99”となる。
なお、この差分値は、フラグ生成回路24により、後で、現PCレジスタ29のレジスタ値と比較されるものであるため、内部のメモリ等に保持される。
The
Further, the
In this example, since the start address = 0x0110 and the end address = 0x0173, the difference value (end address−start address) is “99”.
The difference value is stored in an internal memory or the like because it is compared later with the register value of the
PC生成回路27は、フラグ生成回路24が実行フラグレジスタ25に“有効”(“1”)を設定すると、下記に示すレジスタ値の更新処理を開始する。
即ち、PC生成回路27は、フラグ生成回路24が実行フラグレジスタ25に“有効”(“1”)を設定すると、フラグ生成回路24と同様に、スタートアドレスレジスタ22bからスタートアドレスを取得するとともに、エンドアドレスレジスタ22cからエンドアドレスを取得し、そのエンドアドレスからスタートアドレスを減算して、差分値(エンドアドレス−スタートアドレス)を算出する。ここでは、PC生成回路27が差分値を算出しているが、フラグ生成回路24により算出された差分値を取得するようにしてもよい。あるいは、PC生成回路27が算出した差分値をフラグ生成回路24に与えるようにしてもよい。
また、PC生成回路27は、実行フラグレジスタ25が“有効”(“1”)である場合、次PCレジスタ28のレジスタ値を現PCレジスタ29に設定する。
この時点では、次PCレジスタ28のレジスタ値は“0”であるため、現PCレジスタ29のレジスタ値を“0”に設定する。
When the
That is, when the
The
At this time, since the register value of the
PC生成回路27は、次PCレジスタ28のレジスタ値を現PCレジスタ29に設定すると、現PCレジスタ29のレジスタ値と差分値(エンドアドレス−スタートアドレス)を比較する。
この時点では、現PCレジスタ29のレジスタ値は“0”であり、差分値は“99”である。
PC生成回路27は、現PCレジスタ29のレジスタ値が差分値と一致しないので、次PCレジスタ28のレジスタ値を1だけインクリメントする。
この時点では、次PCレジスタ28のレジスタ値は“1”となる。
When the register value of the
At this time, the register value of the
The
At this time, the register value of the
アドレス生成回路30は、スタートアドレスレジスタ22bからスタートアドレスを取得するとともに、現PCレジスタ29のレジスタ値を取得し、そのスタートアドレスと現PCレジスタ29のレジスタ値とを加算する。
この時点では、現PCレジスタ29のレジスタ値は“0”であり、スタートアドレス=0x0110であるため、そのスタートアドレスとレジスタ値の加算値は、“0x0110”となる。
アドレス生成回路30は、その加算値“0x0110”を読み出しアドレスとして、命令発行部31に出力する。
The
At this time, since the register value of the
The
命令発行部31は、実行フラグレジスタ25が“有効”(“1”)である場合、演算用命令メモリ32に格納されている演算命令の中から、アドレス生成回路30から出力された読み出しアドレスに対応する演算命令の読み出しを行う。
この時点では、読み出しアドレスが“0x0110”であるため、演算用命令メモリ32から“0x0110”に対応する命令C0の読み出しを行う。
命令発行部31は、演算命令である命令C0の読み出しを行うと、その命令C0を演算器2に発行する。
演算器2は、命令発行部31から命令C0が発行されると、命令C0を実行して、命令C0の演算結果を制御回路1のシーケンス制御部11に出力する。
When the
At this time, since the read address is “0x0110”, the instruction C0 corresponding to “0x0110” is read from the
The
When the instruction C0 is issued from the
PC生成回路27は、アドレス生成回路30が読み出しアドレス“0x0110”を命令発行部31に出力すると、引き続き、実行フラグレジスタ25が“有効”(“1”)であることを確認し、次PCレジスタ28のレジスタ値を現PCレジスタ29に設定する。
この時点では、次PCレジスタ28のレジスタ値は“1”であるため、現PCレジスタ29のレジスタ値を“1”に設定する。
When the
At this time, since the register value of the
PC生成回路27は、次PCレジスタ28のレジスタ値を現PCレジスタ29に設定すると、現PCレジスタ29のレジスタ値と差分値(エンドアドレス−スタートアドレス)を比較する。
この時点では、現PCレジスタ29のレジスタ値は“1”であり、差分値は“99”である。
PC生成回路27は、現PCレジスタ29のレジスタ値が差分値と一致しないので、次PCレジスタ28のレジスタ値を1だけインクリメントする。
この時点では、次PCレジスタ28のレジスタ値は“2”となる。
When the register value of the
At this time, the register value of the
The
At this time, the register value of the
アドレス生成回路30は、スタートアドレスレジスタ22bからスタートアドレスを取得するとともに、現PCレジスタ29のレジスタ値を取得し、そのスタートアドレスと現PCレジスタ29のレジスタ値とを加算する。
この時点では、現PCレジスタ29のレジスタ値は“1”であり、スタートアドレス=0x0110であるため、そのスタートアドレスとレジスタ値の加算値は、“0x0111”となる。
アドレス生成回路30は、その加算値“0x0111”を読み出しアドレスとして、命令発行部31に出力する。
The
At this time, since the register value of the
The
命令発行部31は、実行フラグレジスタ25が“有効”(“1”)である場合、演算用命令メモリ32に格納されている演算命令の中から、アドレス生成回路30から出力された読み出しアドレスに対応する演算命令の読み出しを行う。
この時点では、読み出しアドレスが“0x0111”であるため、演算用命令メモリ32から“0x0111”に対応する命令C1の読み出しを行う。
命令発行部31は、演算命令である命令C1の読み出しを行うと、その命令C1を演算器2に発行する。
演算器2は、命令発行部31から命令C1が発行されると、命令C1を実行して、命令C1の演算結果を制御回路1のシーケンス制御部11に出力する。
When the
At this time, since the read address is “0x0111”, the instruction C1 corresponding to “0x0111” is read from the
The
When the instruction C1 is issued from the
以降、現PCレジスタ29のレジスタ値が“98”になるまで、PC生成回路27、アドレス生成回路30、命令発行部31及び演算器2が同様の処理を繰り返し実施する。
これにより、命令C2〜C98が演算器2により実行されて、命令C2〜C98の演算結果が制御回路1のシーケンス制御部11に出力される。
この時点では、次PCレジスタ28のレジスタ値は“99”であり、現PCレジスタ29のレジスタ値は“98”である。
また、読み出しアドレスは“0x0172”である。
Thereafter, until the register value of the
As a result, the instructions C2 to C98 are executed by the
At this time, the register value of the
The read address is “0x0172”.
PC生成回路27は、アドレス生成回路30が読み出しアドレス“0x0172”を命令発行部31に出力すると、引き続き、実行フラグレジスタ25が“有効”(“1”)であることを確認し、次PCレジスタ28のレジスタ値を現PCレジスタ29に設定する。
この時点では、次PCレジスタ28のレジスタ値は“99”であるため、現PCレジスタ29のレジスタ値を“99”に設定する。
When the
At this time, since the register value of the
PC生成回路27は、次PCレジスタ28のレジスタ値を現PCレジスタ29に設定すると、現PCレジスタ29のレジスタ値と差分値(エンドアドレス−スタートアドレス)を比較する。
この時点では、現PCレジスタ29のレジスタ値は“99”であり、差分値は“99”である。
PC生成回路27は、現PCレジスタ29のレジスタ値が差分値と一致すると、次PCレジスタ28のレジスタ値を“0”にクリアするとともに、「1ループ終了通知」を演算器制御指示生成回路13に出力する。
When the register value of the
At this time, the register value of the
When the register value of the
フラグ生成回路24は、現PCレジスタ29のレジスタ値と内部のメモリ等に保持している差分値を比較し、現PCレジスタ29のレジスタ値が差分値と一致すると、ループ指示レジスタ22aに格納されているループ指示が「ON」であるのか、「OFF」であるのかを確認する。
この時点では、ループ指示レジスタ22aに格納されているループ指示は「ON」である。
フラグ生成回路24は、ループ指示が「ON」であることを確認すると、演算終了フラグレジスタ26が“無効”(“0”)であるのか、“有効”(“1”)であるのかを確認する。
この時点では、未だ、演算器制御指示生成回路13から「演算終了指示」が出力されていないので、演算終了フラグレジスタ26は“無効”(“0”)である。
The
At this time, the loop instruction stored in the
When the
At this time, since the “calculation end instruction” has not yet been output from the arithmetic unit control
フラグ生成回路24は、演算終了フラグレジスタ26が“無効”(“0”)であることを確認すると、実行フラグレジスタ25に設定されている“有効”(“1”)を維持する。
フラグ生成回路24が実行フラグレジスタ25に設定されている“有効”(“1”)を維持すると、PC生成回路27、アドレス生成回路30、命令発行部31及び演算器2は、上述した処理と同様の処理を繰り返し実施する。
即ち、PC生成回路27が、現PCレジスタ29のレジスタ値が“0”から“99”になるまで、そのレジスタ値を更新する処理を繰り返し、アドレス生成回路30が、読み出しアドレスが“0x0110”から“0x0173”になるまで、その読み出しアドレスを順次出力し、命令発行部31が命令C0〜C99を順次発行する。
これにより、演算器2は、命令C0〜C99を順次実行する。
When the
When the
That is, the
As a result, the
このように、命令発行部31から命令C0〜C99が順次発行される処理は、後述するように、演算器制御指示生成回路13から「演算終了指示」が出力されて、演算終了フラグレジスタ26が“有効”(“1”)になるまで繰り返される。
図3の例では、ループ回数が“100”に設定されているので、命令発行部31から命令C0〜C99が順次発行される処理は、100回繰り返される。
なお、上記の繰り返し処理において、現PCレジスタ29のレジスタ値が“99”となるサイクルの次のサイクルには、現PCレジスタ29のレジスタ値を“0”に戻すことが可能であるため、オーバーヘッドなしに、ループ先頭の演算命令を発行する処理に戻ることができる。
In this way, in the process in which the instructions C0 to C99 are sequentially issued from the
In the example of FIG. 3, since the loop count is set to “100”, the process of sequentially issuing the instructions C0 to C99 from the
It should be noted that in the above iterative process, the register value of the
シーケンス制御部11は、演算器制御部21における演算命令の発行処理と並行して、ループ制御の後処理として、繰り返し演算(ループ実行)を終了するか否かを判定する処理を実施する。
即ち、シーケンス制御部11の内部演算器14は、シーケンス制御用のプログラム内の命令が、ループ制御の後処理部分に相当する「do−while命令」であれば、do−while命令(図3では、記述(2)の命令)を実行する。
具体的には、以下の通りである。
The
That is, if the instruction in the sequence control program is a “do-while instruction” corresponding to a post-processing part of loop control, the internal
Specifically, it is as follows.
まず、シーケンス制御部11の内部演算器14は、汎用レジスタ15に設定されているループ回数“100”をループカウンタ(図示せぬ)に設定する。
ここでは、ループ回数をループカウンタに設定する例を示しているが、汎用レジスタ15をループカウンタとして用いる場合には、ループ回数を別のループカウンタに設定する必要はない。
演算器制御指示生成回路13は、PC制御部23のPC生成回路27から「1ループ終了通知」が出力されると、「1ループ終了通知」を内部演算器14に転送する。
First, the internal
Here, an example is shown in which the loop count is set in the loop counter. However, when the general-
When the “1 loop end notification” is output from the
内部演算器14は、演算器制御指示生成回路13から「1ループ終了通知」が転送される毎に、ループカウンタのカウント値を1だけデクリメントする。
内部演算器14は、ループカウンタのカウント値をデクリメントすると、デクリメント後のカウント値が“1”であるか否かを判定(演算終了判定)する。
ループカウンタのカウント値は、上述したように、“100”が設定されており、PC制御部23のPC生成回路27から「1ループ終了通知」が出力される毎(1回分のループ実行が完了する毎)に、カウント値が1デクリメントされるので、演算器制御部21において、99回分のループ実行が完了すると、ループカウンタのカウント値が“1”となる。
The
When the count value of the loop counter is decremented, the
As described above, the count value of the loop counter is set to “100”, and every time “1 loop end notification” is output from the
内部演算器14は、ループカウンタのカウント値が“1”になると、「演算終了指示」を演算器制御指示生成回路13に出力する。
即ち、内部演算器14は、残りのループ回数が1回になると、「演算終了指示」を演算器制御指示生成回路13に出力する。
演算器制御指示生成回路13は、内部演算器14から「演算終了指示」を受けると、「演算終了指示」をPC制御部23のフラグ生成回路24に出力する。
When the count value of the loop counter becomes “1”, the internal
That is, when the remaining number of loops reaches one, the
Upon receiving the “calculation end instruction” from the internal
PC制御部23のPC生成回路27は、99回分のループ実行が完了して(残りのループ回数が1回)、99回目の「1ループ終了通知」を出力した時点では、未だシーケンス制御部11の演算器制御指示生成回路13から「演算終了指示」が出力されておらず(内部演算器14は、PC生成回路27から99回目の「1ループ終了通知」を受けた時点から、99回目の演算終了判定を開始するので、PC生成回路27が99回目の「1ループ終了通知」を出力した時点では、演算器制御指示生成回路13から「演算終了指示」が出力されない)、アドレス生成回路30が読み出しアドレスを命令発行部31に出力すると、直ちに、実行フラグレジスタ25が“有効”(“1”)であることを確認して、次PCレジスタ28のレジスタ値を現PCレジスタ29に設定するので、100回目のループ実行が開始される。
したがって、シーケンス制御部11の演算器制御指示生成回路13から出力される「演算終了指示」は、100回目のループ実行が行われているときに、PC制御部23のフラグ生成回路24に入力される。
The
Therefore, the “computation end instruction” output from the arithmetic unit control
フラグ生成回路24は、演算器制御指示生成回路13から「演算終了指示」を受けると、演算終了フラグレジスタ26に“有効”(“1”)を設定する。
フラグ生成回路24は、100回目のループ実行において、現PCレジスタ29のレジスタ値が“99”になり(レジスタ値が“99”になると、読み出しアドレスが“0x0173”になって、命令C99が発行される)、現PCレジスタ29のレジスタ値が差分値(エンドアドレス−スタートアドレス)に到達すると、演算終了フラグレジスタ26が“有効”(“1”)であることを確認して、実行フラグレジスタ25に設定されている“有効”(“1”)を“無効”(“0”)に変更する。
The
In the 100th loop execution, the
PC生成回路27は、実行フラグレジスタ25に“有効”(“1”)が設定されているときに、レジスタ値の更新処理を開始し、実行フラグレジスタ25に“無効”(“0”)が設定されている場合には、レジスタ値の更新処理を行わないので、アドレス生成回路30から101回目のループ実行に係る読み出しアドレスが出力されることはない。
また、命令発行部31についても、実行フラグレジスタ25に“有効”(“1”)が設定されているときに演算命令を発行し、実行フラグレジスタ25に“無効”(“0”)が設定されている場合には、演算命令を発行しないので、101回目のループ実行に係る演算命令が発行されることはない。
これにより、PROC_C(命令C0〜C99)に係る100回のループ実行が終了する。
When the
The
Thus, 100 loop executions related to PROC_C (commands C0 to C99) are completed.
次に、PROC_D(命令D0〜D44)の演算開始命令(記述(3))がプログラムに記述されているので、シーケンス制御部11の演算器制御指示生成回路13は、書き込みイネーブルをレジスタ群22に出力することで、その演算開始命令のオペランド(スタートアドレス、エンドアドレス、ループ指示(ON/OFF))をレジスタ群22に設定する。
図3の例では、演算器制御指示生成回路13が書き込みイネーブルをレジスタ群22に出力することにより、スタートアドレス=0x0174をスタートアドレスレジスタ22bに設定し、エンドアドレス=0x01A0をエンドアドレスレジスタ22cに設定し、また、ループ指示(LOOP=OFF)をループ指示レジスタ22aに設定する。
Next, since the operation start instruction (description (3)) of PROC_D (instructions D0 to D44) is described in the program, the arithmetic unit control
In the example of FIG. 3, when the arithmetic unit control
ここで、スタートアドレス=0x0174は、演算用命令メモリ32に格納されている命令D0のアドレスを示し、エンドアドレス=0x01A0は、演算用命令メモリ32に格納されている命令D44のアドレスを示している。また、ループ指示(LOOP=OFF)は、ループ実行を行わない旨を示している。
したがって、この演算開始命令は、命令D0〜D44を1回ずつ実行することを意味している。
演算器制御指示生成回路13は、スタートアドレス等の設定を完了したのち、内部演算器14の指示の下、「演算開始指示」をPC制御部23のフラグ生成回路24に出力する。
Here, the start address = 0x0174 indicates the address of the instruction D0 stored in the
Therefore, this calculation start command means that the commands D0 to D44 are executed once.
After completing the setting of the start address and the like, the arithmetic unit control
フラグ生成回路24は、演算器制御指示生成回路13から「演算開始指示」が出力されると、実行フラグレジスタ25に“有効”(“1”)を設定する。
また、フラグ生成回路24は、スタートアドレスレジスタ22bからスタートアドレスを取得するとともに、エンドアドレスレジスタ22cからエンドアドレスを取得し、そのエンドアドレスからスタートアドレスを減算して、差分値(エンドアドレス−スタートアドレス)を算出する。
この例では、スタートアドレス=0x0174、エンドアドレス=0x01A0であるため、差分値(エンドアドレス−スタートアドレス)は“44”となる。
なお、この差分値は、フラグ生成回路24により、後で、現PCレジスタ29のレジスタ値と比較されるものであるため、内部のメモリ等に保持される。
The
Further, the
In this example, since the start address = 0x0174 and the end address = 0x01A0, the difference value (end address−start address) is “44”.
The difference value is stored in an internal memory or the like because it is compared later with the register value of the
PC生成回路27は、フラグ生成回路24が実行フラグレジスタ25に“有効”(“1”)を設定すると、下記に示すレジスタ値の更新処理を開始する。
即ち、PC生成回路27は、フラグ生成回路24が実行フラグレジスタ25に“有効”(“1”)を設定すると、フラグ生成回路24と同様に、スタートアドレスレジスタ22bからスタートアドレスを取得するとともに、エンドアドレスレジスタ22cからエンドアドレスを取得し、そのエンドアドレスからスタートアドレスを減算して、差分値(エンドアドレス−スタートアドレス)を算出する。ここでは、PC生成回路27が差分値を算出しているが、フラグ生成回路24により算出された差分値を取得するようにしてもよい。あるいは、PC生成回路27が算出した差分値をフラグ生成回路24に与えるようにしてもよい。
また、PC生成回路27は、実行フラグレジスタ25が“有効”(“1”)である場合、次PCレジスタ28のレジスタ値を現PCレジスタ29に設定する。
この時点では、次PCレジスタ28のレジスタ値は“0”であるため、現PCレジスタ29のレジスタ値を“0”に設定する。
When the
That is, when the
The
At this time, since the register value of the
PC生成回路27は、次PCレジスタ28のレジスタ値を現PCレジスタ29に設定すると、現PCレジスタ29のレジスタ値と差分値(エンドアドレス−スタートアドレス)を比較する。
この時点では、現PCレジスタ29のレジスタ値は“0”であり、差分値は“44”である。
PC生成回路27は、現PCレジスタ29のレジスタ値が差分値と一致しないので、次PCレジスタ28のレジスタ値を1だけインクリメントする。
この時点では、次PCレジスタ28のレジスタ値は“1”となる。
When the register value of the
At this time, the register value of the
The
At this time, the register value of the
アドレス生成回路30は、スタートアドレスレジスタ22bからスタートアドレスを取得するとともに、現PCレジスタ29のレジスタ値を取得し、そのスタートアドレスと現PCレジスタ29のレジスタ値とを加算する。
この時点では、現PCレジスタ29のレジスタ値は“0”であり、スタートアドレス=0x0174であるため、そのスタートアドレスとレジスタ値の加算値は、“0x0174”となる。
アドレス生成回路30は、その加算値“0x0174”を読み出しアドレスとして、命令発行部31に出力する。
The
At this time, since the register value of the
The
命令発行部31は、実行フラグレジスタ25が“有効”(“1”)である場合、演算用命令メモリ32に格納されている演算命令の中から、アドレス生成回路30から出力された読み出しアドレスに対応する演算命令の読み出しを行う。
この時点では、読み出しアドレスが“0x0174”であるため、演算用命令メモリ32から“0x0174”に対応する命令D0の読み出しを行う。
命令発行部31は、演算命令である命令D0の読み出しを行うと、その命令D0を演算器2に発行する。
演算器2は、命令発行部31から命令D0が発行されると、命令D0を実行して、命令D0の演算結果を制御回路1のシーケンス制御部11に出力する。
When the
At this time, since the read address is “0x0174”, the instruction D0 corresponding to “0x0174” is read from the
The
When the instruction D0 is issued from the
PC生成回路27は、アドレス生成回路30が読み出しアドレス“0x0174”を命令発行部31に出力すると、引き続き、実行フラグレジスタ25が“有効”(“1”)であることを確認し、次PCレジスタ28のレジスタ値を現PCレジスタ29に設定する。
この時点では、次PCレジスタ28のレジスタ値は“1”であるため、現PCレジスタ29のレジスタ値を“1”に設定する。
When the
At this time, since the register value of the
PC生成回路27は、次PCレジスタ28のレジスタ値を現PCレジスタ29に設定すると、現PCレジスタ29のレジスタ値と差分値(エンドアドレス−スタートアドレス)を比較する。
この時点では、現PCレジスタ29のレジスタ値は“1”であり、差分値は“44”である。
PC生成回路27は、現PCレジスタ29のレジスタ値が差分値と一致しないので、次PCレジスタ28のレジスタ値を1だけインクリメントする。
この時点では、次PCレジスタ28のレジスタ値は“2”となる。
When the register value of the
At this time, the register value of the
The
At this time, the register value of the
アドレス生成回路30は、スタートアドレスレジスタ22bからスタートアドレスを取得するとともに、現PCレジスタ29のレジスタ値を取得し、そのスタートアドレスと現PCレジスタ29のレジスタ値とを加算する。
この時点では、現PCレジスタ29のレジスタ値は“1”であり、スタートアドレス=0x0174であるため、そのスタートアドレスとレジスタ値の加算値は、“0x0175”となる。
アドレス生成回路30は、その加算値“0x0175”を読み出しアドレスとして、命令発行部31に出力する。
The
At this time, since the register value of the
The
命令発行部31は、実行フラグレジスタ25が“有効”(“1”)である場合、演算用命令メモリ32に格納されている演算命令の中から、アドレス生成回路30から出力された読み出しアドレスに対応する演算命令の読み出しを行う。
この時点では、読み出しアドレスが“0x0175”であるため、演算用命令メモリ32から“0x0175”に対応する命令D1の読み出しを行う。
命令発行部31は、演算命令である命令D1の読み出しを行うと、その命令D1を演算器2に発行する。
演算器2は、命令発行部31から命令D1が発行されると、命令D1を実行して、命令D1の演算結果を制御回路1のシーケンス制御部11に出力する。
When the
At this time, since the read address is “0x0175”, the instruction D1 corresponding to “0x0175” is read from the
The
When the instruction D1 is issued from the
以降、現PCレジスタ29のレジスタ値が“43”になるまで、PC生成回路27、アドレス生成回路30、命令発行部31及び演算器2が同様の処理を繰り返し実施する。
これにより、命令D2〜D43が演算器2により実行されて、命令D2〜D43の演算結果が制御回路1のシーケンス制御部11に出力される。
この時点では、次PCレジスタ28のレジスタ値は“44”であり、現PCレジスタ29のレジスタ値は“43”である。
また、読み出しアドレスは“0x019F”である。
Thereafter, until the register value of the
Thereby, the instructions D2 to D43 are executed by the
At this time, the register value of the
The read address is “0x019F”.
PC生成回路27は、アドレス生成回路30が読み出しアドレス“0x019F”を命令発行部31に出力すると、引き続き、実行フラグレジスタ25が“有効”(“1”)であることを確認し、次PCレジスタ28のレジスタ値を現PCレジスタ29に設定する。
この時点では、次PCレジスタ28のレジスタ値は“44”であるため、現PCレジスタ29のレジスタ値を“44”に設定する。
When the
At this time, since the register value of the
PC生成回路27は、次PCレジスタ28のレジスタ値を現PCレジスタ29に設定すると、現PCレジスタ29のレジスタ値と差分値(エンドアドレス−スタートアドレス)を比較する。
この時点では、現PCレジスタ29のレジスタ値は“44”であり、差分値は“44”である。
PC生成回路27は、現PCレジスタ29のレジスタ値が差分値と一致すると、次PCレジスタ28のレジスタ値を“0”にクリアするとともに、「1ループ終了通知」を演算器制御指示生成回路13に出力する。
When the register value of the
At this time, the register value of the
When the register value of the
フラグ生成回路24は、現PCレジスタ29のレジスタ値と内部のメモリ等に保持している差分値を比較し、現PCレジスタ29のレジスタ値が差分値と一致すると、ループ指示レジスタ22aに格納されているループ指示が「ON」であるのか、「OFF」であるのかを確認する。
この時点では、ループ指示レジスタ22aに格納されているループ指示は「OFF」である。
フラグ生成回路24は、ループ指示が「OFF」であることを確認すると、実行フラグレジスタ25に設定されている“有効”(“1”)を“無効”(“0”)に変更する。
The
At this time, the loop instruction stored in the
Upon confirming that the loop instruction is “OFF”, the
PC生成回路27は、実行フラグレジスタ25に“無効”(“0”)が設定されている場合には、レジスタ値の更新処理を行わず、命令発行部31は、実行フラグレジスタ25に“無効”(“0”)が設定されている場合には、演算命令を発行しないので、PROC_D(命令D0〜D45)の実行が終了する。
When “invalid” (“0”) is set in the
以上で明らかなように、この実施の形態1によれば、スタートアドレスレジスタ22bに設定されているスタートアドレスを読み出しアドレスに設定して、その読み出しアドレスを出力し、その後、その読み出しアドレスをインクリメントして、インクリメント後の読み出しアドレスを出力する処理を繰り返し実施するアドレス出力手段と、ループ指示レジスタ22aに設定されているループ指示が「LOOP=ON」である場合、アドレス出力手段から出力された読み出しアドレスがエンドアドレスレジスタ22cに設定されているエンドアドレスと一致すると、「1ループ終了通知」を出力するとともに、現時点までにシーケンス制御部11から「演算終了指示」が出力されていなければ、アドレス出力手段により設定された読み出しアドレスをスタートアドレスに戻して、アドレス出力処理の継続をアドレス出力手段に指示し、ループ指示が「LOOP=OFF」である場合、アドレス出力手段から出力された読み出しアドレスがエンドアドレスと一致すると、アドレス出力処理の停止をアドレス出力手段に指示する繰り返し処理制御手段とを設け、内部演算器14が、「1ループ終了通知」の出力回数とループ回数を比較して繰り返し演算を終了するか否かを判定し、繰り返し演算を終了する際に「演算終了指示」を繰り返し処理制御手段に出力するように構成したので、専用のループ制御回路を設けることなく(演算器制御部21が、ループ実行を伴う演算命令の発行制御と、ループ実行を伴わない演算命令の発行制御とを兼ねている)、僅かなプログラム量の増加だけで、ループ制御によるオーバーヘッドを削減することができる効果を奏する。
As apparent from the above, according to the first embodiment, the start address set in the
即ち、ループ制御の後処理部分に相当する「do−while命令」が、内部演算器14によって、演算器制御部21における演算命令の発行処理と並行して実行されるため、ループ実行(最終回のループ実行を除く)の後処理に係るサイクル数を隠蔽することができるようになり、ループ制御の後処理に係るオーバーヘッドを削減することができる。
ループ制御の後処理に係るオーバーヘッドを削減するために追加するプログラムは、内部演算器14が実行する「do−while命令」だけであるため、僅かなプログラム量の増加だけで、ループ制御によるオーバーヘッドを削減することができる。
このように、ループ制御によるオーバーヘッドの削減が可能であるため、処理の高速化を実現することができるとともに、低消費電力化を図ることができる。
That is, since the “do-while instruction” corresponding to the post-processing part of the loop control is executed by the internal
The only program added to reduce the overhead associated with the post-processing of the loop control is the “do-while instruction” executed by the
As described above, since the overhead can be reduced by the loop control, the processing speed can be increased and the power consumption can be reduced.
なお、この実施の形態1では、シーケンス制御用のプログラムがシーケンス制御用命令メモリ12に格納され、演算命令が演算用命令メモリ32に格納されているものを示したが、シーケンス制御用のプログラムや演算命令が外部からダウンロードされるようにしてもよい。
In the first embodiment, the sequence control program is stored in the sequence
実施の形態2.
上記実施の形態1では、シーケンス制御用のプログラム内の命令である演算開始命令が、オペランドとして、スタートアドレス、エンドアドレス及びループ指示(ON/OFF)を有し、その演算開始命令によってスタートアドレス、エンドアドレス及びループ指示(ON/OFF)が設定されるものについて示したが、オペランドを有しない演算開始命令と別のパラメータ設定命令によって、スタートアドレス、エンドアドレス及びループ指示(ON/OFF)が設定されるようにしてもよい。
In the first embodiment, the operation start instruction that is an instruction in the sequence control program has a start address, an end address, and a loop instruction (ON / OFF) as operands, and the start address, Although the end address and loop instruction (ON / OFF) are shown, the start address, end address and loop instruction (ON / OFF) are set by a parameter setting instruction different from the operation start instruction having no operand. You may be made to do.
図4はシーケンス制御用命令メモリ12により格納されているシーケンス制御用のプログラム内の命令を示す説明図である。
図4でも、図3と同様に、PROC_C(命令C0〜C99)を100回繰り返し実行し、PROC_D(命令D0〜D44)を1回実行する例を示している。
FIG. 4 is an explanatory diagram showing instructions in the sequence control program stored in the sequence
4 also shows an example in which PROC_C (instructions C0 to C99) is repeatedly executed 100 times and PROC_D (instructions D0 to D44) is executed once, similarly to FIG.
次に動作について説明する。
ただし、演算器制御指示生成回路13によるスタートアドレス等の設定処理以外は、上記実施の形態1と同様であるため、主に演算器制御指示生成回路13の設定処理について説明する。
Next, the operation will be described.
However, since the processing other than the setting processing of the start address and the like by the arithmetic unit control
制御回路1は、上記実施の形態1と同様に、処理開始前に初期化され、レジスタ群22のループ指示レジスタ22a、スタートアドレスレジスタ22b及びエンドアドレスレジスタ22cには“0”が設定される。
また、実行フラグレジスタ25及び演算終了フラグレジスタ26には、“無効”(“0”)が設定され、次PCレジスタ28及び現PCレジスタ29のカウント値には、“0”が設定される。
As in the first embodiment, the control circuit 1 is initialized before the start of processing, and “0” is set in the
Further, “invalid” (“0”) is set in the
シーケンス制御部11は、シーケンス制御用命令メモリ12により格納されているシーケンス制御用のプログラムを読み込み、そのプログラム内の命令を解析する。
図4の例では、最初に、PROC_C(命令C0〜C99)を100回繰り返すために、ループ回数を設定する設定命令(図4では、“ループカウンタを100に設定する”と記述されている)がプログラムに記述されているので、シーケンス制御部11の内部演算器14は、その設定命令にしたがってループ回数を汎用レジスタ15に設定する。
図4の例では、ループ回数として、“100”を汎用レジスタ15に設定する。
The
In the example of FIG. 4, in order to first repeat PROC_C (commands C0 to C99) 100 times, a setting command for setting the number of loops (in FIG. 4, “setting the loop counter to 100” is described). Is described in the program, the internal
In the example of FIG. 4, “100” is set in the general-
次に、オペランドがスタートアドレスであるパラメータ設定命令(記述(1−1))がプログラムに記述されているので、シーケンス制御部11の演算器制御指示生成回路13は、書き込みイネーブルをレジスタ群22に出力することで、そのパラメータ設定命令のオペランドであるスタートアドレス=0x0110をスタートアドレスレジスタ22bに設定する。
次に、オペランドがエンドアドレスであるパラメータ設定命令(記述(1−2))がプログラムに記述されているので、シーケンス制御部11の演算器制御指示生成回路13は、書き込みイネーブルをレジスタ群22に出力することで、そのパラメータ設定命令のオペランドであるエンドアドレス=0x0173をエンドアドレスレジスタ22cに設定する。
Next, since the parameter setting instruction (description (1-1)) whose operand is the start address is described in the program, the arithmetic unit control
Next, since the parameter setting instruction (description (1-2)) whose operand is the end address is described in the program, the arithmetic unit control
次に、オペランドがループ指示であるパラメータ設定命令(記述(1−3))がプログラムに記述されているので、シーケンス制御部11の演算器制御指示生成回路13は、書き込みイネーブルをレジスタ群22に出力することで、そのパラメータ設定命令のオペランドであるループ指示(LOOP=ON)をループ指示レジスタ22aに設定する。
次に、オペランドを有しない演算開始命令(記述(1−4))がプログラムに記述されているので、シーケンス制御部11の演算器制御指示生成回路13が、内部演算器14の指示の下、「演算開始指示」をPC制御部23のフラグ生成回路24に出力する。
以降、上記実施の形態1と同様にして、PROC_C(命令C0〜C99)が100回ループ実行される。
Next, since the parameter setting instruction (description (1-3)) whose operand is a loop instruction is described in the program, the arithmetic unit control
Next, since an operation start instruction (description (1-4)) having no operand is described in the program, the operation unit control
Thereafter, PROC_C (instructions C0 to C99) is looped 100 times in the same manner as in the first embodiment.
PROC_C(命令C0〜C99)のループ実行が完了すると、PROC_D(命令D0〜D44)を1回実行するために、オペランドがスタートアドレスであるパラメータ設定命令(記述(3−1))がプログラムに記述されているので、シーケンス制御部11の演算器制御指示生成回路13は、書き込みイネーブルをレジスタ群22に出力することで、そのパラメータ設定命令のオペランドであるスタートアドレス=0x0174をスタートアドレスレジスタ22bに設定する。
次に、オペランドがエンドアドレスであるパラメータ設定命令(記述(3−2))がプログラムに記述されているので、シーケンス制御部11の演算器制御指示生成回路13は、書き込みイネーブルをレジスタ群22に出力することで、そのパラメータ設定命令のオペランドであるエンドアドレス=0x01A0をエンドアドレスレジスタ22cに設定する。
When the loop execution of PROC_C (instructions C0 to C99) is completed, a parameter setting instruction (description (3-1)) whose operand is the start address is described in the program in order to execute PROC_D (instructions D0 to D44) once. Therefore, the arithmetic unit control
Next, since the parameter setting instruction (description (3-2)) whose operand is the end address is described in the program, the arithmetic unit control
次に、オペランドがループ指示であるパラメータ設定命令(記述(3−3))がプログラムに記述されているので、シーケンス制御部11の演算器制御指示生成回路13は、書き込みイネーブルをレジスタ群22に出力することで、そのパラメータ設定命令のオペランドであるループ指示(LOOP=OFF)をループ指示レジスタ22aに設定する。
次に、オペランドを有しない演算開始命令(記述(3−4))がプログラムに記述されているので、シーケンス制御部11の演算器制御指示生成回路13が、内部演算器14の指示の下、「演算開始指示」をPC制御部23のフラグ生成回路24に出力する。
以降、上記実施の形態1と同様にして、PROC_D(命令D0〜D44)が1回実行される。
Next, since the parameter setting instruction (description (3-3)) whose operand is a loop instruction is described in the program, the arithmetic unit control
Next, since the operation start instruction (description (3-4)) having no operand is described in the program, the arithmetic unit control
Thereafter, PROC_D (commands D0 to D44) is executed once as in the first embodiment.
以上で明らかなように、この実施の形態2によれば、演算開始命令と別命令であるパラメータ設定命令によって、スタートアドレス、エンドアドレス及びループ指示(ON/OFF)を設定するように構成したので、演算開始命令のオペランドを無くして、その演算開始命令が長くなり過ぎるのを抑制することができる効果を奏する。 As is apparent from the above, according to the second embodiment, the start address, the end address, and the loop instruction (ON / OFF) are set by the parameter setting instruction which is a separate instruction from the calculation start instruction. The operation start instruction operand is eliminated, and the operation start instruction can be prevented from becoming too long.
この実施の形態2では、パラメータ設定命令と演算開始命令の2つを使用するものについて示したが、パラメータ設定と演算開始を同時に指示する複合命令を設ければ、最後のパラメータ設定と同時に演算の開始を指示することができるため、演算開始指示までのサイクルを1サイクル分削減することができ、制御の高速化を図ることができる。 In the second embodiment, the parameter setting instruction and the calculation start instruction are used. However, if a compound instruction that simultaneously instructs parameter setting and calculation start is provided, the calculation is performed simultaneously with the last parameter setting. Since the start can be instructed, the cycle up to the calculation start instruction can be reduced by one cycle, and the control speed can be increased.
実施の形態3.
図5はこの発明の実施の形態3によるデータ演算装置を示す構成図であり、図において、図1と同一符号は同一又は相当部分を示すので説明を省略する。
したがって、図1のデータ演算装置と同様に、シーケンス制御部11は、シーケンス制御用命令メモリ12、演算器制御指示生成回路13、内部演算器14及び汎用レジスタ15から構成されている。
また、PC制御部23は、フラグ生成回路24、実行フラグレジスタ25、演算終了フラグレジスタ26、PC生成回路27、次PCレジスタ28、現PCレジスタ29及びアドレス生成回路30から構成されている。
また、命令発行部31は、演算用命令メモリ32を内蔵している。
Embodiment 3 FIG.
FIG. 5 is a block diagram showing a data operation apparatus according to Embodiment 3 of the present invention. In the figure, the same reference numerals as those in FIG.
Therefore, the
The
The
レジスタ格納部40は2個のレジスタ群41a,41bとセレクタ42,43を実装しているメモリなどの記録媒体である。
図5の例では、レジスタ格納部40が2個のレジスタ群41a,41bを実装しているものについて示しているが、これに限るものではなく、3個以上のレジスタ群を実装しているものであってもよい。
レジスタ群41a,41bは図1のレジスタ群22に相当し、ループ指示レジスタ22a、スタートアドレスレジスタ22b及びエンドアドレスレジスタ22cから構成されている。
The
In the example of FIG. 5, the
The
セレクタ42はシーケンス制御部11の演算器制御指示生成回路13がスタートアドレス、エンドアドレス及びループ指示を設定する際、演算器制御指示生成回路13から設定先のレジスタ群41a又はレジスタ群41bを示すレジスタ選択信号が出力されると、そのレジスタ選択信号が示すレジスタ群41a又はレジスタ群41bを選択する処理を実施する。
セレクタ43はPC制御部23がスタートアドレス、エンドアドレス及びループ指示を取得する際、演算器制御指示生成回路13から取得先のレジスタ群41a又はレジスタ群41bを示すレジスタ選択信号が出力されると、そのレジスタ選択信号が示すレジスタ群41a又はレジスタ群41bを選択する処理を実施する。
The
When the
上記実施の形態1では、演算器制御部21が1個のレジスタ群22を実装しているものについて示したが、演算器制御部21が2個のレジスタ群41a,41bを実装して、2個のレジスタ群41a,41bに対して、2個の演算開始命令に係るスタートアドレス、エンドアドレス及びループ指示を設定するようにしてもよい。
以下、具体的に処理内容を説明する。
In the first embodiment, the computing
The processing contents will be specifically described below.
図6はシーケンス制御用命令メモリ12により格納されているシーケンス制御用のプログラム内の命令を示す説明図である。
図6では、レジスタ群41aを使用して、PROC_C(命令C0〜C99)を100回繰り返し実行し、レジスタ群41bを使用して、PROC_D(命令D0〜D44)を1回実行し、レジスタ群41aのスタートアドレス等を書き換えてから、レジスタ群41aを使用して、PROC_A(命令A0〜A7)を1回実行する例を示している。
ただし、図6においては、PROC_C(命令C0〜C99)及びPROC_D(命令D0〜D44)に係るスタートアドレス等の設定に関する記述を省略している。
FIG. 6 is an explanatory diagram showing instructions in the sequence control program stored in the sequence
In FIG. 6, PROC_C (instructions C0 to C99) is repeatedly executed 100 times using the
However, in FIG. 6, description regarding setting of the start address and the like related to PROC_C (commands C0 to C99) and PROC_D (commands D0 to D44) is omitted.
まず、シーケンス制御部11の演算器制御指示生成回路13は、制御処理の開始前に、PROC_C(命令C0〜C99)に係るスタートアドレス等をレジスタ群41aに設定するため、内部演算器14の指示の下、書き込みイネーブルをレジスタ格納部40に出力するとともに、設定先がレジスタ群41aである旨を示すレジスタ選択信号(“0”)をセレクタ42に出力する。
セレクタ42は、演算器制御指示生成回路13から設定先がレジスタ群41aである旨を示すレジスタ選択信号(“0”)を受けると、レジスタ群41aを選択して、演算器制御指示生成回路13から出力されるスタートアドレスをレジスタ群41aのスタートアドレスレジスタ22bに設定する。
また、演算器制御指示生成回路13から出力されるエンドアドレスをレジスタ群41aのエンドアドレスレジスタ22cに設定し、演算器制御指示生成回路13から出力されるループ指示をレジスタ群41aのループ指示レジスタ22aに設定する。
この例では、スタートアドレス=0x0110がスタートアドレスレジスタ22bに設定され、エンドアドレス=0x0173がエンドアドレスレジスタ22cに設定され、ループ指示(LOOP=ON)がループ指示レジスタ22aに設定される。
First, the arithmetic unit control
When the
The end address output from the arithmetic unit control
In this example, the start address = 0x0110 is set in the
次に、シーケンス制御部11の演算器制御指示生成回路13は、制御処理の開始前に、PROC_D(命令D0〜D44)に係るスタートアドレス等をレジスタ群41bに設定するため、内部演算器14の指示の下、書き込みイネーブルをレジスタ格納部40に出力するとともに、設定先がレジスタ群41bである旨を示すレジスタ選択信号(“1”)をセレクタ42に出力する。
セレクタ42は、演算器制御指示生成回路13から設定先がレジスタ群41bである旨を示すレジスタ選択信号(“1”)を受けると、レジスタ群41bを選択して、演算器制御指示生成回路13から出力されるスタートアドレスをレジスタ群41bのスタートアドレスレジスタ22bに設定する。
また、演算器制御指示生成回路13から出力されるエンドアドレスをレジスタ群41bのエンドアドレスレジスタ22cに設定し、演算器制御指示生成回路13から出力されるループ指示をレジスタ群41bのループ指示レジスタ22aに設定する。
この例では、スタートアドレス=0x0174がスタートアドレスレジスタ22bに設定され、エンドアドレス=0x01A0がエンドアドレスレジスタ22cに設定され、ループ指示(LOOP=OFF)がループ指示レジスタ22aに設定される。
Next, the arithmetic unit control
When the
The end address output from the arithmetic unit control
In this example, the start address = 0x0174 is set in the
上記のようにして、PROC_C(命令C0〜C99)及びPROC_D(命令D0〜D44)に係るスタートアドレス等を設定すると、PROC_C(命令C0〜C99)及びPROC_D(命令D0〜D44)の実行を開始する。
まず、PROC_C(命令C0〜C99)を100回繰り返すために、ループ回数を設定する設定命令(図6では、“ループカウンタを100に設定する”と記述されている)がプログラムに記述されているので、シーケンス制御部11の内部演算器14は、その設定命令にしたがってループ回数を汎用レジスタ15に設定する。
図6の例では、ループ回数として、“100”を汎用レジスタ15に設定する。
As described above, when the start address and the like related to PROC_C (commands C0 to C99) and PROC_D (commands D0 to D44) are set, execution of PROC_C (commands C0 to C99) and PROC_D (commands D0 to D44) is started. .
First, in order to repeat PROC_C (instructions C0 to C99) 100 times, a setting instruction for setting the number of loops (described as “setting the loop counter to 100” in FIG. 6) is described in the program. Therefore, the internal
In the example of FIG. 6, “100” is set in the general-
次に、PROC_C(命令C0〜C99)の演算開始命令(記述(1))がプログラムに記述されており、その演算開始命令のオペランドが、取得先のレジスタ群がレジスタ群41aである旨を示しているので(レジスタ選択=0)、シーケンス制御部11の演算器制御指示生成回路13が、内部演算器14の指示の下、レジスタ群41aの選択を指示するレジスタ選択信号(“0”)をセレクタ43に出力する。
セレクタ43は、演算器制御指示生成回路13からレジスタ群41aの選択を指示するレジスタ選択信号(“0”)を受けると、レジスタ群41aを選択して、レジスタ群41aのスタートアドレスレジスタ22bに設定されているスタートアドレス=0x0110をPC制御部23に出力し、レジスタ群41aのエンドアドレスレジスタ22cに設定されているエンドアドレス=0x0173をPC制御部23に出力する。
また、レジスタ群41aのループ指示レジスタ22aに設定されているループ指示(LOOP=ON)をPC制御部23に出力する。
演算器制御指示生成回路13は、内部演算器14の指示の下、「演算開始指示」をPC制御部23に出力する。
Next, the operation start instruction (description (1)) of PROC_C (instructions C0 to C99) is described in the program, and the operand of the operation start instruction indicates that the acquisition destination register group is the
When the
Further, the loop instruction (LOOP = ON) set in the loop instruction register 22 a of the
The arithmetic unit control
PC制御部23は、演算器制御指示生成回路13から「演算開始指示」を受けると、上記実施の形態1と同様にして、PROC_C(命令C0〜C99)に係る読み出しアドレス“0x0110”〜“0x0173”を命令発行部31に順次出力する処理を100回繰り返し実行する。
命令発行部31は、上記実施の形態1と同様に、PC制御部23から出力された読み出しアドレス“0x0110”〜“0x0173”に対応する命令C0〜C99を演算器2に100回繰り返し発行する。
なお、PROC_C(命令C0〜C99)のループ実行は、上記実施の形態1と同様にして、PC制御部23がシーケンス制御部11から「演算終了指示」を受けることで終了する。
When receiving the “calculation start instruction” from the arithmetic unit control
The
The loop execution of PROC_C (instructions C0 to C99) is terminated when the
PROC_C(命令C0〜C99)のループ実行が終了すると、PROC_D(命令D0〜D44)の演算開始命令(記述(3))がプログラムに記述されており、その演算開始命令のオペランドが、取得先のレジスタ群がレジスタ群41bである旨を示しているので(レジスタ選択=1)、シーケンス制御部11の演算器制御指示生成回路13が、内部演算器14の指示の下、レジスタ群41bの選択を指示するレジスタ選択信号(“1”)をセレクタ43に出力する。
セレクタ43は、演算器制御指示生成回路13からレジスタ群41bの選択を指示するレジスタ選択信号(“1”)を受けると、レジスタ群41bを選択して、レジスタ群41bのスタートアドレスレジスタ22bに設定されているスタートアドレス=0x0174をPC制御部23に出力し、レジスタ群41bのエンドアドレスレジスタ22cに設定されているエンドアドレス=0x01A0をPC制御部23に出力する。
また、レジスタ群41bのループ指示レジスタ22aに設定されているループ指示(LOOP=OFF)をPC制御部23に出力する。
演算器制御指示生成回路13は、内部演算器14の指示の下、「演算開始指示」をPC制御部23に出力する。
When the loop execution of PROC_C (instructions C0 to C99) is completed, the operation start instruction (description (3)) of PROC_D (instructions D0 to D44) is described in the program, and the operand of the operation start instruction is the acquisition destination. Since the register group indicates that it is the register group 41b (register selection = 1), the arithmetic unit control
When the
Further, the loop instruction (LOOP = OFF) set in the loop instruction register 22 a of the register group 41 b is output to the
The arithmetic unit control
PC制御部23は、演算器制御指示生成回路13から「演算開始指示」を受けると、上記実施の形態1と同様にして、PROC_D(命令D0〜D44)に係る読み出しアドレス“0x0174”〜“0x01A0”を命令発行部31に順次出力する処理を1回実行する。
命令発行部31は、上記実施の形態1と同様に、PC制御部23から出力された読み出しアドレス“0x0174”〜“0x01A0”に対応する命令D0〜D44を演算器2に1回発行する。
なお、PROC_D(命令D0〜D44)の実行は、上記実施の形態1と同様に、命令発行部31から命令D0〜D44が発行されることで終了する。
When receiving the “calculation start instruction” from the arithmetic unit control
The
Execution of PROC_D (instructions D0 to D44) is terminated when instructions D0 to D44 are issued from the
次に、シーケンス制御用のプログラムには、PROC_D(命令D0〜D44)の実行中に、レジスタ群41aのスタートアドレス等を書き換えるパラメータ設定命令が記述されている。
即ち、設定先のレジスタ群がレジスタ群41a(レジスタ選択=0)である旨を示すオペランドと、スタートアドレスが“0x0000”である旨を示すオペランドとを有するパラメータ設定命令(記述(4−1))がプログラムに記述されているので、演算器制御部21におけるPROC_D(命令D0〜D44)の発行処理と並行して、シーケンス制御部11の演算器制御指示生成回路13は、内部演算器14の指示の下、書き込みイネーブルをレジスタ格納部40に出力するとともに、設定先がレジスタ群41aである旨を示すレジスタ選択信号(“0”)と、スタートアドレス=“0x0000”とをセレクタ42に出力する。
セレクタ42は、演算器制御指示生成回路13から設定先がレジスタ群41aである旨を示すレジスタ選択信号(“0”)を受けると、レジスタ群41aを選択して、演算器制御指示生成回路13から出力されたスタートアドレス=“0x0000”をレジスタ群41aのスタートアドレスレジスタ22bに設定する。
Next, in the sequence control program, a parameter setting instruction for rewriting the start address and the like of the
That is, a parameter setting instruction (description (4-1)) having an operand indicating that the register group to be set is the
When the
次に、設定先のレジスタ群がレジスタ群41a(レジスタ選択=0)である旨を示すオペランドと、エンドアドレスが“0x0007”である旨を示すオペランドとを有するパラメータ設定命令(記述(4−2))がプログラムに記述されているので、演算器制御部21におけるPROC_D(命令D0〜D44)の発行処理と並行して、シーケンス制御部11の演算器制御指示生成回路13は、内部演算器14の指示の下、書き込みイネーブルをレジスタ格納部40に出力するとともに、設定先がレジスタ群41aである旨を示すレジスタ選択信号(“0”)と、エンドアドレス=“0x0007”とをセレクタ42に出力する。
セレクタ42は、演算器制御指示生成回路13から設定先がレジスタ群41aである旨を示すレジスタ選択信号(“0”)を受けると、レジスタ群41aを選択して、演算器制御指示生成回路13から出力されたエンドアドレス=“0x0007”をレジスタ群41aのエンドアドレスレジスタ22cに設定する。
Next, a parameter setting instruction (description (4-2) having an operand indicating that the register group to be set is the
When the
次に、設定先のレジスタ群がレジスタ群41a(レジスタ選択=0)である旨を示すオペランドと、ループ指示が“OFF”である旨を示すオペランドとを有するパラメータ設定命令(記述(4−3))がプログラムに記述されているので、演算器制御部21におけるPROC_D(命令D0〜D44)の発行処理と並行して、シーケンス制御部11の演算器制御指示生成回路13は、内部演算器14の指示の下、書き込みイネーブルをレジスタ格納部40に出力するとともに、設定先がレジスタ群41aである旨を示すレジスタ選択信号(“0”)と、ループ指示(LOOP=OFF)とをセレクタ42に出力する。
セレクタ42は、演算器制御指示生成回路13から設定先がレジスタ群41aである旨を示すレジスタ選択信号(“0”)を受けると、レジスタ群41aを選択して、演算器制御指示生成回路13から出力されたループ指示(LOOP=OFF)をレジスタ群41aのループ指示レジスタ22aに設定する。
Next, a parameter setting instruction (description (4-3) having an operand indicating that the register group to be set is the
When the
シーケンス制御部11は、PROC_A(命令A0〜A7)に係るスタートアドレス等の設定が完了すると、PROC_D(命令D0〜D44)の実行が完了するまで待機する。あるいは、別の単一演算の実行等を行う。
シーケンス制御部11の演算器制御指示生成回路13は、PROC_A(命令A0〜A7)の演算開始命令(記述(5))がプログラムに記述されており、その演算開始命令のオペランドが、取得先のレジスタ群がレジスタ群41aである旨を示しているので(レジスタ選択=0)、PC制御部23のPC生成回路27から「1ループ終了通知」が出力されると、内部演算器14の指示の下、レジスタ群41aの選択を指示するレジスタ選択信号(“0”)をセレクタ43に出力する。
When the setting of the start address and the like related to PROC_A (commands A0 to A7) is completed, the
The arithmetic unit control
セレクタ43は、演算器制御指示生成回路13からレジスタ群41aの選択を指示するレジスタ選択信号(“0”)を受けると、レジスタ群41aを選択して、レジスタ群41aのスタートアドレスレジスタ22bに設定されているスタートアドレス=0x0000をPC制御部23に出力し、レジスタ群41aのエンドアドレスレジスタ22cに設定されているエンドアドレス=0x0007をPC制御部23に出力する。
また、レジスタ群41aのループ指示レジスタ22aに設定されているループ指示(LOOP=OFF)をPC制御部23に出力する。
演算器制御指示生成回路13は、内部演算器14の指示の下、「演算開始指示」をPC制御部23に出力する。
When the
Further, the loop instruction (LOOP = OFF) set in the loop instruction register 22 a of the
The arithmetic unit control
PC制御部23は、演算器制御指示生成回路13から「演算開始指示」を受けると、PROC_D(命令D0〜D44)に係る読み出しアドレスを出力する場合と同様にして、PROC_A(命令A0〜A7)に係る読み出しアドレス“0x0000”〜“0x0007”を命令発行部31に順次出力する処理を1回実行する。
命令発行部31は、PC制御部23から出力された読み出しアドレス“0x0000”〜“0x0007”に対応する命令A0〜A7を演算器2に1回発行する。
なお、PROC_A(命令A0〜A7)の実行は、命令発行部31から命令A0〜A7が発行されることで終了する。
When receiving the “calculation start instruction” from the arithmetic unit control
The
The execution of PROC_A (instructions A0 to A7) ends when instructions A0 to A7 are issued from the
以上で明らかなように、この実施の形態3によれば、演算器制御部21が2個のレジスタ群41a,41bを実装して、2個のレジスタ群41a,41bに対して、2個の演算開始命令に係るスタートアドレス、エンドアドレス及びループ指示を設定するように構成したので、予め制御処理の開始前に、2個の演算開始命令に係るスタートアドレス、エンドアドレス及びループ指示をレジスタ群41a,41bに設定していれば、2個目の演算開始命令を実行する前に、2個目の演算開始命令に係るスタートアドレス等を設定する処理が不要になり、更なる演算処理の高速化を図ることができる効果を奏する。この効果は、レジスタ群の実装数が多いほど大きくなる。
As apparent from the above, according to the third embodiment, the arithmetic
なお、この実施の形態3では、シーケンス制御部11が演算開始命令に係るスタートアドレス等を2個のレジスタ群41a,41bに設定するものについて示したが、制御処理の開始前に、外部から演算開始命令に係るスタートアドレス等を2個のレジスタ群41a,41bにダウンロードするようにしてもよい。
In the third embodiment, the
1 制御回路、2 演算器、11 シーケンス制御部、12 シーケンス制御用命令メモリ、13 演算器制御指示生成回路(初期設定手段)、14 内部演算器(演算終了判定手段)、15 汎用レジスタ、21 演算器制御部、22 レジスタ群、22a ループ指示レジスタ、22b スタートアドレスレジスタ、22c エンドアドレスレジスタ、23 PC制御部、24 フラグ生成回路(繰り返し処理制御手段)、25 実行フラグレジスタ(繰り返し処理制御手段)、26 演算終了フラグレジスタ(繰り返し処理制御手段)、27 PC生成回路(アドレス出力手段、繰り返し処理制御手段)、28 次PCレジスタ(アドレス出力手段、繰り返し処理制御手段)、29 現PCレジスタ(アドレス出力手段、繰り返し処理制御手段)、30 アドレス生成回路(アドレス出力手段)、31 命令発行部(命令発行手段)、32 演算用命令メモリ、40 レジスタ格納部、41a,41b レジスタ群、42,43 セレクタ。 DESCRIPTION OF SYMBOLS 1 Control circuit, 2 arithmetic unit, 11 Sequence control part, 12 Sequence control command memory, 13 Operation unit control instruction generation circuit (initial setting means), 14 Internal arithmetic unit (calculation end determination means), 15 General-purpose register, 21 arithmetic Control unit, 22 register group, 22a loop instruction register, 22b start address register, 22c end address register, 23 PC control unit, 24 flag generation circuit (repetition process control means), 25 execution flag register (repetition process control means), 26 calculation end flag register (repetition processing control means), 27 PC generation circuit (address output means, repetition processing control means), 28th PC register (address output means, repetition processing control means), 29 current PC register (address output means) , Repetitive processing control means), 0 address generation circuit (address output means), 31 instruction issue unit (instruction issuing means) 32 arithmetic instruction memory, 40 a register storing portion, 41a, 41b registers, 42 and 43 selector.
Claims (6)
初期設定手段は、複数の演算開始命令に係るスタートアドレス、エンドアドレス及び一連の演算命令の繰り返しの有無をそれぞれ上記メモリに設定し、
アドレス出力手段は、選択信号が指し示すメモリからスタートアドレスを読み出し、
繰り返し処理制御手段は、上記選択信号が指し示すメモリからエンドアドレス及び一連の演算命令の繰り返しの有無を読み出すことを特徴とする請求項1から請求項4のうちのいずれか1項記載のデータ演算装置の制御回路。 In the control circuit of the data operation device, a plurality of memories for storing the start address, end address and presence / absence of repetition of a series of operation instructions are mounted .
The initial setting means sets the start address, end address, and presence / absence of a series of operation instructions related to a plurality of operation start instructions in the memory,
The address output means reads the start address from the memory indicated by the selection signal,
5. The data operation device according to claim 1, wherein the repetitive processing control unit reads an end address and presence / absence of repetition of a series of operation instructions from a memory indicated by the selection signal. Control circuit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009239281A JP5511299B2 (en) | 2009-10-16 | 2009-10-16 | Data arithmetic device control circuit and data arithmetic device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009239281A JP5511299B2 (en) | 2009-10-16 | 2009-10-16 | Data arithmetic device control circuit and data arithmetic device |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2011086157A JP2011086157A (en) | 2011-04-28 |
JP5511299B2 true JP5511299B2 (en) | 2014-06-04 |
Family
ID=44079048
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2009239281A Active JP5511299B2 (en) | 2009-10-16 | 2009-10-16 | Data arithmetic device control circuit and data arithmetic device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5511299B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9703559B2 (en) | 2011-11-09 | 2017-07-11 | Nec Corporation | Digital signal processor, program control method, and control program |
Family Cites Families (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS607536A (en) * | 1983-06-24 | 1985-01-16 | Mitsubishi Electric Corp | Information processor |
JPS63200234A (en) * | 1987-02-17 | 1988-08-18 | Toshiba Corp | Data processor |
JP2954671B2 (en) * | 1990-07-17 | 1999-09-27 | 富士通株式会社 | Controller for memory management |
JPH0728639A (en) * | 1993-07-13 | 1995-01-31 | Nec Corp | Microprocessor |
JPH07253922A (en) * | 1994-03-14 | 1995-10-03 | Texas Instr Japan Ltd | Address generation circuit |
JPH09237186A (en) * | 1996-03-04 | 1997-09-09 | Hitachi Ltd | Loop controller and processor |
GB2325535A (en) * | 1997-05-23 | 1998-11-25 | Aspex Microsystems Ltd | Data processor controller with accelerated instruction generation |
JP3842474B2 (en) * | 1999-02-02 | 2006-11-08 | 株式会社ルネサステクノロジ | Data processing device |
JP2000305778A (en) * | 1999-04-22 | 2000-11-02 | Matsushita Electric Ind Co Ltd | Instruction processing unit |
JP2002297378A (en) * | 2001-03-30 | 2002-10-11 | Sanyo Electric Co Ltd | Signal processor |
US7370136B2 (en) * | 2005-01-26 | 2008-05-06 | Stmicroelectronics, Inc. | Efficient and flexible sequencing of data processing units extending VLIW architecture |
-
2009
- 2009-10-16 JP JP2009239281A patent/JP5511299B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2011086157A (en) | 2011-04-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5512803B2 (en) | Data processing apparatus and method for handling vector instructions | |
CN107688854B (en) | An arithmetic unit, method and device capable of supporting arithmetic data of different bit widths | |
JP4526560B2 (en) | Processor and signal processing method | |
KR101660659B1 (en) | Executing subroutines in a multi-threaded processing system | |
US11816485B2 (en) | Nested loop control | |
JP2019511056A (en) | Complex multiplication instruction | |
JP2560988B2 (en) | Information processing apparatus and processing method | |
KR20180137521A (en) | Apparatus and method for address conflict management in performing vector operations | |
US11972236B1 (en) | Nested loop control | |
JP7048612B2 (en) | Vector generation instruction | |
JP5511299B2 (en) | Data arithmetic device control circuit and data arithmetic device | |
JP7510253B2 (en) | Branch Predictor | |
US8631173B2 (en) | Semiconductor device | |
JP2007334563A (en) | Vector processing device with mask | |
US11474946B2 (en) | Calculator and calculation method | |
US20020124159A1 (en) | Data processing apparatus | |
CN114115092A (en) | A kind of heterogeneous dual-core PLC cooperative execution method and device | |
CN119690453A (en) | Instruction scheduling method, apparatus, device, storage medium and program product | |
JP6107904B2 (en) | Processor and store instruction conversion method | |
JP4703735B2 (en) | Compiler, code generation method, code generation program | |
JP5013966B2 (en) | Arithmetic processing unit | |
JP2825315B2 (en) | Information processing device | |
WO2015136686A1 (en) | Method and apparatus for processing information | |
JP4502983B2 (en) | Vector control circuit, vector processing device, vector control method, and vector control program | |
JP2010140398A (en) | Apparatus and method for data process |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20120905 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20131128 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20131217 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20140207 |
|
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: 20140225 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20140325 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5511299 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |