Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP7383390B2 - Information processing unit, information processing device, information processing method and program - Google Patents
[go: Go Back, main page]

JP7383390B2 - Information processing unit, information processing device, information processing method and program - Google Patents

Information processing unit, information processing device, information processing method and program Download PDF

Info

Publication number
JP7383390B2
JP7383390B2 JP2019076481A JP2019076481A JP7383390B2 JP 7383390 B2 JP7383390 B2 JP 7383390B2 JP 2019076481 A JP2019076481 A JP 2019076481A JP 2019076481 A JP2019076481 A JP 2019076481A JP 7383390 B2 JP7383390 B2 JP 7383390B2
Authority
JP
Japan
Prior art keywords
instruction
data
read
storage means
reading
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
JP2019076481A
Other languages
Japanese (ja)
Other versions
JP2020173717A (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.)
Canon Inc
Original Assignee
Canon 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 Canon Inc filed Critical Canon Inc
Priority to JP2019076481A priority Critical patent/JP7383390B2/en
Publication of JP2020173717A publication Critical patent/JP2020173717A/en
Application granted granted Critical
Publication of JP7383390B2 publication Critical patent/JP7383390B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Advance Control (AREA)
  • Executing Machine-Instructions (AREA)

Description

本発明は、演算式をプログラムとして読み込んで実行するプログラマブルな情報処理ユニットを備える情報処理装置に関する。 The present invention relates to an information processing apparatus including a programmable information processing unit that reads and executes an arithmetic expression as a program.

コンピュータプログラムでの算術演算は、CPU内部の汎用レジスタを参照して演算した結果を汎用レジスタに代入するという基本命令を組み合わせて実行される。このとき、CPUでの処理をパイプライン化して、見掛け上、1命令を1サイクルで、又は、1サイクルで複数の命令を実行することが可能な構成とした場合でも、汎用レジスタに代入したデータが再び参照可能になるためにはレイテンシーが存在する。そのため、代入から参照までの待ち合わせ(以下「データハザード」という)が発生してしまう。特にレイテンシーの大きな浮動小数点演算では、データハザードによる演算器の稼働率の低下は処理性能を著しく低下させてしまう。 Arithmetic operations in computer programs are executed by combining basic instructions that refer to general-purpose registers inside the CPU and assign the result of the operation to the general-purpose registers. At this time, even if the processing in the CPU is pipelined so that one instruction can be executed in one cycle or multiple instructions can be executed in one cycle, the data assigned to the general-purpose register There is some latency before it can be referenced again. Therefore, a wait between assignment and reference (hereinafter referred to as "data hazard") occurs. Particularly in floating-point operations with high latency, a decrease in the operating rate of the computing unit due to data hazards significantly reduces processing performance.

この問題に対して、例えば特許文献1には、命令列の依存関係を検出し、依存関係が保持可能な状態になるまで回路の一部を停止させる技術が開示されている。また、特許文献2には、データ・コヒーレンシを侵害する可能性のあるアウト・オブ・オーダー命令を検出して、リオーダーする手段が開示されている。 To address this problem, Patent Document 1, for example, discloses a technique for detecting dependencies in a sequence of instructions and stopping part of a circuit until the dependencies can be maintained. Further, Patent Document 2 discloses means for detecting an out-of-order instruction that may violate data coherency and reordering the instruction.

特開2000-99328号公報Japanese Patent Application Publication No. 2000-99328 特開平11-272466号公報Japanese Patent Application Publication No. 11-272466

しかしながら、上記従来技術のアウト・オブ・オーダー、スーパー・スカラー、レジスタ・リネーミング等はどれも、大規模で複雑な回路となってしまうだけでなく、速度低下の原因となる汎用レジスタ間の参照と代入の間で発生するデータハザードの発生を完全に解決する事が本質的に困難である。 However, all of the above conventional techniques such as out-of-order, super scalar, and register renaming not only result in large and complicated circuits, but also require references between general-purpose registers, which causes speed reduction. It is essentially difficult to completely resolve the occurrence of data hazards that occur between and assignments.

本発明は、演算器との間でデータのやりとりを行う情報処理ユニットに大規模な回路を用いることなく、演算器の稼働率を向上させる技術を提供することを目的とする。 An object of the present invention is to provide a technique for improving the operating rate of a computing unit without using a large-scale circuit in an information processing unit that exchanges data with the computing unit.

本発明に係る情報処理ユニットは、命令列とデータが記憶された記憶手段から、順次、命令を読み込む命令読込部と、前記命令読込部が読み込んだ命令のアドレスフィールドに従って前記記憶手段からデータを読み込むデータ読込部と、前記命令読込部が読み込んだ命令の種別に従って前記データ読込部が読み込んだデータを演算手段へ転送するデータ転送部と、前記演算手段から出力される演算結果を前記記憶手段に書き込む書込部と、を備え、前記命令読込部が読み込む命令には演算結果を格納するアドレスを示すフィールドが存在せず、前記書込部は、前記演算手段から出力された、前記命令に対応する演算結果を、順次、前記記憶手段の連続したアドレスに書き込むことを特徴とする。 The information processing unit according to the present invention includes an instruction reading section that sequentially reads instructions from a storage means in which an instruction sequence and data are stored, and an instruction reading section that sequentially reads instructions from a storage means in which an instruction sequence and data are stored, and data from the storage means according to an address field of the instruction read by the instruction reading section. a data reading section that reads the instruction, a data transfer section that transfers the data read by the data reading section to the calculation means according to the type of the instruction read by the instruction reading section, and the storage that stores the calculation result output from the calculation means. a writing section for writing into the instruction means, the instruction read by the instruction reading section does not include a field indicating an address for storing an operation result, and the writing section writes the instruction output from the operation means. The method is characterized in that the calculation results corresponding to are sequentially written to consecutive addresses of the storage means .

本発明によれば、演算器との間でデータのやりとりを行う情報処理ユニットの回路規模を小さくしながら、演算器の稼働率を向上させることができる。 According to the present invention, it is possible to improve the operating rate of the computing unit while reducing the circuit scale of the information processing unit that exchanges data with the computing unit.

第1実施形態に係る情報処理装置の基本構成を示すブロック図である。FIG. 1 is a block diagram showing the basic configuration of an information processing device according to a first embodiment. ALUが扱うデータの構成と、ALUのブロック図である。2 is a block diagram of the ALU and the structure of data handled by the ALU. FIG. アクセラレータの命令のビット構成を説明する図である。FIG. 2 is a diagram illustrating a bit configuration of an accelerator instruction. コントロールレジスタの構成とメモリマップの例を示す図である。FIG. 3 is a diagram showing an example of a configuration of a control register and a memory map. 演算式をプログラムに分解して実行する手法を説明する図である。FIG. 3 is a diagram illustrating a method of decomposing an arithmetic expression into a program and executing the program. 図5(e)のプログラムのアッセンブラ表記及びタイミングチャートである。It is assembler notation and a timing chart of the program of FIG.5(e). 中間データを用いた演算処理を説明する図である。FIG. 3 is a diagram illustrating arithmetic processing using intermediate data. 3つのアクセラレータで3つのALUを共有する回路のブロック図である。FIG. 3 is a block diagram of a circuit in which three accelerators share three ALUs. アービターの回路図である。FIG. 2 is a circuit diagram of an arbiter. アービターの動作の一例を示すタイミングチャートである。3 is a timing chart showing an example of the operation of an arbiter. アクセラレータが備える書込部の回路図である。FIG. 3 is a circuit diagram of a writing section included in the accelerator. アクセラレータで実行されるプログラムを生成するコンパイラのフローチャートである。3 is a flowchart of a compiler that generates a program to be executed on an accelerator. プログラムの展開、分解、並べ替えの例を示す図である。FIG. 3 is a diagram showing an example of program expansion, decomposition, and rearrangement. 第2実施形態に係る情報処理装置の部分的なブロック図である。FIG. 2 is a partial block diagram of an information processing device according to a second embodiment. 第3実施形態で中間コードを用いてアクセラレータで実行可能な機械語のプログラムを生成する工程を説明するフローチャートである。12 is a flowchart illustrating a process of generating a machine language program executable by an accelerator using intermediate code in a third embodiment. 中間コードのビットフィールドを説明する図である。FIG. 3 is a diagram illustrating a bit field of an intermediate code. 第4実施形態に係る情報処理装置のブロック図である。FIG. 3 is a block diagram of an information processing device according to a fourth embodiment.

以下、本発明の実施形態について、添付図面を参照して詳細に説明する。 Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

<第1実施形態>
図1は、本発明の実施形態に係る情報処理ユニットとしてのアクセラレータ103を備える情報処理装置100の基本構成を示すブロック図である。情報処理装置100は、CPU101、DRAM102、アクセラレータ103、SRAMブロック104、ALU111及びデータ転送部112を備える。図1には、アクセラレータ103及びALU111を1つずつ備える構成が示されているが、後述するように、アクセラレータ103とALU111とをそれぞれ複数備える構成とすることもできる。
<First embodiment>
FIG. 1 is a block diagram showing the basic configuration of an information processing apparatus 100 including an accelerator 103 as an information processing unit according to an embodiment of the present invention. The information processing device 100 includes a CPU 101, a DRAM 102, an accelerator 103, an SRAM block 104, an ALU 111, and a data transfer unit 112. Although FIG. 1 shows a configuration including one accelerator 103 and one ALU 111, a configuration including a plurality of accelerators 103 and a plurality of ALUs 111 is also possible, as will be described later.

CPUは、Central Processing Unitの略称である。DRAMは、Dynamic Random Access Memoryの略称である。SRAMは、Static Random Access Memoryの略称である。ALUは、Arithmetic Logic Unitの略称である。 CPU is an abbreviation for Central Processing Unit. DRAM is an abbreviation for Dynamic Random Access Memory. SRAM is an abbreviation for Static Random Access Memory. ALU is an abbreviation for Arithmetic Logic Unit.

CPU101は、主たる制御回路であり、情報処理装置100の全体的な制御を行うプロセッサである。DRAM102は、CPU101上で動作するプログラムとアクセラレータ103で動作させるプログラム等を格納する記憶媒体である。 The CPU 101 is a main control circuit, and is a processor that performs overall control of the information processing apparatus 100. The DRAM 102 is a storage medium that stores programs that run on the CPU 101, programs that run on the accelerator 103, and the like.

SRAMブロック104は、CPU101とアクセラレータ103の動作に必要なデータやALU111による演算結果等を記憶する記憶媒体である。SRAMブロック104は、複数のSRAMを備える。CPU101とアクセラレータ103はSRAMブロック104へアクセス可能である。ALU111は、浮動小数点演算を行う演算装置である。 The SRAM block 104 is a storage medium that stores data necessary for the operation of the CPU 101 and the accelerator 103, calculation results by the ALU 111, and the like. SRAM block 104 includes multiple SRAMs. The CPU 101 and the accelerator 103 can access the SRAM block 104. The ALU 111 is an arithmetic unit that performs floating point arithmetic.

