JP7393519B2 - Arithmetic device and method - Google Patents

Arithmetic device and method Download PDF

Info

Publication number
JP7393519B2
JP7393519B2 JP2022505966A JP2022505966A JP7393519B2 JP 7393519 B2 JP7393519 B2 JP 7393519B2 JP 2022505966 A JP2022505966 A JP 2022505966A JP 2022505966 A JP2022505966 A JP 2022505966A JP 7393519 B2 JP7393519 B2 JP 7393519B2
Authority
JP
Japan
Prior art keywords
instruction
executing
functional unit
pipeline
functional units
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
Application number
JP2022505966A
Other languages
Japanese (ja)
Other versions
JPWO2021182222A1 (en
Inventor
成司 西村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Denso Corp
NSI Texe Inc
Original Assignee
Denso Corp
NSI Texe Inc
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 Denso Corp, NSI Texe Inc filed Critical Denso Corp
Publication of JPWO2021182222A1 publication Critical patent/JPWO2021182222A1/ja
Application granted granted Critical
Publication of JP7393519B2 publication Critical patent/JP7393519B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • G06F15/163Interprocessor communication
    • G06F15/173Interprocessor communication using an interconnection network, e.g. matrix, shuffle, pyramid, star, snowflake
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/16Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline, look ahead
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K19/00Logic circuits, i.e. having at least two inputs acting on one output; Inverting circuits
    • H03K19/02Logic circuits, i.e. having at least two inputs acting on one output; Inverting circuits using specified components
    • H03K19/173Logic circuits, i.e. having at least two inputs acting on one output; Inverting circuits using specified components using elementary logic circuits as components
    • H03K19/177Logic circuits, i.e. having at least two inputs acting on one output; Inverting circuits using specified components using elementary logic circuits as components arranged in matrix form

Description

関連出願への相互参照Cross-reference to related applications

本出願は、2020年3月11日に出願された特許出願番号2020-042169号に基づくものであって、その優先権の利益を主張するものであり、その特許出願のすべての内容が、参照により本明細書に組み入れられる。 This application is based on patent application No. 2020-042169 filed on March 11, 2020, and claims the benefit of priority thereto, and all contents of that patent application are referred to , incorporated herein by reference.

本開示は、演算装置及び演算方法に関する。 The present disclosure relates to an arithmetic device and an arithmetic method.

従来から、命令を処理する演算器である機能ユニットを複数備え、入力される一連の命令に対して複数の機能ユニットでパイプライン処理(以下「多段演算パイプライン」ともいう。)を行なう演算装置が用いられている。 Conventionally, an arithmetic device is equipped with a plurality of functional units that are arithmetic units that process instructions, and performs pipeline processing (hereinafter also referred to as "multi-stage arithmetic pipeline") with the plurality of functional units for a series of input instructions. is used.

例えば特許文献1には、乗算器MULと加算機ADD等の複数の機能ユニットによってパイプライン処理を行う構成が開示されている。特許文献1に記載の構成は、乗算器MULは同時に入力された値「a」「b」の対応する要素の組の各データを乗算して加算器ADDに順次出力し、加算器ADDは出力された乗算値と、前回の加算器ADDの出力とを順次加算している。 For example, Patent Document 1 discloses a configuration in which pipeline processing is performed by a plurality of functional units such as a multiplier MUL and an adder ADD. In the configuration described in Patent Document 1, the multiplier MUL multiplies each data of a set of elements corresponding to the values "a" and "b" input at the same time and sequentially outputs the multiplier to the adder ADD, and the adder ADD outputs the multiplier MUL. The multiplied value and the output of the previous adder ADD are sequentially added.

特開2012-69081号公報JP2012-69081A

ここで、多段演算パイプラインを用いたチェイニングによって命令(演算)を行う演算装置は、パイプラインの立ち上げや立ち下がりのオーバーヘッドを要し、加算や乗算等が組み合わさった複雑な演算を実行する際に、パイプラインの立ち上げ立ち下げを複数回行う場合があった。また、複雑な演算を実行する場合には、他の機能ユニットによる演算の終了を待ってから演算を行う機能ユニットが存在する場合があった。すなわち、パイプラインを用いたチェイニングでは効率的な演算を行えない場合があった。 Here, an arithmetic unit that performs instructions (operations) by chaining using a multi-stage arithmetic pipeline requires overhead for starting and falling of the pipeline, and performs complex operations that combine addition, multiplication, etc. When doing so, there were cases where the pipeline was started and stopped multiple times. Furthermore, when executing a complex calculation, there may be a functional unit that waits for the completion of calculations by other functional units before performing the calculation. That is, chaining using a pipeline may not be able to perform efficient calculations.

本開示は、パイプラインを用いたチェイニングによる演算をより効率的に行える、演算装置及び演算方法を提供することを目的とする。 An object of the present disclosure is to provide an arithmetic device and an arithmetic method that can more efficiently perform chaining operations using a pipeline.

本開示の一態様の演算装置は、同じ機能を有する複数の機能ユニットを含むパイプラインを具備し、チェイニングによって演算を行う演算装置であって、命令を実行中でない前記機能ユニットの有無を判定する判定部と、前記何れかの機能ユニットが命令を実行している際に、前記命令を実行中でない前記機能ユニットに対して、前記何れかの機能ユニットによる命令実行と並行して実行可能な前記命令を実行させる制御部と、を備える。 An arithmetic device according to an aspect of the present disclosure is an arithmetic device that includes a pipeline including a plurality of functional units having the same function and performs arithmetic operations by chaining, and determines whether or not there is a functional unit that is not executing an instruction. and a determination unit that is capable of being executed in parallel with the execution of an instruction by any of the functional units for the functional unit that is not executing the instruction when any of the functional units is executing the instruction. and a control unit that executes the instructions.

本発明によれば、パイプラインを用いたチェイニングによる演算をより効率的に行える。 According to the present invention, calculations by chaining using a pipeline can be performed more efficiently.

本開示についての上記目的およびその他の目的、特徴や利点は、添付の図面を参照しながら下記の詳細な記述により、より明確になる。その図面は、
図1は、実施形態の演算装置の概略構成図である。 図2は、実施形態のチェイニングを示す模式図である。 図3は、実施形態のチェイニングを示す模式図である。 図4は、実施形態のチェイニング演算処理の流れを示すフローチャートである。
The above objects and other objects, features and advantages of the present disclosure will become more apparent from the following detailed description with reference to the accompanying drawings. The drawing is
FIG. 1 is a schematic configuration diagram of an arithmetic device according to an embodiment. FIG. 2 is a schematic diagram showing chaining of the embodiment. FIG. 3 is a schematic diagram showing chaining of the embodiment. FIG. 4 is a flowchart showing the flow of chaining calculation processing according to the embodiment.

以下、図面を参照して本開示の実施形態を説明する。なお、以下に説明する実施形態は、本開示を実施する場合の一例を示すものであって、本開示を以下に説明する具体的構成に限定するものではない。本開示の実施にあたっては、実施形態に応じた具体的構成が適宜採用されてよい。 Embodiments of the present disclosure will be described below with reference to the drawings. Note that the embodiment described below shows an example of implementing the present disclosure, and the present disclosure is not limited to the specific configuration described below. In implementing the present disclosure, specific configurations depending on the embodiments may be adopted as appropriate.

図1は、本実施形態の演算装置10の概略構成図である。本実施形態の演算装置10は、複数の機能ユニット12を含むパイプラインを具備し、チェイニングによって演算を行うものである。 FIG. 1 is a schematic configuration diagram of an arithmetic device 10 of this embodiment. The arithmetic device 10 of this embodiment includes a pipeline including a plurality of functional units 12, and performs arithmetic operations by chaining.

機能ユニット12は、例えば、メモリからレジスタへデータをコピーするLD、レジスタからメモリにデータをコピーするST、加算機能を有するADD(加算器)、乗算機能を有するMUL(乗算器)、除算機能を有するDIV(除算器)等の演算器である。これら複数の機能ユニット12は、パイプライン処理を実行するマルチパイプベクトル演算器(以下「ベクトル演算器」という。)20に備えられる。 The functional unit 12 includes, for example, an LD that copies data from memory to a register, an ST that copies data from a register to memory, an ADD (adder) that has an addition function, an MUL (multiplier) that has a multiplication function, and a division function. It is an arithmetic unit such as a DIV (divider) that has a DIV (divider). These plurality of functional units 12 are included in a multi-pipe vector calculator (hereinafter referred to as "vector calculator") 20 that executes pipeline processing.

次に、本実施形態の演算装置10によるパイプライン処理について説明する。 Next, pipeline processing by the arithmetic device 10 of this embodiment will be explained.

まず、一例として、パイプラインの段数(以下「パイプライン段数」という。)を4段とし、機能ユニット12の数を5つ(LD、ST、ADD、MUL、DIV)で構成されるベクトル演算器20を想定する。以下の説明では、パイプライン段数を4段とするベクトル演算器20のハードウエア状態をディフォルトモードという。 First, as an example, the number of pipeline stages (hereinafter referred to as "pipeline stage number") is four stages, and the number of functional units 12 is five (LD, ST, ADD, MUL, DIV). Assume 20. In the following description, the hardware state of the vector arithmetic unit 20 with four pipeline stages will be referred to as a default mode.

このディフォルトモードは、パイプライン段数をより少なくしたモード1とモード2に再構成することが可能である。モード1は、パイプライン段数が2段であり、機能ユニット12の数が8つ(LD、ST、2つのADD、2つのMUL、2つのDIV)である。モード2は、パイプライン段数が1段であり、機能ユニット12の数が14個(LD、ST、4つのADD、4つのMUL、4つのDIV)である。このように、ディフォルトモードよりも段数を少なくしたモード1やモード2では、ADD、MUL、DIV等の同じ機能を有する機能ユニット12が複数存在する。 This default mode can be reconfigured into mode 1 and mode 2, which have fewer pipeline stages. In mode 1, the number of pipeline stages is two, and the number of functional units 12 is eight (LD, ST, two ADD, two MUL, and two DIV). In mode 2, the number of pipeline stages is one, and the number of functional units 12 is 14 (LD, ST, 4 ADDs, 4 MULs, and 4 DIVs). In this way, in mode 1 and mode 2, which have fewer stages than the default mode, there are a plurality of functional units 12 having the same functions, such as ADD, MUL, and DIV.

なお、本実施形態の演算装置10は、一例として、ハードウエアのモード(パイプライン段数と機能ユニット12の数の組み合わせ)の全バリエーションが予め定義されており、現在のハードウエアのモードはフラグ値として専用のレジスタ(モードレジスタ)に保持される。そして、ハードウエアのモードは専用の制御命令により設定される。 Note that in the arithmetic device 10 of this embodiment, all variations of hardware modes (combinations of the number of pipeline stages and the number of functional units 12) are defined in advance, as an example, and the current hardware mode is determined by a flag value. It is held in a dedicated register (mode register). The hardware mode is then set by a dedicated control command.

このように、本実施形態の演算装置10は、ディフォルトモードから、同じ機能を有する複数の機能ユニット12を含んでパイプラインを再構成可能とされている。そして、本実施形態の演算装置10は、機能ユニット12が命令を実行している場合に、命令を実行中でない他の機能ユニット12に対して並行して実行可能な命令を実行させる。このため、本実施形態の演算装置10は、ある機能ユニット12が命令を実行している場合に、他の機能ユニット12が命令を実行しているか否かを判定する機能(Out-of-Order機能)を有している。 In this way, the arithmetic device 10 of this embodiment can reconfigure the pipeline including a plurality of functional units 12 having the same function from the default mode. Then, when the functional unit 12 is executing an instruction, the arithmetic device 10 of this embodiment causes other functional units 12 that are not executing an instruction to execute an instruction that can be executed in parallel. Therefore, the arithmetic device 10 of this embodiment has a function (Out-of-Order) that determines whether or not another functional unit 12 is executing an instruction when a certain functional unit 12 is executing an instruction. function).