図2(a)は、ALU111が行う演算に用いられる32ビットの単精度のデータの構成を説明する図である。ここでは、ALU111は、単精度の浮動小数点を計算する。32ビットの単精度のデータは、ビットごとに役割が決まっており、符号ビット(SIGN)200、指数ビット(EXPONENT)201及び仮数ビット(FRACTION)202から構成される。 FIG. 2A is a diagram illustrating the structure of 32-bit single-precision data used for calculations performed by the ALU 111. Here, the ALU 111 calculates single-precision floating point numbers. The 32-bit single-precision data has a determined role for each bit, and is composed of a sign bit (SIGN) 200, an exponent bit (EXPONENT) 201, and a mantissa bit (FRACTION) 202.

図2(b)は、ALU111のブロック図である。ALU111は、データの入力を行うためのA入力部203及びB入力部204と、演算結果を出力するための出力部208を有する。また、ALU111は、浮動小数点演算を行うための仮数部205、指数部206及び符号部207を有する。仮数部205、指数部206及び符号部207は、A入力部203とB入力部204から入力されたデータに対して丸めによる桁上がり等の必要な情報を交換しながら演算を行い、演算結果は出力部208から出力される。 FIG. 2(b) is a block diagram of the ALU 111. The ALU 111 has an A input section 203 and a B input section 204 for inputting data, and an output section 208 for outputting calculation results. The ALU 111 also includes a mantissa section 205, an exponent section 206, and a sign section 207 for performing floating point operations. The mantissa section 205, exponent section 206, and sign section 207 perform operations on the data input from the A input section 203 and the B input section 204 while exchanging necessary information such as carry due to rounding, and the operation result is It is output from the output unit 208.

仮数部205、指数部206及び符号部207にはそれぞれ5つのフリップフロップが挿入されている。そのため、ALU111では、A入力部203とB入力部203からデータが入力された後、仮数部205、指数部206及び符号部207による演算結果は、5サイクル後に出力部208に到達する。 Five flip-flops are inserted in each of the mantissa part 205, exponent part 206, and sign part 207. Therefore, in the ALU 111, after data is input from the A input section 203 and the B input section 203, the calculation results from the mantissa section 205, exponent section 206, and sign section 207 reach the output section 208 five cycles later.

ALU111での動作周波数を高めるためには、フリップフロップ間に生じるゲート遅延を短くする必要があるため、小さな演算単位ごとにフリップフロップを挿入して設計することとなる。ALU111では、1つの演算に5サイクルかかるとする。1サイクルごとに有効なデータ入力があると1サイクルごとに有効な出力が得られる。つまり、1サイクルで1つの演算を行うことができる。 In order to increase the operating frequency of the ALU 111, it is necessary to shorten the gate delay occurring between flip-flops, so a flip-flop is inserted in each small operation unit in the design. In the ALU 111, it is assumed that one operation takes five cycles. If there is a valid data input every cycle, a valid output will be obtained every cycle. In other words, one operation can be performed in one cycle.

なお、ALU111に有効なデータを入力することができないサイクルは無駄なサイクルとなる。したがって、有効なデータを入力することができる割合が、ALU111の稼働率となる。本発明は、ALU111の稼働率を高めることを課題の1つとしており、後述するように、アクセラレータは小さな回路構成でALU111の稼働率を高めることを可能とする。 Note that a cycle in which valid data cannot be input to the ALU 111 is a wasted cycle. Therefore, the rate at which valid data can be input is the operating rate of the ALU 111. One of the objectives of the present invention is to increase the operating rate of the ALU 111, and as described later, the accelerator makes it possible to increase the operating rate of the ALU 111 with a small circuit configuration.

図1の説明に戻る。アクセラレータ103は、CPU101からアクセラレータ103の動作を制御するためのコントロールレジスタ105を有する。コントロールレジスタ105は、メモリマップドIOとなっており、データバスによってCPU101のアドレスバスと接続されている。 Returning to the explanation of FIG. The accelerator 103 has a control register 105 for controlling the operation of the accelerator 103 from the CPU 101. The control register 105 is a memory mapped IO, and is connected to the address bus of the CPU 101 via a data bus.

アクセラレータ103は、命令読込部110、データ読込部109、書込部113及び比較部116を有する。命令読込部110、データ読込部109及び書込部113は、読み込んだ要素を入ってきた順に一列に並べ、先に入れた要素から順に取り出す規則で要素の出し入れを行うキュー(QUEUE)として動作するように構成されている。比較部116の機能については後述する。 The accelerator 103 includes an instruction reading section 110, a data reading section 109, a writing section 113, and a comparison section 116. The instruction reading unit 110, data reading unit 109, and writing unit 113 operate as a queue (QUEUE) that arranges the read elements in a line in the order in which they came in and takes out the elements in accordance with the rule that the element that was entered first is taken out in order. It is configured as follows. The function of the comparison unit 116 will be described later.

命令読込部110は、SRAMブロック104から命令列を読み込む。命令読込部110は、WAITアドレス106を有する。WAITアドレス106には、後述のWAIT命令により指定されるアドレスの値が入力される。データ読込部109は、演算に用いるデータをSRAMブロック104から読み込む。命令読込部110とデータ読込部109とは、それぞれ独立したアドレスバスとデータバスを持つバスマスターである。SRAMブロック104の複数のSRAMはそれぞれ、異なるアドレスに配置され、命令列とデータを別のSRAMから読み込むことができるように配置される。SRAMブロック104の複数のSRAMはそれぞれ、同一サイクルにデータと命令の両方を読み込むことが可能である。 The instruction reading unit 110 reads an instruction string from the SRAM block 104. The instruction reading unit 110 has a WAIT address 106. The value of the address specified by a WAIT command, which will be described later, is input to the WAIT address 106. The data reading unit 109 reads data used for calculations from the SRAM block 104. The instruction reading section 110 and the data reading section 109 are bus masters having independent address buses and data buses, respectively. The plurality of SRAMs in the SRAM block 104 are arranged at different addresses, respectively, and are arranged so that instruction sequences and data can be read from other SRAMs. Each of the multiple SRAMs in SRAM block 104 can read both data and instructions in the same cycle.

データ転送部112は、ALU111へ命令とデータとを転送する。ALU111にデータが転送されると、一定サイクル後にALU111から演算結果が書込部113へ出力される。書込部113は、ALU111から演算結果を受信すると、受信した演算結果をSRAMブロック104に書き込む。書込部113は、命令読込部110やデータ読込部109と同様に、独立したアドレスバスとデータバスを持つバスマスターであり、命令読込部110及びデータ読込部109と同一サイクルでデータ書き込みを行うことができる。 The data transfer unit 112 transfers instructions and data to the ALU 111. When data is transferred to the ALU 111, the calculation result is output from the ALU 111 to the writing unit 113 after a certain cycle. When the writing unit 113 receives the calculation result from the ALU 111, it writes the received calculation result into the SRAM block 104. Like the instruction reading section 110 and the data reading section 109, the writing section 113 is a bus master having an independent address bus and data bus, and writes data in the same cycle as the instruction reading section 110 and the data reading section 109. be able to.

書込部113は、書き込みアドレス部114を有する。演算結果がSRAMブロック104に書き込まれる際のSRAMブロック104でのアドレスの値は、書き込みアドレス部114から出力される。書き込みアドレス部114に書き込まれるアドレスの値は、後述する図7の‘STORE ADDRESS’で示されるように、SRAMブロック104に書き込まれる演算結果に対応して、順次、書き換えられる。 The writing section 113 has a write address section 114. The value of the address in the SRAM block 104 when the calculation result is written to the SRAM block 104 is output from the write address section 114. The address value written to the write address section 114 is sequentially rewritten in accordance with the operation result written to the SRAM block 104, as shown by 'STORE ADDRESS' in FIG. 7, which will be described later.

図3(a)は、アクセラレータ103の命令のビット構成を説明する図である。命令は16ビット長のデータであり、ビット11~ビット15は、命令の種別を表すオペコード(OPECODE)フィールド301である。ビット9,10は、アクセスするSRAMブロック104のベースアドレス(BASE ADDRESS)の種類を指定するベースアドレスインデックス(BASE ADDRESS INDEX)フィールド302である。ビット0~8は、データのアドレスを表すオフセットアドレス(OFFSET ADDRESS)フィールド303である。9ビットのオフセットアドレスフィールド303では0~511を表現することができるが、単精度浮動小数点は32ビットなので、ここでは、オフセットアドレスフィールド303は4バイト単位のインデックス値として扱う。つまり、アクセス可能なのは、ベースアドレスに対して16進で0~7FCである。ベースアドレスは4つあり、各ベースアドレスはCPU101がコントロールレジスタ105へ書き込んで指定する。 FIG. 3A is a diagram illustrating the bit configuration of an instruction of the accelerator 103. An instruction is 16-bit data, and bits 11 to 15 are an operation code (OPECODE) field 301 indicating the type of instruction. Bits 9 and 10 are a base address index (BASE ADDRESS INDEX) field 302 that specifies the type of base address (BASE ADDRESS) of the SRAM block 104 to be accessed. Bits 0-8 are an offset address (OFFSET ADDRESS) field 303 representing the address of data. The 9-bit offset address field 303 can represent 0 to 511, but since a single-precision floating point number is 32 bits, the offset address field 303 is treated as an index value in units of 4 bytes here. In other words, what can be accessed is 0 to 7FC in hexadecimal relative to the base address. There are four base addresses, and each base address is specified by the CPU 101 by writing it into the control register 105.

図3(b)は、命令のアッセンブラ表記(ニーモニック)である。命令の種類には、算術演算子の加減乗除命令、終了命令、その他幾つかの制御命令がある。命令は、実行する演算を指定するオペコード部304、A又はBで指定される被演算子305、データを指定するラベル306から構成される。 FIG. 3(b) is an assembler notation (mnemonic) of the instruction. Types of instructions include addition, subtraction, multiplication, and division instructions for arithmetic operators, termination instructions, and several other control instructions. The instruction includes an opcode section 304 that specifies the operation to be executed, an operand 305 that is specified as A or B, and a label 306 that specifies data.

アクセラレータ103の命令の基本的な構造は、被演算子305にラベル306で示すアドレスからデータを読み込んだ上で、オペコード部304が指定する算術演算を行うというものである。例えば、‘i÷j’という演算は、‘FNOP A,i’で‘A’に‘i’を取り込み、‘FDIV B,j’で‘B’に‘j’を取り込んだ上で、‘A÷B’を行うという2つの命令で実現される。なお、アクセラレータ103の命令には、演算結果を格納するアドレスを示すフィールドは存在しない。これは、書込部113は、演算結果を順次連続アドレスに書き込む構造となっており、演算結果を格納するアドレスを選ぶことができないからである。 The basic structure of the instruction of the accelerator 103 is to read data into the operand 305 from the address indicated by the label 306, and then perform an arithmetic operation specified by the opcode section 304. For example, the operation 'i÷j' takes 'i' into 'A' with 'FNOP A,i', takes 'j' into 'B' with 'FDIV B,j', and then 'A'. This is accomplished with two instructions: ÷B'. Note that the instruction of the accelerator 103 does not include a field indicating the address where the calculation result is stored. This is because the writing unit 113 has a structure in which the calculation results are sequentially written to consecutive addresses, and the address in which the calculation results are stored cannot be selected.