Out-of-Order機能を実現するために、本実施形態の機能ユニット12は、命令の実行中であるか否かを識別する識別子を保持するステートレジスタを有している。演算装置10は、このステートレジスタに基づいて、命令を実行中でない機能ユニット12を判定し、機能ユニット12毎に命令の割り当てを行う。本実施形態では、一例として、命令を実行中である機能ユニット12のステートレジスタは“1”であり、命令を実行中でない機能ユニット12のステートレジスタは“0”である。 In order to implement the Out-of-Order function, the functional unit 12 of this embodiment has a state register that holds an identifier that identifies whether an instruction is being executed. Based on this state register, the arithmetic unit 10 determines which functional units 12 are not executing an instruction, and allocates an instruction to each functional unit 12. In this embodiment, as an example, the state register of the functional unit 12 that is executing an instruction is "1", and the state register of the functional unit 12 that is not executing an instruction is "0".

なお、演算に寄与する機能ユニット12の総数(パイプライン段数と対応する機能ユニット12の数との積)が一定であるので、ステートレジスタは、機能ユニット12の総数を保持するために十分なbit数があればよい。上記例では、パイプライン段数が最大で4段であり、同じ機能を有する機能ユニット12が3種類(ADD、MUL、DIV)であるので、ステートレジスタは3×4=12bitでよい。なお、Out-of-Order機能を実行するためには、LD及びSTの機能ユニット12が実行中か否かを判定する必要があるのでLD及びSTも1bitずつのステートレジスタを有する。但し、LD及びSTのステートレジスタは、パイプライン段数には関係なく1bitずつであればよい。 Note that since the total number of functional units 12 contributing to an operation (the product of the number of pipeline stages and the number of corresponding functional units 12) is constant, the state register has enough bits to hold the total number of functional units 12. All you need is a number. In the above example, the maximum number of pipeline stages is four, and there are three types of functional units 12 (ADD, MUL, DIV) having the same function, so the state register may be 3×4=12 bits. Note that in order to execute the Out-of-Order function, it is necessary to determine whether or not the functional units 12 of the LD and ST are being executed, so the LD and ST also have state registers of 1 bit each. However, the state registers of LD and ST only need to have 1 bit each, regardless of the number of pipeline stages.