図4は、アクセラレータ103におけるコントロールレジスタ105とSRAMブロック104のメモリマップの構成を示す図である。コントロールレジスタ105は、スタートレジスタ414、プログラムアドレス415、第1ベースアドレス401、第2ベースアドレス402、ワークベースアドレス403及び出力ベースアドレス404を有する。 FIG. 4 is a diagram showing the configuration of a memory map of the control register 105 and the SRAM block 104 in the accelerator 103. The control register 105 has a start register 414, a program address 415, a first base address 401, a second base address 402, a work base address 403, and an output base address 404.

第1ベースアドレス401は共通データ405を指定する。第2ベースアドレス402はアクセラレータ0専用のパラメータエリア409を指定する。ワークベースアドレス403は、アクセラレータ0専用のワークエリア410を指定する。なお、ここでは、アクセラレータ103として、3つのアクセラレータ0,1,2を備える構成を想定している。ワークエリア410は、512個分のデータを確保することが可能となっている。 The first base address 401 specifies common data 405. The second base address 402 specifies a parameter area 409 dedicated to accelerator 0. The work base address 403 specifies a work area 410 dedicated to accelerator 0. Note that here, it is assumed that the accelerator 103 includes three accelerators 0, 1, and 2. The work area 410 can secure 512 pieces of data.

プログラムアドレス415は、プログラムの開始アドレス413を指定している。スタートレジスタ414に‘1’が書き込まれると、アクセラレータ0はプログラムの読み出しを開始し、終了命令を読み込むまで、順次、プログラムを実行する。 The program address 415 specifies the start address 413 of the program. When '1' is written to the start register 414, the accelerator 0 starts reading the program and executes the program sequentially until reading the end instruction.

図5を参照して、演算式をプログラムに分解して実行する手法について説明する。図5(a)は、演算式の一例を示している。図5(b)は、図5(a)の演算式を解くプログラムをC言語で示したリストであり、n=3の配列に対する3重ループで積和演算を行うプログラムを示している。図5(c)は、図5(b)に示したプログラムの変形例を示しており、b[k][j]のアドレッシングをまとめることによりアクセスを減らしたものである。 With reference to FIG. 5, a method of decomposing an arithmetic expression into a program and executing it will be described. FIG. 5(a) shows an example of an arithmetic expression. FIG. 5(b) is a list showing a program in C language for solving the arithmetic expression of FIG. 5(a), and shows a program that performs a product-sum operation in a triple loop for an array of n=3. FIG. 5C shows a modification of the program shown in FIG. 5B, in which accesses are reduced by combining the addressing of b[k][j].

図5(d)は、プログラムがアクセスするデータにラベルをつけて展開したものを示している。図5(c),(c)のC言語で書かれたプログラムではi,j,kを演算しているが、i,j,kがどのような数値に変化するかはコンパイル時には決まっているため、それぞれを固定アドレスに予め展開することができる。図5(d)の展開式では、1つの式に加算を表す‘+’と乗算を表す‘×(図5では‘*’)’の2つの演算子があるため、命令に展開するためには中間ノードとなる変数(以下「中間変数」という)を介在させる必要がある。 FIG. 5(d) shows the data accessed by the program that has been labeled and expanded. The programs written in C language in Figures 5(c) and (c) calculate i, j, and k, but the numerical values that i, j, and k will change to are determined at the time of compilation. Therefore, each can be expanded to a fixed address in advance. In the expansion expression in Figure 5(d), there are two operators in one expression: '+', which represents addition, and '×' ('*' in Figure 5), which represents multiplication, so in order to expand it into an instruction, requires intervening variables that serve as intermediate nodes (hereinafter referred to as "intermediate variables").

図5(e)は、中間変数に対してラベルを割り当てて順番を並び替えたものを示している。図5(e)では、001行目から009行目まで乗算が続き、その結果を加算する命令は010行目からとなっている。最初の中間変数TMP000が参照されるのは010行目であり、また、変数C00に加算してC00に戻す式は、新しい中間変数TMP010に格納される。038行目で再びC00へ加算するときには、中間変数TMP010を参照して新たな中間変数TMP038へ代入する。このような順序に展開して演算順序を並び替えることにより、代入から参照までのサイクル数を伸ばしているため、アクセラレータ103ではデータハザードは発生しない。 FIG. 5E shows labels assigned to intermediate variables and their order rearranged. In FIG. 5E, multiplication continues from line 001 to line 009, and the instruction to add the result starts from line 010. The first intermediate variable TMP000 is referenced at line 010, and the expression that adds to the variable C00 and returns it to C00 is stored in the new intermediate variable TMP010. When adding to C00 again in line 038, intermediate variable TMP010 is referred to and substituted into a new intermediate variable TMP038. By expanding in this order and rearranging the operation order, the number of cycles from assignment to reference is increased, so no data hazard occurs in the accelerator 103.

図6(a)は、図5(e)のプログラムをアッセンブラ表記にして示す図である。000行目は、被演算子Bに変数B00をロードするだけで、算術演算を行わない。001行目は、被演算子Aに変数A00をロードして、‘A×B’の乗算を実行する。変数A00,B00はパラメータエリア409に配置されており、中間変数はワークエリア410に配置される。なお、アッセンブラ表記上、中間変数TMP000を格納先として指定しているように見えるが、前述の通り、命令には格納先を指定するアドレスを示すフィールドは存在せず、TMP000というラベルに格納先のアドレスが関連付けられる。002行目は、被演算子Aに変数A10をロードして、‘A×B’の乗算を実行する。 FIG. 6(a) is a diagram showing the program of FIG. 5(e) in assembler notation. Line 000 simply loads variable B00 into operand B and does not perform any arithmetic operation. Line 001 loads the variable A00 into the operand A and executes 'A×B' multiplication. Variables A00 and B00 are placed in the parameter area 409, and intermediate variables are placed in the work area 410. Note that in the assembler notation, it seems that the intermediate variable TMP000 is specified as the storage destination, but as mentioned above, there is no field in the instruction that indicates the address that specifies the storage destination, and the label TMP000 indicates the storage destination. Addresses are associated. Line 002 loads the variable A10 into the operand A and executes 'A×B' multiplication.

図6(b)は、図6(a)のプログラム実行時のデータ転送部112での入出力を説明するタイミングチャートである。001サイクル目で被演算子BにB00がロードされ、002サイクル目で被演算子AにA00がロードされて乗算のリクエスト信号であるFMULが‘1’になり、これにより、乗算のALUに変数A00と変数B00が出力される。このように、002サイクルから004サイクルまで連続的に転送が発生している。なお、乗算のALUとは、例えば、後述する図8に示されるALU805である。 FIG. 6(b) is a timing chart illustrating input/output in the data transfer unit 112 during execution of the program shown in FIG. 6(a). In the 001st cycle, B00 is loaded into the operand B, and in the 002nd cycle, A00 is loaded into the operand A, and the multiplication request signal FMUL becomes '1', which causes the variable to be added to the multiplication ALU. A00 and variable B00 are output. In this way, transfer occurs continuously from cycle 002 to cycle 004. Note that the multiplication ALU is, for example, the ALU 805 shown in FIG. 8, which will be described later.

被演算子A,Bの両方にデータを読み込むのではなく、被演算子A,Bの一方のデータをロードする命令構造においても連続して演算が発生するのは、一方が共通となるように命令列を並び替えているからである。このような変数の共通化は多くの多項式で可能であり、コンパイラが命令列の並び替えを行う。002サイクル目で受理された演算に対する演算結果(中間変数TMP001)は、007サイクル目でFMUL_Qに出力され、同時に、有効なデータであることを示すVALID信号(FMUL_VALID)も出力される。 Even in an instruction structure where data is loaded from one of operands A and B instead of reading data into both operands A and B, consecutive operations occur so that one is common. This is because the instruction sequence is rearranged. Such commonization of variables is possible with many polynomials, and the compiler rearranges the instruction sequences. The operation result (intermediate variable TMP001) for the operation accepted at the 002nd cycle is output to FMUL_Q at the 007th cycle, and at the same time, a VALID signal (FMUL_VALID) indicating that the data is valid is also output.

図7は、演算結果(中間変数)を連続アドレスに順次格納しながら演算を行う状況を説明する図である。図7(a)~(d)では、図4に準じて、中間変数を格納するアクセラレータ0専用のワークエリア410がアクセラレータ0のワークベースアドレス403によって指定されているものとする。なお、図7(a)~(d)には、説明の便宜上、演算内容をプログラムとニーモニックで示しているが、DRAM102にはアクセラレータ0で実行可能な機械語のプログラムが格納されていればよい。 FIG. 7 is a diagram illustrating a situation in which calculations are performed while sequentially storing calculation results (intermediate variables) at consecutive addresses. In FIGS. 7A to 7D, it is assumed that a work area 410 dedicated to accelerator 0 that stores intermediate variables is specified by the work base address 403 of accelerator 0, according to FIG. Note that in FIGS. 7A to 7D, the calculation contents are shown as programs and mnemonics for convenience of explanation, but it is sufficient that the DRAM 102 stores a machine language program that can be executed by accelerator 0. .

図7(a)に示すように、アクセラレータ0が最初の命令701の‘FNOP B,B00’を実行すると、ワークエリア410のアドレス000番地に意味のないデータが格納される。アクセラレータ0が次の命令702の‘FMUL TMP000,A,A00’を実行すると、004番地に演算結果である中間変数TMP000が格納される。アクセラレータ0が次の命令703の‘FMUL TMP001,A,A10’を実行すると、008番地に演算結果である中間変数TMP001が格納される。命令704の‘FNOP A,TMP000’で中間変数TMP000を被演算子Aにロードする際には、命令のアドレスフィールドには004番地を示す値001が格納されている。 As shown in FIG. 7A, when the accelerator 0 executes the first instruction 701 'FNOP B, B00', meaningless data is stored at address 000 of the work area 410. When accelerator 0 executes the next instruction 702, 'FMUL TMP000, A, A00', intermediate variable TMP000, which is the calculation result, is stored at address 004. When accelerator 0 executes the next instruction 703, 'FMUL TMP001, A, A10', intermediate variable TMP001, which is the calculation result, is stored at address 008. When the intermediate variable TMP000 is loaded into the operand A with the instruction 704 'FNOP A, TMP000', the value 001 indicating address 004 is stored in the address field of the instruction.