次に、一例として、図2を参照して、モード1で“((A+B)+C)×D”という演算をチェイニングする場合について説明する。モード1では、上述のように、ADD、MUL、DIVの機能ユニット12の数は各々2つである。なお、図2及び後述の図3における各値(A,B,C,D)に対応するベクトルレジスタ幅は固定されており、例えば64bitや32bitである。 Next, as an example, with reference to FIG. 2, a case will be described in which the operation "((A+B)+C)×D" is chained in mode 1. In mode 1, as described above, the number of functional units 12 for ADD, MUL, and DIV is two each. Note that the vector register width corresponding to each value (A, B, C, D) in FIG. 2 and FIG. 3 described later is fixed, and is, for example, 64 bits or 32 bits.

モード1では、まず“A+B”の演算結果をレジスタ(中間レジスタ)へ書き出す処理(ADD命令)が発行される。ADD命令の発行時点では、何れの機能ユニット12も未だ命令を実行中でないので、全ての機能ユニット12のステートレジスタは“0”である。ここでADD命令を発行することにより、1つ目のADDに対応する機能ユニット12のステートレジスタを“1”に設定する。 In mode 1, first, a process (ADD instruction) for writing the operation result of "A+B" to a register (intermediate register) is issued. At the time of issuance of the ADD instruction, none of the functional units 12 is executing the instruction yet, so the state registers of all the functional units 12 are "0". By issuing the ADD command here, the state register of the functional unit 12 corresponding to the first ADD is set to "1".

そして、次の命令サイクルでは、最初のADD命令の完了を待たず、最初のADD命令の結果に対して“C”を加算するADD命令が発行される。2つ目のADDのステートレジスタは“0”なので、命令を実行中でないADDがあると判断され、2つ目のADDのステートレジスタを“1”に設定し、最初のADD命令とのチェイニングが行われる。 Then, in the next instruction cycle, an ADD instruction that adds "C" to the result of the first ADD instruction is issued without waiting for the completion of the first ADD instruction. Since the state register of the second ADD is "0", it is determined that there is an ADD that is not executing an instruction, so the state register of the second ADD is set to "1" and chaining with the first ADD instruction is performed. will be held.