このように計算結果を順次格納していくと、ワークエリア410を最初から最後まで使い果たしてしまう。そのため、命令705の‘FADD TMP501,A,TMP000’が実行されると、演算結果は000番地に格納されることになる。更に次の命令が実行されると、004番地に格納されていた中間変数TMP000が上書きされてしまうことになる。このように、アクセラレータ0で扱う中間変数には生存期間があり、中間変数は511ステップのプログラム実行により生存期間を終えることとなる。換言すれば、中間変数は、SRAMブロック104に記憶されている期間であれば参照可能である。 If the calculation results are stored sequentially in this way, the work area 410 will be used up from beginning to end. Therefore, when the instruction 705 'FADD TMP501,A,TMP000' is executed, the operation result will be stored at address 000. Furthermore, when the next instruction is executed, the intermediate variable TMP000 stored at address 004 will be overwritten. In this way, the intermediate variables handled by accelerator 0 have a lifetime, and the intermediate variables end their lifetime after 511 steps of program execution. In other words, the intermediate variable can be referenced during the period in which it is stored in the SRAM block 104.

多くの場合、511ステップよりも長い生存期間は必要ないが、変数の生存期間を延長したい場合には、生存期間延長のための命令を用いる。例えば、図7(b)において、命令706の‘FADD TMP502,B,ZERO’では、中間変数TMP000に値0(ゼロ)を加算して、新たな演算結果である中間変数TMP502を格納している。これにより、これ以降、中間変数TMP000は、中間変数TMP502と名前を変えて生存し続けることが可能になる。変数の生存期間を延長する手法としては、ゼロを加算する手法に代えて、‘1’を乗算する手法を用いることもできる。 In many cases, a lifetime longer than 511 steps is not required, but if you want to extend the lifetime of a variable, use instructions for extending the lifetime. For example, in FIG. 7(b), the instruction 706 'FADD TMP502, B, ZERO' adds the value 0 (zero) to the intermediate variable TMP000 and stores the intermediate variable TMP502 which is the new operation result. . As a result, from now on, the intermediate variable TMP000 can continue to exist with the name changed to the intermediate variable TMP502. As a method of extending the lifetime of a variable, instead of adding zero, a method of multiplying by '1' can also be used.

なお、図2(b)を参照して説明したように、ALU111から演算結果が出力されるまでに数サイクル、演算結果が書込部113に書き込まれた後、SRAMブロック104に書き込まれて参照可能となるまでに数サイクルを要する。逆に、既存の中間変数を上書きしてしまう命令の後であっても、数サイクルは上書き前の変数を参照することができる。 As explained with reference to FIG. 2(b), the calculation result is written to the writing unit 113 for several cycles before it is output from the ALU 111, and then written to the SRAM block 104 for reference. It takes several cycles before this becomes possible. Conversely, even after an instruction that overwrites an existing intermediate variable, the variable before being overwritten can be referenced for several cycles.

図7(c)において、命令707の‘FADD TMP503,B,TEMP001’は、既に上述した上書きを行う命令706が実行された後であるが、中間変数TMP001を参照している。ここで、代入結果をすぐに参照しなければならない場合には、‘WAIT TMP501’で表されるWAIT命令708を用いて、参照可能になるまで待つことができる。WAIT命令は、アクセスしたい変数のアドレスの値を指定する命令である。 In FIG. 7C, the instruction 707 'FADD TMP503,B,TEMP001' refers to the intermediate variable TMP001 even after the above-described overwriting instruction 706 has already been executed. Here, if the assignment result must be referenced immediately, the WAIT instruction 708 represented by 'WAIT TMP501' can be used to wait until it becomes referenceable. The WAIT instruction is an instruction that specifies the address value of a variable to be accessed.

WAIT命令は、命令読込部110のWAITアドレス106に値(参照アドレス)を入力して、比較部116を有効にする。比較部116は、書き込みアドレス部114のアドレスの値がWAITアドレス106の値を通過したことを検出することができる。第1実施形態では、書き込みアドレス114の値はインクリメントする。したがって、書き込みアドレス114がWAITアドレス106を通過するとは、書き込みアドレス114のほうがWAITアドレス106よりも大きくなることを意味する。なお、書き込みアドレス114がディクリメントする構成で実施する場合、書き込みアドレス114の方がWAITアドレス106よりも小さくなったことに応じて、書き込みアドレス114がWAITアドレス106を通過したことを検出する。書き込みアドレス114が所定の範囲の終端に達すると初期値に戻ることを考慮すると、単純な大小比較ではなく、値間の距離を制限しての比較となる。本実施形態では‘((参照アドレス-書き込みアドレス)&0x7FF)<0x400’という条件となる。 The WAIT instruction inputs a value (reference address) to the WAIT address 106 of the instruction reading section 110 and enables the comparison section 116. The comparator 116 can detect that the address value of the write address section 114 has passed the value of the WAIT address 106. In the first embodiment, the value of the write address 114 is incremented. Therefore, when the write address 114 passes through the WAIT address 106, it means that the write address 114 is larger than the WAIT address 106. Note that when implementing the configuration in which the write address 114 is decremented, when the write address 114 becomes smaller than the WAIT address 106, it is detected that the write address 114 has passed the WAIT address 106. Considering that the write address 114 returns to the initial value when it reaches the end of a predetermined range, the comparison is not a simple comparison of magnitudes, but a comparison that limits the distance between values. In this embodiment, the condition is '((reference address - write address) & 0x7FF) < 0x400'.

比較部116は、WAITアドレス106を監視し、WAITアドレス106に入力されたアドレスの値と書き込みアドレス部114の値とを比較する。比較部116は、書込部113への書き込みが完了していない場合(書き込みアドレス部114の値がWAITアドレス106の値に達していない場合)に、データ読込部109での次のデータの読み込みを抑制する。本実施形態では‘((参照アドレス-書き込みアドレス)&0x7FF)<0x400’の関係が成立した場合に次のデータ読み出しを行うが、そうでない場合にはデータ読込部109は停止する。 The comparison unit 116 monitors the WAIT address 106 and compares the value of the address input to the WAIT address 106 and the value of the write address unit 114. The comparison unit 116 allows the data reading unit 109 to read the next data when writing to the writing unit 113 is not completed (when the value of the write address field 114 has not reached the value of the WAIT address 106). suppress. In this embodiment, the next data read is performed when the relationship '((reference address - write address) & 0x7FF) < 0x400' is established, but if not, the data reading unit 109 stops.

図7(d)は、演算結果を格納するアドレスが7FC番地に達する前にアドレスをクリアする(000番地にする)命令710の‘REWIND’を実行した状態を示している。この命令により、メモリマップとして十分な容量が確保できない場合に、少ないワークエリアで演算を実行することが可能となる。なお、意図的に7FC番地付近にあるデータの生存期間を延ばすという用い方も可能である。 FIG. 7D shows a state in which 'REWIND' of an instruction 710 is executed to clear the address (set it to address 000) before the address for storing the operation result reaches address 7FC. This instruction makes it possible to execute operations with a small work area when sufficient memory map capacity cannot be secured. Note that it is also possible to intentionally extend the lifetime of data near address 7FC.

図8は、3つのアクセラレータ0_801、アクセラレータ1_802及びアクセラレータ2_803で3つのALU805、ALU806及びALU807を共有する回路のブロック図である。なお、図1の情報処理装置100のブロック図には、1つのアクセラレータ103と1つのALU111を備える構成を示しているが、図8に示すように、複数のアクセラレータと複数のALUを備える構成とすることができる。アクセラレータ0_801、アクセラレータ1_802及びアクセラレータ2_803のそれぞれは、図1に示したアクセラレータ103に対応する。また、ALU805、ALU806及びALU807のそれぞれは、図1に示したALU111に対応する。 FIG. 8 is a block diagram of a circuit in which three accelerators 0_801, 1_802, and 2_803 share three ALUs 805, ALUs 806, and ALUs 807. Note that although the block diagram of the information processing device 100 in FIG. 1 shows a configuration including one accelerator 103 and one ALU 111, as shown in FIG. can do. Each of accelerator 0_801, accelerator 1_802, and accelerator 2_803 corresponds to accelerator 103 shown in FIG. Further, each of ALU 805, ALU 806, and ALU 807 corresponds to ALU 111 shown in FIG.

アクセラレータ0_801、アクセラレータ1_802及びアクセラレータ2_803はそれぞれ、3つのアービター804に接続されている。3つのアービター804はそれぞれ、アクセラレータ0_801、アクセラレータ1_802及びアクセラレータ2_803が同時にリクエスト信号をHighにした場合、優先度の高いアクセラレータに対してGRANT信号をHighにする。この場合、アクセラレータは、リクエスト信号をHighにしてもGRANT信号がLow(ロー)のままであることはリクエスト信号が受理されていないため、GRANT信号がHighになるまでそのままの状態で待機する。 Accelerator 0_801, accelerator 1_802, and accelerator 2_803 are each connected to three arbiters 804. If accelerator 0_801, accelerator 1_802, and accelerator 2_803 simultaneously set their request signals to High, each of the three arbiters 804 sets the GRANT signal to High for the accelerator with a higher priority. In this case, the accelerator waits in that state until the GRANT signal becomes High because the request signal is not accepted if the GRANT signal remains Low even if the request signal becomes High.

ALU805は乗算演算を行う。ALU806は除算演算を行う。ALU807は加算演算を行う。ALU805、ALU806及びALU807はそれぞれ独立して同時に演算を実行可能である。仮にアクセラレータが1つでALUが3つの構成の場合、3つのALUのうち2つは稼働していないことになる。これに対して、複数のアクセラレータからこれと同数のALUに並列的に演算を実行させる構成とすることで、ALUの稼働率を上げることができる。 ALU 805 performs multiplication operations. ALU 806 performs a division operation. ALU 807 performs an addition operation. ALU 805, ALU 806, and ALU 807 can each independently execute operations simultaneously. If the configuration has one accelerator and three ALUs, two of the three ALUs will not be operating. On the other hand, by configuring the same number of ALUs to execute calculations in parallel from a plurality of accelerators, the utilization rate of the ALUs can be increased.

図9は、アービター804の回路図である。アービター804は、アクセラレータ0_801に接続される端子群901と、アクセラレータ1_802に接続される端子群902と、アクセラレータ2_803に接続される端子群903とを有する。 FIG. 9 is a circuit diagram of arbiter 804. The arbiter 804 has a terminal group 901 connected to accelerator 0_801, a terminal group 902 connected to accelerator 1_802, and a terminal group 903 connected to accelerator 2_803.

端子群901は、アクセラレータ0_801と接続する複数の端子901a~901fを含む。端子群902は、アクセラレータ1_802と接続する複数の端子902a~902fを含む。端子群903は、アクセラレータ0_803と接続する複数の端子903a~903fを含む。端子901aはリクエスト信号の入力に用いられる入力端子である。端子901b,901cは、被演算子A,Bのデータ入力に用いられる入力端子である。端子901dはGRANT信号をアクセラレータ0_801に出力する出力端子である。端子901eは、VALID信号をアクセラレータ0_801に出力する出力端子である。端子901fは、演算結果Qをアクセラレータ0_801に出力する出力端子である。端子群902及び端子群903も同様に、対応するアクセラレータと信号の入出力を行うための複数の端子を有する。端子群902及び端子群903については、説明を省略する。 Terminal group 901 includes a plurality of terminals 901a to 901f connected to accelerator 0_801. Terminal group 902 includes a plurality of terminals 902a to 902f connected to accelerator 1_802. Terminal group 903 includes a plurality of terminals 903a to 903f connected to accelerator 0_803. The terminal 901a is an input terminal used for inputting a request signal. Terminals 901b and 901c are input terminals used for inputting data of operands A and B. The terminal 901d is an output terminal that outputs the GRANT signal to the accelerator 0_801. The terminal 901e is an output terminal that outputs the VALID signal to the accelerator 0_801. The terminal 901f is an output terminal that outputs the calculation result Q to the accelerator 0_801. Similarly, the terminal group 902 and the terminal group 903 have a plurality of terminals for inputting and outputting signals with the corresponding accelerator. Descriptions of the terminal group 902 and the terminal group 903 will be omitted.