さらに、次の命令サイクルでは先行の2つのADD命令の終了を待たずに、“(A+B)+C”に対する“D”の乗算命令が発行される。このときMULのステートレジスタは“0”なので、1つ目のMULのステートレジスタを“1”に設定し、先行の2つのADD命令とのチェイニングが行われる。 Furthermore, in the next instruction cycle, a multiplication instruction of "D" for "(A+B)+C" is issued without waiting for the completion of the two preceding ADD instructions. At this time, the MUL state register is "0", so the first MUL state register is set to "1", and chaining with the previous two ADD instructions is performed.

次に、図3を参照して“(A+B)×(C+D)”という演算をモード1でチェイニングする場合について説明する。まず“(A+B)”と“(C+D)”との演算は各々独立して実行が可能である。このため“(A+B)”の演算を一つのADDが行うと共に、“(C+D)”の演算命令は、もう他のADDによって演算が行われる。すなわち、これらの2つのADD命令は互いの終了を待つことなく同時に発行される。従って、モード1の場合にはハードウエアのリソースとしてこれら2つのADD命令を同時に割り当て可能である。 Next, with reference to FIG. 3, a case will be described in which the calculation "(A+B)×(C+D)" is chained in mode 1. First, the operations "(A+B)" and "(C+D)" can be executed independently. Therefore, one ADD performs the operation of "(A+B)", and the operation instruction of "(C+D)" is performed by another ADD. That is, these two ADD commands are issued simultaneously without waiting for each other to complete. Therefore, in mode 1, these two ADD instructions can be allocated simultaneously as hardware resources.

図3の例では、MULの機能ユニット12が一つ空きとなる。ここで次の命令(後続命令)に上記のチェイニング演算とは依存関係のないMUL命令がある場合には、そのMUL命令を同時実行できる。結果として演算機能ユニットの稼働率をディフォルトモードよりも高くすることができ、従来と同じハードウエアリソース(演算器の数)でもより高い実効性能を発揮することが可能となる。 In the example of FIG. 3, one MUL functional unit 12 becomes vacant. Here, if the next instruction (subsequent instruction) includes a MUL instruction that has no dependency on the chaining operation described above, the MUL instructions can be executed simultaneously. As a result, the operating rate of the arithmetic function unit can be made higher than in the default mode, and higher effective performance can be achieved even with the same hardware resources (number of arithmetic units) as before.

また、本実施形態の機能ユニット12は、命令の実行状態を示すマスクレジスタ30(図2,3参照)を備える。そして、複数の他の機能ユニット12による演算結果を用いて次の命令を実行する機能ユニット12は、複数の他の機能ユニット12のマスクレジスタ30が命令の実行終了を示した後に次の命令を実行する。 Further, the functional unit 12 of this embodiment includes a mask register 30 (see FIGS. 2 and 3) that indicates the execution state of an instruction. Then, the functional unit 12 that executes the next instruction using the operation results of the plurality of other functional units 12 executes the next instruction after the mask register 30 of the plurality of other functional units 12 indicates the completion of instruction execution. Execute.

より具体的にはマスクレジスタ30は、ベクトルレジスタ長に対応して設けられており、演算の進行度合いに応じて“0”が“1”に書き換えられる。各機能ユニット12における演算が完了すると、マスクレジスタ30は全て“1”とされる。そして、先の命令を実行した複数の機能ユニット12のマスクレジスタ30のAND(論理積)によって、当該複数の機能ユニット12による演算が完了したか否かが判定される。すなわち、先の命令を実行する複数の機能ユニット12による演算が終了するまで、次の命令を実行する機能ユニット12は演算を行わない。 More specifically, the mask register 30 is provided corresponding to the vector register length, and "0" is rewritten to "1" according to the degree of progress of the calculation. When the calculations in each functional unit 12 are completed, all mask registers 30 are set to "1". Then, by AND (logical product) of the mask registers 30 of the plurality of functional units 12 that have executed the previous instruction, it is determined whether or not the calculation by the plurality of functional units 12 has been completed. That is, the functional unit 12 that executes the next instruction does not perform an operation until the multiple functional units 12 that execute the previous instruction complete their operations.

すなわち、図3の例では、“A+B”の演算が完了するとレジスタ領域が全て“1”となり、“C+D”の演算が完了するとレジスタ領域が全て“1”となる。そして、“A+B”の演算及び“C+D”の演算が完了した場合に、“(A+B)×(C+D)”の演算が開始される。 That is, in the example of FIG. 3, when the operation "A+B" is completed, all the register areas become "1", and when the operation "C+D" is completed, all the register areas become "1". Then, when the calculation of "A+B" and the calculation of "C+D" are completed, the calculation of "(A+B)×(C+D)" is started.

これにより、複数の機能ユニット12が先の命令を非同期で行っても、次の命令を実行する機能ユニット12は、複数の機能ユニット12による命令の実行完了を待って演算を行うことになるので、エラーを生じさせることなく次の命令の実行が可能となる。 As a result, even if multiple functional units 12 execute the previous instruction asynchronously, the functional unit 12 that executes the next instruction will wait for the execution of the instructions by the multiple functional units 12 to be completed before performing the calculation. , the next instruction can be executed without causing an error.

なお、先の命令を実行するパイプラインの段数よりも次の命令を実行するパイプラインの段数が多い場合、例えば先のパイプラインが2段であり、後のパイプラインが4段の場合にも、上述と同様にマスクレジスタ30によって先のパイプラインによる命令(演算)の進行度合いが判定される。このため、異なる段数のパイプラインの組み合わせによってチェイニングによる演算が行われる場合であっても、エラーを生じさせることなく命令の実行が可能となる。 Note that if the number of stages in the pipeline that executes the next instruction is greater than the number of stages in the pipeline that executes the previous instruction, for example, if the first pipeline has two stages and the second pipeline has four stages, , as described above, the degree of progress of the previous pipeline instruction (operation) is determined by the mask register 30. Therefore, even if a chaining operation is performed by a combination of pipelines with different numbers of stages, instructions can be executed without causing an error.

このように、本実施形態の演算装置10は、4段のパイプラインをそれよりも段数の小さいパイプライン(2段のパイプライン)に再構成することによって、パイプラインの立ち上げ、立ち下がりのオーバーヘッドを少なくできる。このとき、2段のパイプラインでは、同じ機能を有する機能ユニット12を複数(少なくとも2つ)備えることになる。 In this way, the arithmetic device 10 of the present embodiment can control the start-up and fall of the pipeline by reconfiguring the four-stage pipeline into a pipeline with a smaller number of stages (two-stage pipeline). Overhead can be reduced. At this time, the two-stage pipeline includes a plurality (at least two) of functional units 12 having the same function.

具体的には、上述の4段のパイプラインによって“((A+B)+C)×D”という演算を行う場合、“A+B=E”の演算をチェイニングで行った後に、“(E+C)×D”を新たなチェイニングで行う必要がある。このため、4段のパイプラインでは、パイプラインの立ち上げと立ち下がりとを2度行う必要があり、オーバーヘッドが2回分必要となる。また、“A+B=E”の演算結果を一旦メモリに記憶(ストア)させ、“(E+C)×D”の演算を行う場合に、演算結果である“E”をメモリから読み出す必要があり、処理が非効率であった。 Specifically, when performing the operation “((A+B)+C)×D” using the four-stage pipeline described above, after performing the operation “A+B=E” by chaining, “(E+C)×D” ” needs to be performed with new chaining. Therefore, in a four-stage pipeline, it is necessary to start and fall the pipeline twice, which requires overhead for two times. In addition, when the calculation result of "A + B = E" is temporarily stored in memory and the calculation of "(E + C) x D" is performed, it is necessary to read out the calculation result "E" from the memory and process it. was inefficient.

一方、2段のパイプラインでは、同じ機能を有する機能ユニット12(ADD、MUL、DIV)を2つずつ有することとなる。そして、ある機能ユニット12が命令を実行している際に、命令を実行中でない他の機能ユニット12の有無を判定し(Out-of-Order機能)、命令を実行中でない他の機能ユニット12に対して、ある機能ユニット12による命令実行と並行して実行可能な命令を実行させる。 On the other hand, a two-stage pipeline has two functional units 12 (ADD, MUL, DIV) each having the same function. When a certain functional unit 12 is executing an instruction, the presence or absence of another functional unit 12 that is not executing the instruction is determined (Out-of-Order function), and the other functional unit 12 that is not executing the instruction is determined. Executable instructions are executed in parallel with the instruction execution by a certain functional unit 12.

これにより、2段のパイプラインでは、“((A+B)+C)×D”の演算を一度のチェイニングによって行うことができ、パイプラインの立ち上げと立ち下がりと(オーバーヘッド)が1度で済む。また、2段のパイプラインでは、4段のパイプラインで行ったような演算結果を一旦メモリに記憶させるという処理は不要なため、より効率的な処理が可能となる。 As a result, in a two-stage pipeline, the operation "((A+B)+C)×D" can be performed by chaining once, and the pipeline startup and fall (overhead) can be done only once. . In addition, the two-stage pipeline does not require the process of temporarily storing the calculation results in memory, as is the case with the four-stage pipeline, so more efficient processing is possible.

このことから、本実施形態のようにパイプラインの段数を少なくし、同じ機能を有する複数の機能ユニット12を含むパイプラインとすることで、パイプラインの立ち上げと立ち下がりとに要するオーバーヘッドの時間を削減でき、演算の効率化が可能となる。 Therefore, by reducing the number of pipeline stages and creating a pipeline that includes a plurality of functional units 12 having the same function as in this embodiment, the overhead time required for starting and falling of the pipeline can be reduced. can be reduced, making it possible to improve the efficiency of calculations.

このようなパイプラインによるチェイニングを実行するために、図1に示されるように本実施形態の演算装置10は、実行判定部22と制御部24とを備える。 In order to execute such pipeline chaining, the arithmetic device 10 of this embodiment includes an execution determination section 22 and a control section 24, as shown in FIG.

実行判定部22は、Out-of-Order機能を実行する構成要素であり、命令を実行中でない機能ユニット12の有無を判定する。なお、実行判定部22は、ステートレジスタに基づいて、命令を実行中でない機能ユニット12を判定する。 The execution determination unit 22 is a component that executes an Out-of-Order function, and determines whether there is a functional unit 12 that is not executing an instruction. Note that the execution determination unit 22 determines which functional units 12 are not executing an instruction based on the state register.

制御部24は、命令を実行中でない機能ユニット12に対して実行可能な命令を実行させる。本実施形態の制御部24は、何れかの機能ユニット12が命令を実行している際に、命令を実行中でない機能ユニット12に対して、何れかの機能ユニット12による命令実行と並行して実行可能な命令を実行させる。 The control unit 24 causes the functional units 12 that are not currently executing instructions to execute executable instructions. The control unit 24 of this embodiment, when any of the functional units 12 is executing an instruction, instructs the functional units 12 that are not executing the instruction in parallel with the execution of the instruction by any of the functional units 12. Execute executable instructions.