例えば、アクセラレータ0_801は、所定のALUへデータを転送する際に、被演算子A,Bのデータを端子901b,901cに入力し、リクエスト信号をHighにして端子901aへ入力する。アクセラレータ0_801はプライオリティが一番上(最優先)となっているものとする。この場合、リクエスト信号は必ず受理されてALU側端子917を通じて対応するALUへ送られる。また、HighのGRANT信号が端子901dから出力される。 For example, when transferring data to a predetermined ALU, accelerator 0_801 inputs the data of operands A and B to terminals 901b and 901c, sets the request signal to High, and inputs it to terminal 901a. It is assumed that the accelerator 0_801 has the highest priority (highest priority). In this case, the request signal is always accepted and sent to the corresponding ALU through the ALU side terminal 917. Further, a High GRANT signal is output from the terminal 901d.

アクセラレータ1_802のリクエスト信号がHighになった際に同じサイクルで端子901aに入力されるリクエスト信号がHighになっている場合、ゲート909の作用により、アクセラレータ1_802のリクエスト信号は受理されない。一方、アクセラレータ1_802のリクエスト信号がHighになった際に同じサイクルで端子901aに入力されるリクエスト信号がLowになっている場合には、アクセラレータ1_802のリクエスト信号は受理される。その結果、アクセラレータ1_802からの被演算子A,Bのデータがアービター804へ入力され、ゲート910,911を通過して、ALU側端子914,915へ送られる。 If the request signal input to the terminal 901a in the same cycle when the request signal of the accelerator 1_802 becomes High is High, the request signal of the accelerator 1_802 is not accepted due to the action of the gate 909. On the other hand, if the request signal input to the terminal 901a in the same cycle when the request signal of accelerator 1_802 becomes High is low, the request signal of accelerator 1_802 is accepted. As a result, data of operands A and B from accelerator 1_802 is input to arbiter 804, passes through gates 910 and 911, and is sent to ALU side terminals 914 and 915.

また、アクセラレータ1_802から端子902aを通じてゲート909が受理したリクエスト信号は、遅延素子912で遅延された後、VALID信号としてアクセラレータ1_802の書込部113に送られる。同じサイクルで、ALUからALU側端子916に演算結果Qが入力されており、演算結果Qはゲート913を通過してアクセラレータ1_802の書込部113へ送られる。 Further, the request signal received by the gate 909 from the accelerator 1_802 through the terminal 902a is delayed by the delay element 912, and then sent to the writing unit 113 of the accelerator 1_802 as a VALID signal. In the same cycle, the calculation result Q is input from the ALU to the ALU side terminal 916, and the calculation result Q is sent to the writing unit 113 of the accelerator 1_802 through the gate 913.

図10は、2つのアクセラレータ0_801及びアクセラレータ1_802から1つのアービター804へ同時にリクエスト信号が入力された場合のアービター804の動作を示すタイミングチャートである。 FIG. 10 is a timing chart showing the operation of the arbiter 804 when request signals are simultaneously input to one arbiter 804 from two accelerators 0_801 and 1_802.

アクセラレータ0_801が、2サイクル目でリクエスト信号をHighにしており、同じサイクルでGRANT信号を出力している。これと同じサイクルでアクセラレータ1_802のリクエスト信号もHighになっているが、GRANT信号がLowとなっているため、アクセラレータ1_802は信号を保持したまま停止した状態となっている。 Accelerator 0_801 makes the request signal High in the second cycle, and outputs the GRANT signal in the same cycle. In the same cycle, the request signal of accelerator 1_802 also becomes High, but since the GRANT signal becomes Low, accelerator 1_802 is in a stopped state while holding the signal.

アクセラレータ1_802のリクエスト信号がLowになる5サイクル目でアクセラレータ1_802のGRANT信号はHighになり、アクセラレータ1_802のプログラムが1サイクルだけ進む。こうして、不図示のALU側では、全てのサイクルで演算が行われる。その際、アクセラレータ1_802のプログラムは乗算命令が連続し又は加算命令が連続するため、アクセラレータ0_801のプログラムから少し遅れて、アクセラレータ1_802のプログラムが実行されていくことになる。 At the fifth cycle when the request signal of accelerator 1_802 becomes Low, the GRANT signal of accelerator 1_802 becomes High, and the program of accelerator 1_802 advances by one cycle. In this way, on the ALU side (not shown), calculations are performed in every cycle. At this time, since the program for accelerator 1_802 includes consecutive multiplication instructions or consecutive addition instructions, the program for accelerator 1_802 is executed a little later than the program for accelerator 0_801.

図11は、アクセラレータ103が備える書込部113の回路図である。書込部113は、乗算ALU(図8のALU805)からの演算結果Qの入力端子1102と、有効なデータのサイクルを示すVALID信号の入力端子1103を有する。また、書込部113は、除算ALU(図8のALU806)からの演算結果Qの入力端子1104と、VALID信号の入力端子1105を有する。更に、書込部113は、加算ALU(図8のALU807)からの演算結果Qのデータ入力端子1106と、VALID信号の入力端子1107を有する。 FIG. 11 is a circuit diagram of the writing unit 113 included in the accelerator 103. The writing unit 113 has an input terminal 1102 for the operation result Q from the multiplication ALU (ALU 805 in FIG. 8) and an input terminal 1103 for the VALID signal indicating a valid data cycle. The writing unit 113 also has an input terminal 1104 for the operation result Q from the division ALU (ALU 806 in FIG. 8) and an input terminal 1105 for the VALID signal. Furthermore, the writing unit 113 has a data input terminal 1106 for the operation result Q from the addition ALU (ALU 807 in FIG. 8) and an input terminal 1107 for the VALID signal.

アクセラレータ103は、1サイクルの間に3つのALU805~807のうちの1つにしかリクエスト信号を出さないため、VALID信号及び演算結果QはALU805~807のうちの1つからしか戻って来ない。したがって、アクセラレータ103は、VALID信号及び演算結果QをOR回路1111,1112で受け取ることができる。また、FNOPのサイクルにはデータはないが、入力端子1108からVALID信号として受け取る。OR回路1111,1112が受け取ったデータは、FIFOバッファ1113に書き込まれる。 Since the accelerator 103 issues a request signal to only one of the three ALUs 805 to 807 during one cycle, the VALID signal and the operation result Q are returned from only one of the ALUs 805 to 807. Therefore, the accelerator 103 can receive the VALID signal and the calculation result Q at the OR circuits 1111 and 1112. Further, although there is no data in the FNOP cycle, it is received from the input terminal 1108 as a VALID signal. The data received by OR circuits 1111 and 1112 is written to FIFO buffer 1113.

FIFOバッファ1113にデータが書き込まれると、出力端子1118からデータが、出力端子1119から書き込み要求信号が、SRAMブロック104へ出力される。SRAMブロック104が書き込み要求信号を受理すると、GRANT信号の入力端子1120から入力されるGRANT信号がHighになり、FIFOバッファ1113は次の信号を出力する。FIFOバッファ1113は、中身が空になるとTMPTY信号をHighにして、動作を停止する。GRANT信号の入力端子1120から入力されるGRANT信号がHighになる度に、カウンタ1114がカウントアップするカウンタの出力は2ビットだけシフトする。カウンタ1114から出力されるカウントは、ベースアドレス入力端子1109から入力されるベースアドレスと加算されてアドレスバス端子1121へ送られ、そこからSRAMブロック104へ出力される。 When data is written to the FIFO buffer 1113, the data is output from an output terminal 1118 and a write request signal is output from an output terminal 1119 to the SRAM block 104. When the SRAM block 104 receives the write request signal, the GRANT signal input from the GRANT signal input terminal 1120 becomes High, and the FIFO buffer 1113 outputs the next signal. When the FIFO buffer 1113 becomes empty, it sets the TMPTY signal to High and stops operating. Every time the GRANT signal input from the GRANT signal input terminal 1120 becomes High, the output of the counter counted up by the counter 1114 is shifted by 2 bits. The count output from the counter 1114 is added to the base address input from the base address input terminal 1109, sent to the address bus terminal 1121, and output from there to the SRAM block 104.

図12は、アクセラレータ103が実行可能なプログラムを生成するためのコンパイラのフローチャートである。なお、図12に示す各処理に付されたS番号は工程順序を表している。なお、コンパイラ(プログラム)自体は、情報処理装置100とは異なるシステムで作成されており、コンパイルにより生成された、アクセラレータ103が実行可能なプログラムはDRAM102に格納されている。 FIG. 12 is a flowchart of a compiler for generating a program executable by the accelerator 103. Note that the S number attached to each process shown in FIG. 12 represents the process order. Note that the compiler (program) itself is created in a system different from the information processing apparatus 100, and the program generated by compilation and executable by the accelerator 103 is stored in the DRAM 102.

S1201では、ソースコードを読み込み、内部の中間データとして保持する。なお、本実施形態でのアクセラレータ103は、プログラム中に分岐命令を持たないが、簡単なループや配列を表現可能なC言語等のソース言語で動作することを想定している。 In S1201, the source code is read and held as internal intermediate data. Note that although the accelerator 103 in this embodiment does not have a branch instruction in the program, it is assumed that the accelerator 103 operates in a source language such as C language that can express simple loops and arrays.

S1202では、ループを展開し、全ての変数にシンボルを割り付ける。図13(a)は、プログラムの展開例を示しており、左式のプログラムは右式の通りに展開される。 In S1202, the loop is expanded and symbols are assigned to all variables. FIG. 13(a) shows an example of program expansion, and the program in the left formula is expanded as in the right formula.

S1203では、多項式の中間ノードに中間変数のシンボルを割り付ける。図13(b)は、多項式の分解例を示しており、左式は右式の通りに2つの式に分解することができる。 In S1203, symbols of intermediate variables are assigned to intermediate nodes of the polynomial. FIG. 13(b) shows an example of polynomial decomposition, and the left equation can be decomposed into two equations as shown in the right equation.

S1204では、代入から参照までのステップ数が第1の閾値よりも短い命令を検索し、発見することができたか否かを判定する。第1の閾値は、演算を開始してから演算結果が参照可能となるまでのサイクル数よりも大きい値である。その命令が発見されたと判定された場合(S1204でYES)、処理はS1205へ進む。 In S1204, a search is made for an instruction in which the number of steps from assignment to reference is shorter than a first threshold value, and it is determined whether or not an instruction can be found. The first threshold value is a value larger than the number of cycles from the start of the calculation until the calculation result can be referenced. If it is determined that the instruction has been found (YES in S1204), the process advances to S1205.