なお、演算装置10は、パイプラインの段数に応じた、換言するとモードに応じた制御を行う。例えば、4段のパイプライン(ディフォルトモード)では、Out-of-Order機能を実行せずに、2段又は1段のパイプラン(モード1又はモード2)ではOut-of-Order機能を実行する。換言すると、Out-of-Order機能は、同じ機能を有する複数の機能ユニット12を備えるパイプラインに対して実行される。なお、モードは、ベクトル演算器20に実行させる一連の演算に応じて適宜選択される。 Note that the arithmetic device 10 performs control according to the number of pipeline stages, in other words, according to the mode. For example, a four-stage pipeline (default mode) does not perform the Out-of-Order function, and a two-stage or one-stage pipeline (Mode 1 or Mode 2) performs the Out-of-Order function. In other words, the Out-of-Order function is executed on a pipeline comprising multiple functional units 12 having the same function. Note that the mode is appropriately selected depending on the series of calculations to be performed by the vector calculator 20.

また、これに限らず、ディフォルトモードであってもOut-of-Order機能を実行するとしてもよい。すなわち、同じ機能を有する機能ユニット12だけでなく、異なる機能ユニット12(LD、ST、MUL、ADD、DIV)全てにおいて依存関係にない機能ユニット12は同時に実行可能としてもよい。 Further, the present invention is not limited to this, and the Out-of-Order function may be executed even in the default mode. That is, not only the functional units 12 having the same function but also the functional units 12 that are not dependent on each other in all the different functional units 12 (LD, ST, MUL, ADD, DIV) may be executable at the same time.

なお、本実施形態の演算装置10は、機能ユニット12による実行待ちの命令を命令待機バッファ14に記憶させる。そして、命令待機バッファ14に記憶された命令を実行可能な機能ユニット12が有った場合に、命令待機バッファ14から命令が順次読み出されて機能ユニット12によって実行される。これにより、命令を実行中でない機能ユニット12へ命令を効率的に割り当てることを可能とする。 Note that the arithmetic device 10 of this embodiment stores instructions waiting for execution by the functional unit 12 in the instruction standby buffer 14. If there is a functional unit 12 that can execute the instructions stored in the instruction standby buffer 14, the instructions are sequentially read from the instruction standby buffer 14 and executed by the functional unit 12. This makes it possible to efficiently allocate instructions to functional units 12 that are not currently executing instructions.

図4は、Out-of-Order機能を実行するチェイニング演算処理の流れを示すフローチャートである。このチェイニング演算処理は、演算装置10が備える記録媒体に格納されたプログラムによって実行される。このプログラムが実行されることで、プログラムに対応する方法が実行される。 FIG. 4 is a flowchart showing the flow of chaining calculation processing for executing the Out-of-Order function. This chaining calculation process is executed by a program stored in a recording medium included in the calculation device 10. When this program is executed, a method corresponding to the program is executed.

なお、図4に示されるチェイニング演算処理はOut-of-Order機能を実行するものであるため、このチェイニング演算処理の実行前にモードレジスタを確認することで、Out-of-Order機能を実行可能なモードであるか否かが判定される。Out-of-Order機能を実行可能なモードでない場合は、Out-of-Order機能を実行しない通常のチェイニング演算処理が実行される。または、Out-of-Order機能を実行可能なモードに再構成される。 Note that the chaining calculation process shown in Figure 4 executes the Out-of-Order function, so by checking the mode register before executing the chaining calculation process, the Out-of-Order function can be executed. It is determined whether the mode is executable. If the mode is not one in which the Out-of-Order function can be executed, normal chaining calculation processing that does not execute the Out-of-Order function is executed. or reconfiguring the Out-of-Order functionality into a viable mode.

まず、ステップS100では、実行判定部22が各機能ユニット12のステートレジスタを確認し、命令を実行中でない機能ユニット12の有無を判定する(Out-of-Order機能)。なお、ここでいう機能ユニット12の有無とは、与えられた命令を実行可能な機能ユニット12である。例えば与えられた命令がADD命令である場合には、このADD命令を実行可能な機能ユニット12の有無が実行判定部22によって判定される。 First, in step S100, the execution determination unit 22 checks the state register of each functional unit 12 and determines whether there is any functional unit 12 that is not executing an instruction (Out-of-Order function). Note that the presence or absence of the functional unit 12 here refers to the functional unit 12 that can execute a given command. For example, if the given instruction is an ADD instruction, the execution determination unit 22 determines whether there is a functional unit 12 that can execute this ADD instruction.

次のステップS102では、命令を実行中でない機能ユニット12が有る場合は、ステップS106へ移行する一方、命令を実行しないない機能ユニット12が無い場合は、ステップS104へ移行する。 In the next step S102, if there is a functional unit 12 that is not executing an instruction, the process moves to step S106, whereas if there is no functional unit 12 that is not executing an instruction, the process moves to step S104.

ステップS104では、命令を実行できる機能ユニット12が無いため、当該命令を実行待ちの命令として命令待機バッファ14へキューイングし、ステップS100へ戻る。 In step S104, since there is no functional unit 12 capable of executing the instruction, the instruction is queued in the instruction standby buffer 14 as an instruction waiting to be executed, and the process returns to step S100.

ステップS106では、制御部24が、命令を実行中でない機能ユニット12へ命令の割り当てを行う。 In step S106, the control unit 24 allocates the command to the functional unit 12 that is not currently executing the command.

次のステップS108では、制御部24が、命令が割り当てられた機能ユニット12のステートレジスタを“1”に設定する。 In the next step S108, the control unit 24 sets the state register of the functional unit 12 to which the instruction is assigned to "1".

次のステップS110では、機能ユニット12が割り当てられた命令を実行する。 In the next step S110, the functional unit 12 executes the assigned instruction.