S1205では、代入と参照の順序が狂わないように前後の命令を入れ替えて、代入から参照までのステップ数が第1の閾値よりも長くなるように変更する。図13(c)は、プログラムでの式の並べ替えの例を説明する図であり、左式の命令列を右式のように並べ替える。 In S1205, the preceding and succeeding instructions are swapped so that the order of assignment and reference is not out of order, and the number of steps from assignment to reference is changed to be longer than the first threshold. FIG. 13(c) is a diagram illustrating an example of rearranging formulas in a program, in which the instruction sequence of the left formula is rearranged as the right formula.

S1206では、代入から参照までのステップ数が第1の閾値より短い状態が続いているか否かを判定する。代入と参照の順序が狂わないように前後の命令を入れ替えても代入から参照までのステップ数が第1の閾値よりも短い場合(第1の閾値よりも長くならない場合)(S1206でYES)、処理はS1207へ進む。 In S1206, it is determined whether the number of steps from assignment to reference continues to be shorter than the first threshold. If the number of steps from assignment to reference is shorter than the first threshold (if it does not become longer than the first threshold) even if the previous and following instructions are swapped so that the order of assignment and reference is not disrupted (YES in S1206), The process advances to S1207.

S1207では、WAIT命令(図7(c)を参照して説明したWAIT命令708)を挿入し、その後、処理をS1204へ戻す。一方、代入から参照までのステップ数が第1の閾値以上となった場合(S1204でNO)、処理はS1204へ戻される。 In S1207, a WAIT command (WAIT command 708 described with reference to FIG. 7C) is inserted, and then the process returns to S1204. On the other hand, if the number of steps from assignment to reference is equal to or greater than the first threshold (NO in S1204), the process returns to S1204.

S1204~S1206又はS1207までのループを繰り返すことにより、S1204で代入から参照までのステップ数が第1の閾値より短い命令が発見されなくなったと判定された場合(S1204でNO)、処理はS1208へ進む。 By repeating the loop from S1204 to S1206 or S1207, if it is determined in S1204 that an instruction whose number of steps from assignment to reference is shorter than the first threshold is no longer found (NO in S1204), the process advances to S1208. .

S1208では、代入から参照までのステップ数が第2の閾値よりも長い命令を検索し、発見することができたか否かを判定する。第2の閾値は、SRAMブロック104のワークエリアに格納可能なデータ数より小さい値で、本実施形態では511より小さい値である。ステップ数が第2の閾値よりも長い命令が発見された場合(S1208でYES)、処理はS1209へ進む。 In S1208, a search is made for an instruction in which the number of steps from assignment to reference is longer than the second threshold, and it is determined whether the instruction can be found. The second threshold value is a value smaller than the number of data that can be stored in the work area of the SRAM block 104, and is a value smaller than 511 in this embodiment. If an instruction with a step count longer than the second threshold is found (YES in S1208), the process advances to S1209.

S1209では、変数の生存期間を延長させる命令を挿入し、その後、処理をS1208へ戻す。S1208~S1209のループを繰り返すことで、代入から参照までのステップ数が第2の閾値よりも長い命令を発見することができなくなった場合(S1208でNO)、処理はS1210へ進む。 In S1209, an instruction to extend the lifetime of the variable is inserted, and then the process returns to S1208. By repeating the loop from S1208 to S1209, if an instruction whose number of steps from assignment to reference is longer than the second threshold cannot be found (NO in S1208), the process advances to S1210.

S1210では、アッセンブラファイルをSRAMブロック104へ出力する。生成されるアッセンブラファイルは、所定のSRAMに格納される。これにより本処理は終了する。アッセンブラは、中間変数を確保するアドレスが0x7FCに達すると0x000に戻るアクセラレータ103の構造に合わせて、アドレスを割り当てる。 In S1210, the assembler file is output to the SRAM block 104. The generated assembler file is stored in a predetermined SRAM. This ends the process. The assembler allocates addresses in accordance with the structure of the accelerator 103, where the address for securing intermediate variables returns to 0x000 when it reaches 0x7FC.

以上の通り第1実施形態によれば、アクセラレータ103を、多数のアドレスを必要とする汎用レジスタを用いずに、命令読込部110、データ読込部109及び書込部113をキューで構成すると共にALU111の稼働率を上げている。つまり、アクセラレータ103の回路規模を小さくすると共に、ALU111の稼働率を上げることを可能としている。 As described above, according to the first embodiment, the accelerator 103 is configured with the instruction reading section 110, data reading section 109, and writing section 113 as queues, without using general-purpose registers that require a large number of addresses, and the ALU 111 is increasing its utilization rate. In other words, it is possible to reduce the circuit scale of the accelerator 103 and increase the operating rate of the ALU 111.

<第2実施形態>
第1実施形態では、ゼロ(0)を加算するか又は1を乗算することにより、変数生存期間の延長命令を生成した。これに対して、第2実施形態では、加算演算を行うALUや乗算演算を行うALUを用いずに変数生存期間の延長命令を生成することにより、そのサイクルで空いたALUを別のアクセラレータで利用可能とする。
<Second embodiment>
In the first embodiment, a variable lifetime extension instruction is generated by adding zero (0) or multiplying by one. In contrast, in the second embodiment, by generating an instruction to extend the variable lifetime without using an ALU that performs an addition operation or an ALU that performs a multiplication operation, the ALU that becomes vacant in that cycle is used by another accelerator. possible.

図14(a)は、第2実施形態に係る情報処理装置の部分的なブロック図である。なお、図14(a)のブロック図では、図8のブロック図と共通する構成について図8と同じ符号を付しており、ここでは既に説明した内容の説明を省略する。 FIG. 14(a) is a partial block diagram of an information processing device according to the second embodiment. Note that in the block diagram of FIG. 14A, the same components as those in the block diagram of FIG. 8 are designated by the same reference numerals as those in FIG. 8, and a description of the contents already described will be omitted here.

図14(a)に示すように、アクセラレータ0_801、アクセラレータ1_802及びアクセラレータ2_803のそれぞれに、他のアクセラレータとは共有されないスルー用ALU1401が接続されている。図14(b)は、スルーALU1401の回路図である。スルーALU1401は、リクエスト信号(_REQ)を受けるとそのまま受理して、GRANT信号(_GRANT)を出力する。また、これと共に、遅延素子1403により遅延されたVALID信号(_VALID)と同じだけA入力(_A)を遅延素子1402により遅延させてQ出力(_Q)に出力する。3つのスルーALU1401はそれぞれ、専用ALUとなっているため、アクセラレータ0_801、アクセラレータ1_802及びアクセラレータ2_803は同時にスルー処理を実行することができる。 As shown in FIG. 14A, a through ALU 1401 that is not shared with other accelerators is connected to each of accelerator 0_801, accelerator 1_802, and accelerator 2_803. FIG. 14(b) is a circuit diagram of the through ALU 1401. When the through ALU 1401 receives a request signal (_REQ), it accepts it as is and outputs a GRANT signal (_GRANT). At the same time, the A input (_A) is delayed by the delay element 1402 by the same amount as the VALID signal (_VALID) delayed by the delay element 1403, and outputted to the Q output (_Q). Since each of the three through ALUs 1401 is a dedicated ALU, accelerator 0_801, accelerator 1_802, and accelerator 2_803 can execute through processing at the same time.

<第3実施形態>
第1実施形態では、ソース言語をアクセラレータ103で実行可能な機械語のプログラムに変換した。これに対して、第3実施形態では、中間コードを用いて、アクセラレータ103で実行可能な機械語のプログラムを生成する。
<Third embodiment>
In the first embodiment, the source language is converted into a machine language program that can be executed by the accelerator 103. In contrast, in the third embodiment, a machine language program executable by the accelerator 103 is generated using intermediate code.

図15(a)は、中間コードを生成するコンパイラのフローチャートである。図15(a)のフローチャートに示す工程のうち、図12のフローチャートにある工程と同じものについては、同じ符号を付して説明を省略する。S1201~S1203の工程を行った後のS1501では、シンボルに対してユニークな番号を割り当てて中間コードを出力する。これにより、図16に示す中間コードが生成される。 FIG. 15(a) is a flowchart of a compiler that generates intermediate code. Among the steps shown in the flowchart of FIG. 15(a), the same steps as those shown in the flowchart of FIG. 12 are given the same reference numerals and the description thereof will be omitted. In S1501 after performing steps S1201 to S1203, a unique number is assigned to a symbol and an intermediate code is output. As a result, the intermediate code shown in FIG. 16 is generated.

図16は、S1501で生成された中間コードのビットフィールドを説明する図である。ワークアドレスID1601は、変数に対して割り当てたユニークな番号を格納する16ビットのエリアである。オペコードフィールド301、ベースアドレスインデックスフィールド302及びオフセットアドレスフィールド303は、図3を参照して説明したアクセラレータ103の命令のビット構成と同じである。ワークエリア以外を示すときのアドレスは、オフセットアドレスフィールド303に書き込まれている。 FIG. 16 is a diagram illustrating the bit field of the intermediate code generated in S1501. The work address ID 1601 is a 16-bit area that stores a unique number assigned to a variable. The operation code field 301, base address index field 302, and offset address field 303 have the same bit configuration as the instruction of the accelerator 103 described with reference to FIG. Addresses indicating areas other than the work area are written in the offset address field 303.

図15(b)は、アクセラレータ103が実行するプログラムのプログラムローダーによる読み込みフローを表したフローチャートである。図15(b)のフローチャートに示す工程のうち、図12のフローチャートにある工程と同じものについては、同じ符号を付して説明を省略する。 FIG. 15B is a flowchart showing a flow of reading a program executed by the accelerator 103 by the program loader. Among the steps shown in the flowchart of FIG. 15(b), the same steps as those shown in the flowchart of FIG. 12 are given the same reference numerals and the description thereof will be omitted.

S1505では、S1501で生成した中間コードをメモリに読み込む。これに続くS1204~S1209の工程は図12を参照して説明した通りであるため、ここでの説明を省略する。 In S1505, the intermediate code generated in S1501 is read into memory. The subsequent steps S1204 to S1209 are the same as described with reference to FIG. 12, so their description will be omitted here.

S1208の判定がNOになると、S1506にて16ビットの変数を9ビットのアドレスに割り当てて変換する。9ビットのアドレスに割り当てる際に0x1FFまで来ると、次には0x000が割り当てられる。割り当てたアドレスをオフセットアドレスフィールド303に格納したら、ワークアドレスID1601の16ビットは不要となるので取り外して、実行可能な機械語に変換する。 If the determination in S1208 is NO, the 16-bit variable is assigned to a 9-bit address and converted in S1506. When assigning to a 9-bit address, when it reaches 0x1FF, 0x000 is assigned next. Once the assigned address is stored in the offset address field 303, the 16 bits of the work address ID 1601 are no longer needed, so they are removed and converted into executable machine language.

続くS1507では、S1506で変換した機械語のプログラムをSRAMブロック104の所定のSRAMに配置してアクセラレータ103を起動し、機械語のプログラムを実行する。 In subsequent S1507, the machine language program converted in S1506 is placed in a predetermined SRAM of the SRAM block 104, the accelerator 103 is activated, and the machine language program is executed.

なお、S1506では、ワークアドレスID1601の16ビットを取り外して実行可能な機械語としたが、アクセラレータが上位16ビットを事前に無視して実行するように設計されていてもよい。これにより、ワークエリアの実装を8ビットや10ビットに変更しても、図15(b)でのプログラムローダーの実装を変更するだけで、中間コードのバイナリの互換性を保証することができる。その結果、ハードウェア設計の自由度を高めることができ、スケーラビリティを確保することが可能になる。 Note that in S1506, the 16 bits of the work address ID 1601 are removed to create an executable machine language, but the accelerator may be designed to ignore the upper 16 bits in advance and execute. As a result, even if the implementation of the work area is changed to 8 bits or 10 bits, the binary compatibility of the intermediate code can be guaranteed by simply changing the implementation of the program loader in FIG. 15(b). As a result, the degree of freedom in hardware design can be increased and scalability can be ensured.

<第4実施形態>
第4実施形態では、第1実施形態に係る情報処理装置100の変形例について説明する。図17は、第4実施形態に係る情報処理装置1700の概略構成を示すブロック図である。なお、情報処理装置1700の構成要素のうち、第1実施形態に係る情報処理装置100の構成要素と同じものについては、同じ符号を付すこととする。
<Fourth embodiment>
In the fourth embodiment, a modification of the information processing apparatus 100 according to the first embodiment will be described. FIG. 17 is a block diagram showing a schematic configuration of an information processing device 1700 according to the fourth embodiment. Note that, among the components of the information processing device 1700, the same components as those of the information processing device 100 according to the first embodiment are given the same reference numerals.

情報処理装置1700は、CPU101、DRAM102及びプロセッサブロック1702を有する。プロセッサブロック1702は、アクセラレータ103、SRAMブロック104、ALU111及び内部CPU1701を有する。内部CPU1701は、アクセラレータ専用のCPUである。CPU101とプロセッサブロック1702は、アクセラレータ103内のコントロールレジスタとDRAM102の共有エリアを用いて通信する。 The information processing device 1700 includes a CPU 101, a DRAM 102, and a processor block 1702. The processor block 1702 includes an accelerator 103, an SRAM block 104, an ALU 111, and an internal CPU 1701. The internal CPU 1701 is a CPU dedicated to the accelerator. The CPU 101 and the processor block 1702 communicate using a control register in the accelerator 103 and a shared area of the DRAM 102.

情報処理装置1700では、第3実施形態で説明したプログラムローダーと命令挿入処理をプロセッサブロック1702の内部CPU1701が行う。なお、プログラムローダーの命令挿入処理の一部又は全部をハードウェア化することも可能である。その場合、少なくともプロセッサブロック1702に対して与えられるプログラムに存在しないWAIT命令や変数生存期間延長命令は、プロセッサブロック1702の内部で挿入されて実行される。 In the information processing apparatus 1700, the internal CPU 1701 of the processor block 1702 performs the program loader and instruction insertion processing described in the third embodiment. Note that it is also possible to implement part or all of the program loader's instruction insertion process in hardware. In that case, at least a WAIT instruction or a variable lifetime extension instruction that does not exist in the program given to the processor block 1702 is inserted and executed within the processor block 1702.

以上、本発明をその好適な実施形態に基づいて詳述してきたが、本発明はこれら特定の実施形態に限られるものではなく、この発明の要旨を逸脱しない範囲の様々な形態も本発明に含まれる。更に、上述した各実施形態は本発明の一実施形態を示すものにすぎず、各実施形態を適宜組み合わせることも可能である。 Although the present invention has been described above in detail based on its preferred embodiments, the present invention is not limited to these specific embodiments, and the present invention may take various forms without departing from the gist of the present invention. included. Further, each of the embodiments described above is merely one embodiment of the present invention, and each embodiment can be combined as appropriate.

例えば、上記実施形態での個々の数値、ワークエリアの参照可能項目数やALUの数、アクセラレータの数、命令のビット長等は、要求される性能に応じて変更(設計)が可能で有り、上記の設定に限定されるものではない。また、上記実施形態では、単精度浮動小数点演算を行う構成について説明したが、倍精度演算や整数演算への適用も可能であり、更にALUとして二乗や平方根等の2項演算子の追加も可能である。更に、アクセラレータが実行するプログラムを、コンパイラによりプログラムを機械語に変換することで生成しているが、プログラム設計者が直接に機械語プログラムを設計しても構わない。 For example, the individual numerical values, the number of referenceable items in the work area, the number of ALUs, the number of accelerators, the bit length of instructions, etc. in the above embodiments can be changed (designed) according to the required performance. The settings are not limited to the above settings. In addition, in the above embodiment, a configuration for performing single-precision floating-point operations was described, but it can also be applied to double-precision operations and integer operations, and it is also possible to add binary operators such as square and square root as an ALU. It is. Furthermore, although the program to be executed by the accelerator is generated by converting the program into machine language using a compiler, a program designer may directly design the machine language program.

本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。 The present invention provides a system or device with a program that implements one or more functions of the embodiments described above via a network or a storage medium, and one or more processors in a computer of the system or device reads and executes the program. This can also be achieved by processing. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.

100,1700 情報処理装置
101 CPU
102 DRAM
103 アクセラレータ
104 SRAMブロック
105 コントロールレジスタ
106 WAITアドレス
109 読込部
110 命令読込部
111 ALU
112 データ転送部
113 書込部
114 書き込みアドレス部
116 比較部
1701 内部CPU
1702 プロセッサブロック
100,1700 Information processing device 101 CPU
102 DRAM
103 Accelerator 104 SRAM block 105 Control register 106 WAIT address 109 Reading section 110 Instruction reading section 111 ALU
112 Data transfer section 113 Writing section 114 Write address section 116 Comparison section 1701 Internal CPU
1702 Processor block

Claims (14)