次のステップS112では、制御部24が、割り当てられた命令の実行を機能ユニット12が完了したか否かを判定し、肯定判定の場合はステップS114へ移行し、否定判定の場合はステップS116へ移行する。なお、命令を実行している機能ユニット12が複数有る場合、ステップS112では各々の機能ユニット12毎に命令の実行が完了したか否かを判定する。 In the next step S112, the control unit 24 determines whether the functional unit 12 has completed the execution of the assigned command, and if the determination is affirmative, the process moves to step S114, and if the determination is negative, the process moves to step S116. Transition. Note that if there are a plurality of functional units 12 executing the command, it is determined in step S112 whether or not the command execution has been completed for each functional unit 12.

ステップS114では、制御部24が、命令を完了した機能ユニット12のステートレジスタを“0”に設定し、ステップS116へ移行する。 In step S114, the control unit 24 sets the state register of the functional unit 12 that has completed the instruction to "0", and proceeds to step S116.

ステップS116では、次の命令の有無を制御部24が判定し、次の命令がある場合にはステップS100へ戻り、次の命令に対応させて各ステップを実行する。 In step S116, the control unit 24 determines whether there is a next command, and if there is a next command, the process returns to step S100 and executes each step in response to the next command.

一方、ステップS116において次の命令がないと判定された場合には、入力された一連の演算命令の全てが完了したことになるので、本チェイニングを終了する。 On the other hand, if it is determined in step S116 that there is no next instruction, this means that all of the input series of arithmetic instructions have been completed, and the main chaining ends.

このように、本実施形態の演算装置10は、何れかの機能ユニット12が命令を実行している際に、命令を実行中でない機能ユニット12に対して、何れかの機能ユニット12による命令実行と並行して実行可能な命令を実行させる。これにより、本実施形態の演算装置10は、パイプラインを用いたチェイニングによる演算をより効率的に行える。 In this way, the arithmetic device 10 of the present embodiment is configured such that when any functional unit 12 is executing an instruction, any functional unit 12 executes an instruction with respect to a functional unit 12 that is not executing an instruction. Executes executable instructions in parallel. Thereby, the arithmetic device 10 of this embodiment can more efficiently perform chaining operations using a pipeline.

以上、本開示を、上記実施形態を用いて説明したが、本開示の技術的範囲は上記実施形態に記載の範囲には限定されない。開示の要旨を逸脱しない範囲で上記実施形態に多様な変更又は改良を加えることができ、該変更又は改良を加えた形態も本開示の技術的範囲に含まれる。 Although the present disclosure has been described above using the above embodiments, the technical scope of the present disclosure is not limited to the range described in the above embodiments. Various changes or improvements can be made to the embodiments described above without departing from the gist of the disclosure, and forms with such changes or improvements are also included within the technical scope of the present disclosure.

例えば、上記実施形態では、4段のパイプラインを2段のパイプラインや1段のパイプラインに再構成する形態について説明したが、本開示は、これに限定されるものではない。例えば、5段やそれ以上の段数のパイプラインをより少ない段数のパイプラインに再構成してもよい。また、パイプラインの再構成という概念を有さず、ベクトル演算器20は、例えば、2段で固定されたパイプラインで構成されてもよい。

For example, in the embodiment described above, a four-stage pipeline is reconfigured into a two-stage pipeline or a one-stage pipeline, but the present disclosure is not limited thereto. For example, a pipeline with five or more stages may be reconfigured into a pipeline with fewer stages. Further, without the concept of pipeline reconfiguration, the vector calculator 20 may be configured with a fixed two-stage pipeline, for example.

Claims (5)

複数の種類の機能ユニット(12)をそれぞれ複数個備えるパイプラインを具備し、チェイニングによって演算を行う演算装置(10)であって、
命令を実行中でない前記機能ユニットの有無を判定する判定部(22)と、
前記何れかの機能ユニットが命令を実行している際に、前記命令を実行中でない前記機能ユニットに対して、前記何れかの機能ユニットによる命令実行と並行して実行可能な前記命令を実行させることで、より段数の小さいパイプラインに再構成する制御部(24)と、
を備える、演算装置。
An arithmetic device (10) comprising a pipeline each comprising a plurality of functional units (12) of a plurality of types and performing arithmetic operations by chaining,
a determination unit (22) that determines the presence or absence of the functional unit that is not executing an instruction;
When any of the functional units is executing an instruction, causing the functional unit that is not executing the instruction to execute the instruction that can be executed in parallel with the execution of the instruction by any of the functional units. A control unit (24) that reconfigures the pipeline to have a smaller number of stages;
A calculation device comprising:
前記機能ユニットは、前記命令の実行状態を示すマスクレジスタ(30)を備え、
複数の他の前記機能ユニットによる演算結果を用いて次の前記命令を実行する前記機能ユニットは、複数の他の前記機能ユニットのマスクレジスタが前記命令の実行終了を示した後に次の前記命令を実行する、請求項1記載の演算装置。
The functional unit includes a mask register (30) that indicates the execution state of the instruction,
The functional unit that executes the next instruction using the operation results of the plurality of other functional units executes the next instruction after the mask registers of the plurality of other functional units indicate completion of execution of the instruction. The arithmetic device according to claim 1, which executes the arithmetic operation.
前記機能ユニットは、前記命令の実行中であるか否かを識別する識別子が設定され、
前記判定部は、前記識別子に基づいて、前記命令を実行中でない前記機能ユニットを判定する、
請求項1又は請求項2記載の演算装置。
The functional unit is set with an identifier that identifies whether or not the instruction is being executed;
The determination unit determines the functional unit that is not executing the instruction based on the identifier.
The arithmetic device according to claim 1 or claim 2.
前記機能ユニットによる実行待ちの前記命令は記憶媒体(14)へ記憶され、
前記記憶媒体に記憶された前記命令を実行可能な前記機能ユニットが有った場合に、前記記憶媒体から前記命令が順次読み出されて前記機能ユニットによって実行される、
請求項1から請求項3記載の演算装置。
the instructions awaiting execution by the functional unit are stored in a storage medium (14);
If there is a functional unit capable of executing the instructions stored in the storage medium, the instructions are sequentially read from the storage medium and executed by the functional unit;
An arithmetic device according to any one of claims 1 to 3.
複数の種類の機能を有する複数の機能ユニットをそれぞれ複数個備えるパイプラインを用いたチェイニングによる演算方法であって、
命令を実行中でない前記機能ユニットの有無を判定する第1工程と、
前記何れかの機能ユニットが命令を実行している際に、前記命令を実行中でない前記機能ユニットに対して、前記何れかの機能ユニットによる命令実行と並行して実行可能な前記命令を実行させることで、より段数の小さいパイプラインに再構成する第2工程と、
を有する、演算方法。
An arithmetic method using chaining using a pipeline each comprising a plurality of functional units each having a plurality of types of functions, the method comprising:
a first step of determining the presence or absence of the functional unit that is not executing an instruction;
When any of the functional units is executing an instruction, causing the functional unit that is not executing the instruction to execute the instruction that can be executed in parallel with the execution of the instruction by any of the functional units. The second step is to reconfigure the pipeline to have a smaller number of stages.
A calculation method having.
JP2022505966A 2020-03-11 2021-03-03 Arithmetic device and method Active JP7393519B2 (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2020042169 2020-03-11
JP2020042169 2020-03-11
PCT/JP2021/008131 WO2021182222A1 (en) 2020-03-11 2021-03-03 Computation device and computation method

Publications (2)

Publication Number Publication Date
JPWO2021182222A1 JPWO2021182222A1 (en) 2021-09-16
JP7393519B2 true JP7393519B2 (en) 2023-12-06

Family

ID=77671646

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2022505966A Active JP7393519B2 (en) 2020-03-11 2021-03-03 Arithmetic device and method

Country Status (2)

Country Link
JP (1) JP7393519B2 (en)
WO (1) WO2021182222A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006040254A (en) 2004-06-21 2006-02-09 Sanyo Electric Co Ltd Reconfigurable circuit and processor
JP2007166535A (en) 2005-12-16 2007-06-28 Matsushita Electric Ind Co Ltd Digital filter
JP2016103240A (en) 2014-11-28 2016-06-02 キヤノン株式会社 Data processor and data processing method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3614646B2 (en) * 1998-03-12 2005-01-26 富士通株式会社 Microprocessor, operation processing execution method, and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006040254A (en) 2004-06-21 2006-02-09 Sanyo Electric Co Ltd Reconfigurable circuit and processor
JP2007166535A (en) 2005-12-16 2007-06-28 Matsushita Electric Ind Co Ltd Digital filter
JP2016103240A (en) 2014-11-28 2016-06-02 キヤノン株式会社 Data processor and data processing method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
吉見 真聡 他,FPGAを用いた確率モデル生化学シミュレータ,情報処理学会論文誌,社団法人情報処理学会,2007年02月15日, 第48巻 No.SIG3(ACS17),第45頁-第58頁,ISSN:0387-5806

Also Published As

Publication number Publication date
WO2021182222A1 (en) 2021-09-16
JPWO2021182222A1 (en) 2021-09-16

Similar Documents

Publication Publication Date Title
JP3555140B2 (en) Semiconductor floorplan and method for register rename circuit
KR102413832B1 (en) vector multiply add instruction
JP3442225B2 (en) Arithmetic processing unit
US8296746B2 (en) Optimum code generation method and compiler device for multiprocessor
US9355061B2 (en) Data processing apparatus and method for performing scan operations
US8417918B2 (en) Reconfigurable processor with designated processing elements and reserved portion of register file for interrupt processing
JP2006338616A (en) Compiler device
JPH04172533A (en) Electronic computer
JP2002333978A (en) Vliw type processor
JP2010532063A (en) Method and system for extending conditional instructions to unconditional instructions and selection instructions
KR100663709B1 (en) Apparatus and method of exception handling for reconfigurable architecture
JPWO2012105593A1 (en) Data flow graph processing apparatus, data flow graph processing method, and data flow graph processing program
JP4776571B2 (en) Execution control program, execution control method, and execution control apparatus
JPH11272474A (en) Plural execution devices which can interrupt during processing of operation using allocation of plural registers
JP7393519B2 (en) Arithmetic device and method
KR101756820B1 (en) Reconfigurable processor and method for processing nested loop
US10459725B2 (en) Execution of load instructions in a processor
JP2004038751A (en) Processor and instruction control method
EP3690639B1 (en) Information processing apparatus, program, and information processing method
JP7383390B2 (en) Information processing unit, information processing device, information processing method and program
JP5786719B2 (en) Vector processor
GB2523805A (en) Data processing apparatus and method for performing vector scan operation
TW200302982A (en) Context execution in a pipelined computer processor
JP6307975B2 (en) Arithmetic processing device and control method of arithmetic processing device
JP3743155B2 (en) Pipeline controlled computer

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20220722

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20230404

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230519

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20230905

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20231017

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: 20231031

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20231124

R150 Certificate of patent or registration of utility model

Ref document number: 7393519

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313115

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350