命令列とデータが記憶された記憶手段から、順次、命令を読み込む命令読込部と、
前記命令読込部が読み込んだ命令のアドレスフィールドに従って前記記憶手段からデータを読み込むデータ読込部と、
前記命令読込部が読み込んだ命令の種別に従って前記データ読込部が読み込んだデータを演算手段へ転送するデータ転送部と、
前記演算手段から出力される演算結果を前記記憶手段に書き込む書込部と、を備え
前記命令読込部が読み込む命令には演算結果を格納するアドレスを示すフィールドが存在せず、
前記書込部は、前記演算手段から出力された、前記命令に対応する演算結果を、順次、前記記憶手段の連続したアドレスに書き込むことを特徴とする情報処理ユニット。
an instruction reading unit that sequentially reads instructions from a storage means in which an instruction sequence and data are stored ;
a data reading section that reads data from the storage means according to the address field of the instruction read by the instruction reading section;
a data transfer unit that transfers the data read by the data reading unit to an arithmetic means according to the type of instruction read by the instruction reading unit;
a writing section for writing the calculation result output from the calculation means into the storage means ,
The instruction read by the instruction reading unit does not have a field indicating an address for storing an operation result,
The information processing unit is characterized in that the writing section sequentially writes the operation results corresponding to the instructions outputted from the operation means into consecutive addresses of the storage means.
前記命令読込部、前記データ読込部および前記書込部はそれぞれキューとして構成されていることを特徴とする請求項1に記載の情報処理ユニット。 The information processing unit according to claim 1, wherein the instruction reading section, the data reading section, and the writing section are each configured as a queue. 命令列とデータが記憶された記憶手段から、順次、命令を読み込む命令読込部と、
前記命令読込部が読み込んだ命令のアドレスフィールドに従って前記記憶手段からデータを読み込むデータ読込部と、
前記命令読込部が読み込んだ命令の種別に従って前記データ読込部が読み込んだデータを演算手段へ転送するデータ転送部と、
前記演算手段から出力される演算結果を、順次、前記記憶手段に書き込む書込部と、を備え、
前記命令読込部が読み込む命令には、前記書込部の書き込みアドレスが指定の値を通過するまで、前記記憶手段からの次のデータ読み出しを抑制する命令があることを特徴とする情報処理ユニット。
an instruction reading unit that sequentially reads instructions from a storage means in which an instruction sequence and data are stored;
a data reading section that reads data from the storage means according to the address field of the instruction read by the instruction reading section;
a data transfer unit that transfers the data read by the data reading unit to an arithmetic means according to the type of instruction read by the instruction reading unit;
a writing section that sequentially writes the calculation results output from the calculation means into the storage means,
Information processing characterized in that the instructions read by the instruction reading section include an instruction to suppress the next data read from the storage means until the write address of the writing section passes a specified value. unit.
前記命令列を含むプログラムを生成するコンパイラにより、所定の演算結果が前記記憶手段に書き込まれる前に前記所定の演算結果を参照する命令を検出した場合に、前記データ読込部への次のデータの読み込みを抑制する命令前記命令列に挿入されることを特徴とする請求項3に記載の情報処理ユニット。 When a compiler that generates a program including the instruction sequence detects an instruction that refers to the predetermined operation result before the predetermined operation result is written into the storage means, the compiler generates the program that includes the instruction sequence, and when the compiler detects an instruction that refers to the predetermined operation result before the predetermined operation result is written into the storage means, the next data is sent to the data reading section. 4. The information processing unit according to claim 3, wherein an instruction to suppress reading is inserted into the instruction string. コンパイラにより生成された命令列が記憶された記憶手段から、順次、命令を読み込む命令読込部と、
前記命令読込部が読み込んだ命令のアドレスフィールドに従って前記記憶手段からデータを読み込むデータ読込部と、
前記命令読込部が読み込んだ命令の種別に従って前記データ読込部が読み込んだデータを演算手段へ転送するデータ転送部と、
前記演算手段から出力される演算結果を、順次、前記記憶手段に書き込む書込部と、を備え、
前記コンパイラにより、前記記憶手段の所定のアドレスに書き込まれた所定の演算結果が後の演算結果によって上書きされるまでの期間を超えて前記所定の演算結果を参照する命令を検出した場合に、前記所定の演算結果を参照可能とする期間を延長する命令前記命令列に挿入されることを特徴とする情報処理ユニット。
an instruction reading unit that sequentially reads instructions from a storage means in which a sequence of instructions generated by a compiler is stored;
a data reading section that reads data from the storage means according to the address field of the instruction read by the instruction reading section;
a data transfer unit that transfers the data read by the data reading unit to an arithmetic means according to the type of instruction read by the instruction reading unit;
a writing section that sequentially writes the calculation results output from the calculation means into the storage means,
When the compiler detects an instruction that refers to the predetermined computation result written to a predetermined address of the storage means beyond a period until the predetermined computation result is overwritten by a later computation result, the An information processing unit characterized in that an instruction for extending a period during which a predetermined operation result can be referenced is inserted into the instruction sequence.
前記命令読込部、前記データ読込部および前記書込部の動作を制御する制御手段を有することを特徴とする請求項1から5のいずれか1項に記載の情報処理ユニット。 6. The information processing unit according to claim 1, further comprising control means for controlling operations of the instruction reading section, the data reading section, and the writing section. アクセラレータと、
アクセラレータの動作を制御するCPUと、
前記CPUで動作するプログラムを記憶するDRAMと、
前記アクセラレータからの命令に基づいて演算を行うALU(Alithmetic Logic Unit)と、
SRAMと、を備える情報処理装置であって、
前記アクセラレータは、
前記SRAMから、順次、命令を読み込む命令読込部と、
前記命令のアドレスフィールドに従って前記SRAMからデータを読み込むデータ読込部と、
前記命令読込部が読み込んだ命令の種別に従って前記データ読込部が読み込んだデータを前記ALUへ転送するデータ転送部と、
前記ALUから出力される演算結果を前SRAMに書き込む書込部と、を有し、
前記命令読込部が読み込む命令には、演算結果を格納するアドレスを示すフィールドが存在せず、
前記書込部は、前記ALUから出力される、前記命令に対応した演算結果を、順次、前記SRAMの連続したアドレスに書き込むことを特徴とする情報処理装置。
Accelerator and
a CPU that controls the operation of the accelerator ;
a DRAM that stores a program that runs on the CPU;
an ALU (Alithmetic Logic Unit) that performs calculations based on instructions from the accelerator ;
An information processing device comprising an SRAM ,
The accelerator is
an instruction reading unit that sequentially reads instructions from the SRAM ;
a data reading unit that reads data from the SRAM according to the address field of the instruction;
a data transfer unit that transfers the data read by the data reading unit to the ALU according to the type of instruction read by the instruction reading unit;
a writing unit that writes the calculation result output from the ALU to the SRAM ,
The instruction read by the instruction reading unit does not have a field indicating an address for storing an operation result,
The information processing device is characterized in that the writing unit sequentially writes operation results corresponding to the instructions output from the ALU to consecutive addresses of the SRAM.
前記命令読込部、前記データ読込部および前記書込部はそれぞれキューとして構成されていることを特徴とする請求項7に記載の情報処理装置。 8. The information processing apparatus according to claim 7, wherein the instruction reading section, the data reading section, and the writing section are each configured as a queue. 前記ALUは、浮動小数点の演算を行うことを特徴とする請求項7又は8に記載の情報処理装置。9. The information processing apparatus according to claim 7, wherein the ALU performs floating point calculations. 命令列とデータが記憶された記憶手段から、順次、命令を読み込むステップと、
読み込まれた前記命令のアドレスフィールドに従って前記記憶手段からデータを読み込むステップと、
前記命令の種別に従って、読み込まれた前記データを読み込まれた順に演算手段へ転送するステップと、
前記演算手段から出力される演算結果を前記記憶手段に書き込むステップと、
を有し、
前記命令を読み込むステップにおいて読み込まれる命令には、演算結果を格納するアドレスを示すフィールドが存在せず、
前記演算結果を書き込むステップでは、前記演算手段から出力される、前記命令に対応した演算結果が、順次、前記記憶手段の連続したアドレスに書き込まれることを特徴とする情報処理方法。
sequentially reading instructions from a storage means in which the instruction sequence and data are stored ;
reading data from the storage means according to the address field of the read instruction;
a step of transferring the read data to an arithmetic means in the order in which it was read according to the type of the instruction;
writing the calculation result output from the calculation means into the storage means;
has
The instruction read in the step of reading the instruction does not have a field indicating an address for storing the operation result,
An information processing method characterized in that, in the step of writing the operation results, the operation results corresponding to the instructions outputted from the operation means are sequentially written to consecutive addresses of the storage means.
命令列とデータが記憶された記憶手段から、順次、命令を読み込むステップと、
読み込まれた前記命令のアドレスフィールドに従って前記記憶手段からデータを読み込むステップと、
前記命令の種別に従って、読み込まれた前記データを読み込まれた順に演算手段へ転送するステップと、
前記演算手段から出力される演算結果を、順次、前記記憶手段に書き込むステップと、を有し、
前記記憶手段に前記演算結果を書き込むための書き込みアドレスが指定の値を通過するまで次のデータ読み出しを抑制する命令が前記命令列に挿入されていることを特徴とする情報処理方法。
sequentially reading instructions from a storage means in which the instruction sequence and data are stored;
reading data from the storage means according to the address field of the read instruction;
a step of transferring the read data to an arithmetic means in the order in which it was read according to the type of the instruction;
the step of sequentially writing the calculation results output from the calculation means into the storage means,
An information processing method characterized in that an instruction is inserted into the instruction sequence to suppress the next data read until a write address for writing the operation result in the storage means passes a specified value.
前記データの読み込みを抑制する命令は、所定の演算結果が前記記憶手段に書き込まれる前に当該所定の演算結果を参照する命令を検出した場合に、前記命令列に挿入されることを特徴とする請求項11に記載の情報処理方法。 The instruction to suppress reading of data is inserted into the instruction string when an instruction that refers to a predetermined operation result is detected before the predetermined operation result is written to the storage means. The information processing method according to claim 11 . コンパイラにより生成された命令列が記憶された記憶手段から、順次、命令を読み込むステップと、
読み込まれた前記命令のアドレスフィールドに従って前記記憶手段からデータを読み込むステップと、
前記命令の種別に従って、読み込まれた前記データを読み込まれた順に演算手段へ転送するステップと、
前記演算手段から出力される演算結果を、順次、前記記憶手段に書き込むステップと、を有し、
前記コンパイラにより、前記記憶手段の所定のアドレスに記憶された所定の演算結果が後の演算結果によって上書きされるまでの期間を超えて前記所定の演算結果を参照する命令を検出した場合に、前記所定の演算結果を参照可能とする期間を延長する命令が前記命令列に挿入されることを特徴とする情報処理方法。
sequentially reading instructions from a storage means in which a sequence of instructions generated by a compiler is stored;
reading data from the storage means according to the address field of the read instruction;
a step of transferring the read data to an arithmetic means in the order in which it was read according to the type of the instruction;
the step of sequentially writing the calculation results output from the calculation means into the storage means,
When the compiler detects an instruction that refers to the predetermined computation result stored at a predetermined address of the storage means beyond a period until the predetermined computation result is overwritten by a later computation result, the An information processing method characterized in that an instruction for extending a period during which a predetermined operation result can be referenced is inserted into the instruction sequence .
請求項10から13のいずれか1項に記載の情報処理方法の各ステップをコンピュータに実行させることを特徴とするプログラム。 A program for causing a computer to execute each step of the information processing method according to claim 10 .
JP2019076481A 2019-04-12 2019-04-12 Information processing unit, information processing device, information processing method and program Active JP7383390B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019076481A JP7383390B2 (en) 2019-04-12 2019-04-12 Information processing unit, information processing device, information processing method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019076481A JP7383390B2 (en) 2019-04-12 2019-04-12 Information processing unit, information processing device, information processing method and program

Publications (2)

Publication Number Publication Date
JP2020173717A JP2020173717A (en) 2020-10-22
JP7383390B2 true JP7383390B2 (en) 2023-11-20

Family

ID=72831514

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019076481A Active JP7383390B2 (en) 2019-04-12 2019-04-12 Information processing unit, information processing device, information processing method and program

Country Status (1)

Country Link
JP (1) JP7383390B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112506567B (en) * 2020-11-27 2022-11-04 海光信息技术股份有限公司 Data reading method and data reading circuit

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004246449A (en) 2003-02-12 2004-09-02 Japan Science & Technology Agency Queue processor
JP2006139766A (en) 2004-10-12 2006-06-01 Nec Electronics Corp Information processor
WO2013080289A1 (en) 2011-11-28 2013-06-06 富士通株式会社 Signal processing device and signal processing method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61134863A (en) * 1984-12-04 1986-06-21 Mitsubishi Electric Corp Data processor

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004246449A (en) 2003-02-12 2004-09-02 Japan Science & Technology Agency Queue processor
JP2006139766A (en) 2004-10-12 2006-06-01 Nec Electronics Corp Information processor
WO2013080289A1 (en) 2011-11-28 2013-06-06 富士通株式会社 Signal processing device and signal processing method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
James E. Smith,Decoupled access/execute computer architectures,ACM SIGARCH Computer Architecture News,米国,ACM,1982年04月01日,Volume 10,Issue 3,pp 112-119,[令和5年4月21日検索],インターネット<URL:https://doi.org/10.1145/1067649.801719>
野本 裕輔 他,FIFOを用いて実現するアレイプロセッサのための効率的なデータ入出力機構の提案,電子情報通信学会技術研究報告,社団法人電子情報通信学会,2008年01月10日,第107巻 第419号,第37頁-第42頁

Also Published As

Publication number Publication date
JP2020173717A (en) 2020-10-22

Similar Documents

Publication Publication Date Title
JP2021174506A (en) Microprocessor with pipeline control for executing instruction in preset future time
JP3555140B2 (en) Semiconductor floorplan and method for register rename circuit
JP3547139B2 (en) Processor
JP4130654B2 (en) Method and apparatus for adding advanced instructions in an extensible processor architecture
US6826677B2 (en) Renaming registers to values produced by instructions according to assigned produce sequence number
US8122078B2 (en) Processor with enhanced combined-arithmetic capability
JP2002024011A (en) Described execution of instruction in processor
JP2021507348A (en) Addition instruction with vector carry
US20140047218A1 (en) Multi-stage register renaming using dependency removal
US7512771B2 (en) Mapping circuitry and method comprising first and second candidate output value producing units, an in-range value determining unit, and an output value selection unit
CN110073332B (en) Data processing apparatus and method
CN108319559B (en) Data processing apparatus and method for controlling vector memory access
US6550000B1 (en) Processor to execute in parallel plurality of instructions using plurality of functional units, and instruction allocation controller
GB2394085A (en) Generating code for a configurable microprocessor
US6516462B1 (en) Cache miss saving for speculation load operation
JP7383390B2 (en) Information processing unit, information processing device, information processing method and program
US20030154469A1 (en) Apparatus and method for improved execution of a software pipeline loop procedure in a digital signal processor
CN101292225A (en) Lock-free scheduling of blocks to reduce loops in parallel programs
JP2013140472A (en) Vector processor
JP6020428B2 (en) Vector register renaming control method, vector processor, and vector register renaming control method
CN119025123A (en) Compilation optimization method, device, compiler, compilation equipment, medium and program
JP2002251282A (en) Handling of loops in processors
US11366664B1 (en) Single instruction multiple data (simd) execution with variable width registers
Rohde et al. Improving HLS generated accelerators through relaxed memory access scheduling
JP7835027B2 (en) Vector instruction processing method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20220407

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20230320

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20230509

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230706

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20231108

R151 Written notification of patent or utility model registration

Ref document number: 7383390

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151