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
JP6123510B2 - Semiconductor device and method for controlling semiconductor device - Google Patents
[go: Go Back, main page]

JP6123510B2 - Semiconductor device and method for controlling semiconductor device - Google Patents

Semiconductor device and method for controlling semiconductor device Download PDF

Info

Publication number
JP6123510B2
JP6123510B2 JP2013124053A JP2013124053A JP6123510B2 JP 6123510 B2 JP6123510 B2 JP 6123510B2 JP 2013124053 A JP2013124053 A JP 2013124053A JP 2013124053 A JP2013124053 A JP 2013124053A JP 6123510 B2 JP6123510 B2 JP 6123510B2
Authority
JP
Japan
Prior art keywords
bank
data
index
array
access instruction
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
JP2013124053A
Other languages
Japanese (ja)
Other versions
JP2014241107A (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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2013124053A priority Critical patent/JP6123510B2/en
Publication of JP2014241107A publication Critical patent/JP2014241107A/en
Application granted granted Critical
Publication of JP6123510B2 publication Critical patent/JP6123510B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、半導体装置及び半導体装置の制御方法に関する。   The present invention relates to a semiconductor device and a method for controlling the semiconductor device.

プロセッサのデータメモリの実装方法の1つに、バンクインターリーブ方式がある。バンクインターリーブ方式では、一般には2の累乗個の複数のバンク(メモリバンク)に対応するデータメモリがプロセッサに接続される。バンクインターリーブ方式において、アドレスは、図8(A)に示すように各バンクの深さ方向に連続するように割り振るのではなく、図8(B)に示すようにバンクをまたいで横方向に連続するように割り振る。バンクインターリーブ方式では、例えば、アドレスの下位ビット(4バンクであれば下位2ビット、8バンクであれば下位3ビット)で、アドレスに対応するバンクが一意に決まる。   One method for mounting a processor data memory is a bank interleave method. In the bank interleaving method, generally, data memories corresponding to a plurality of power banks of 2 (memory banks) are connected to a processor. In the bank interleave method, addresses are not allocated so as to be continuous in the depth direction of each bank as shown in FIG. 8 (A), but are continuous in the horizontal direction across banks as shown in FIG. 8 (B). Allocate to In the bank interleaving method, for example, the bank corresponding to the address is uniquely determined by the lower bits of the address (lower 2 bits for 4 banks and lower 3 bits for 8 banks).

図8(A)及び図8(B)は、データメモリの実装方法の例を示す図である。図8(A)及び図8(B)には、4つのバンクを有する例を示しており、810はプロセッサであり、820−pはデータメモリ(バンクp)(p=0、1、2、3)である。プロセッサ810は、データメモリ(バンクp)820−pとの間でデータを入出力するためのレジスタ等を含むインタフェース811−pを、データメモリ(バンクp)820−pの各々に対応して有しており、データメモリ(バンクp)820−p毎に独立してアクセスすることが可能である。   FIG. 8A and FIG. 8B are diagrams illustrating an example of a data memory mounting method. 8A and 8B show an example having four banks, 810 is a processor, 820-p is a data memory (bank p) (p = 0, 1, 2,. 3). The processor 810 has interfaces 811-p including registers for inputting / outputting data to / from the data memory (bank p) 820-p corresponding to each of the data memories (bank p) 820-p. The data memory (bank p) 820-p can be accessed independently.

バンクインターリーブ方式は、配列等の連続に並んだデータに順にアクセスする連続アクセス(シーケンシャルアクセス)が速いという利点がある。例えば、図8(C)に示すように、連続したアドレスの領域に記憶された配列dataのデータ(要素)を、data[0]、data[1]、data[2]、・・・、data[15]というように順に読み出して加算し、総和sumを求める処理を行うとする。   The bank interleave method has an advantage that continuous access (sequential access) for sequentially accessing data arranged in a row such as an array is fast. For example, as shown in FIG. 8C, the data (elements) of the array data stored in the continuous address area are represented by data [0], data [1], data [2],. [15] Assume that a process for obtaining the sum sum is performed by sequentially reading and adding.

図8(A)に示したデータメモリの実装方式では、例えばdata[0]とdata[1]とは同じデータメモリ(バンク0)820−0上に存在しているため、同時に読み出すことができない。つまり、図8(A)に示したデータメモリの実装方式では、図8(C)に示した処理のほとんどで1サイクルに1つのデータを読み出すことしかできないため、data[0]〜data[15]のすべての読み出しに13サイクルを要する。   In the data memory mounting method shown in FIG. 8A, for example, data [0] and data [1] are present on the same data memory (bank 0) 820-0 and cannot be read simultaneously. . That is, in the data memory mounting method shown in FIG. 8A, only one data can be read out in one cycle in most of the processes shown in FIG. 8C, so data [0] to data [15 ] Takes 13 cycles to read all the data.

それに対して、図8(B)に示したバンクインターリーブ方式では、例えばdata[0]、data[1]、data[2]、及びdata[3]は、異なるデータメモリ(バンクp)820−p上に存在しているため、同時に読み出すことができる。つまり、図8(B)に示したバンクインターリーブ方式では、図8(C)に示した処理を行う際に1サイクルに4つのデータを読み出すことが可能であるため、data[0]〜data[15]のすべての読み出しに4サイクルしか要しない。   On the other hand, in the bank interleave method shown in FIG. 8B, for example, data [0], data [1], data [2], and data [3] are different data memories (bank p) 820-p. Since they exist above, they can be read simultaneously. That is, in the bank interleaving method illustrated in FIG. 8B, four data can be read in one cycle when performing the processing illustrated in FIG. 8C, and thus data [0] to data [ 15] requires only 4 cycles to read all.

また、例えば配列のデータを順に書き込むシーケンシャルアクセスにおいても、図8(A)に示した実装方式では1サイクルに1つのデータを書き込むことしかできない。それに対して、図8(B)に示したバンクインターリーブ方式では、1サイクルに4つのデータを書き込むことが可能である。   For example, in sequential access in which array data is sequentially written, the mounting method shown in FIG. 8A can only write one data per cycle. On the other hand, in the bank interleave method shown in FIG. 8B, four data can be written in one cycle.

複数のプロセッサと共有メモリとを有し、メモリへのアクセス命令におけるアクセスアドレスを基に、そのアクセス命令を行うプロセッサがアクセスするメモリ領域を、アクセスアドレスに局所性がある場合にはスタック式に割り当て、アクセスアドレスに局所性がない場合にはインターリーブ式に割り当てるようにした装置が提案されている(例えば、特許文献1参照)。また、インターリーブされたアドレスを備えたメモリのバンクを複数有するマルチバンクメモリ型のメモリシステムが提案されている(例えば、特許文献2、3参照)。メモリシステムにおける並行性を向上させるために、複数のメモリアクセス要求を再順序付けする技術が提案されている(例えば、特許文献3参照)。   Based on the access address in the memory access instruction, the memory area accessed by the processor that performs the access instruction is allocated in a stack type when the access address has locality. A device has been proposed in which the access address is assigned in an interleaved manner when there is no locality (see, for example, Patent Document 1). In addition, a multi-bank memory type memory system having a plurality of memory banks having interleaved addresses has been proposed (see, for example, Patent Documents 2 and 3). In order to improve concurrency in a memory system, a technique for reordering a plurality of memory access requests has been proposed (see, for example, Patent Document 3).

特開2008−234156号公報JP 2008-234156 A 特表2003−520368号公報Special table 2003-520368 gazette 特開平10−228417号公報Japanese Patent Laid-Open No. 10-228417

前述したようにバンクインターリーブ方式は、配列のデータに順にアクセスするシーケンシャルアクセスが速いという利点がある。しかし、アプリケーションによっては、配列に対して、シーケンシャルアクセスだけでなく、連続しない順序でアクセスすることもある。例えば、無線通信の信号処理アプリケーションや暗号化アプリケーションでは、シーケンシャルアクセスだけでなく、特殊な順序のアクセスパターンでアクセスすることがある。シーケンシャルアクセスではない特殊な順序でのアクセスでは、バンクインターリーブ方式の利点が活かせないことがあり、1サイクルあたり1つのデータしかデータメモリに対する読み出しや書き込みが行えなくなってしまうことも考えられる。   As described above, the bank interleave method has an advantage that sequential access for sequentially accessing data in an array is fast. However, depending on the application, not only the sequential access but also the sequence may be accessed in a non-consecutive order. For example, in a signal processing application or an encryption application for wireless communication, access may be performed not only with sequential access but also with a special order access pattern. In access in a special order other than sequential access, the advantage of the bank interleave method may not be utilized, and it may be possible that only one data can be read from or written to the data memory per cycle.

本発明は、配列に対するアクセスパターンに応じて、データメモリにおける配列のデータのバンク配置を制御できるようにすることを目的とする。   An object of the present invention is to make it possible to control the bank arrangement of data in an array in a data memory in accordance with an access pattern for the array.

半導体装置の一態様は、複数のバンクを有するデータメモリと、データメモリへのアクセス命令に応じてアクセスを行うプロセッサとを有する。プロセッサは、入力されたアクセス命令が、配列のデータを配置するデータメモリのバンクの振り分けを指定する指定情報を含むアクセス命令である場合には、指定情報により指定されるバンクの振り分けに応じて、アクセス命令がアクセスするデータを配置するバンクに対応するインデックスを変換し、変換したインデックスに従ってバンクの選択を行い、配列に係るデータメモリへのアクセスを行う。 One embodiment of a semiconductor device includes a data memory having a plurality of banks and a processor that performs access according to an access command to the data memory. In the case where the input access instruction is an access instruction including designation information for designating the allocation of the bank of the data memory in which the array data is arranged, according to the bank allocation specified by the designation information , The index corresponding to the bank in which the data to be accessed by the access instruction is arranged is converted, the bank is selected according to the converted index , and the data memory related to the array is accessed.

開示の半導体装置は、指定されるバンクの振り分けに従って配列のデータを配置するバンクの選択を行うことで、配列に対するアクセスパターンに応じた配列のデータのバンク配置が可能になり、アプリケーションを修正することなく適切なメモリアクセスが実現でき、性能向上を図ることができる。   The disclosed semiconductor device enables bank arrangement of array data according to the access pattern for the array by modifying the application by selecting the bank in which the array data is arranged according to the specified bank allocation. Therefore, appropriate memory access can be realized, and performance can be improved.

本発明の実施形態における半導体装置の構成例を示す概略図である。It is the schematic which shows the structural example of the semiconductor device in embodiment of this invention. 本実施形態におけるメモリマップの例を示す図である。It is a figure which shows the example of the memory map in this embodiment. 本実施形態における半導体装置の構成例を示す図である。It is a figure which shows the structural example of the semiconductor device in this embodiment. 本実施形態におけるインデックス変換器の構成例を示す図である。It is a figure which shows the structural example of the index converter in this embodiment. 本実施形態におけるセレクタ設定表の例を示す図である。It is a figure which shows the example of the selector setting table | surface in this embodiment. 本実施形態におけるソースコード及びアクセス命令の一例を示す図である。It is a figure which shows an example of the source code and access instruction in this embodiment. 本実施形態におけるメモリアクセスの例を示す図である。It is a figure which shows the example of the memory access in this embodiment. データメモリの実装方法を説明するための図である。It is a figure for demonstrating the mounting method of a data memory.

以下、本発明の実施形態を図面に基づいて説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

図1は、本発明の一実施形態における半導体装置の構成例を示す概略図である。本実施形態における半導体装置は、プロセッサ10及びデータメモリ(バンクp)20−pを有する。なお、pは添え字であり、p=0、1、2、3である(以下についても同様)。図1には、4つのバンクを有する例を示しているが、バンクの数は複数であれば任意であり、2の累乗個であることが好ましい。   FIG. 1 is a schematic diagram illustrating a configuration example of a semiconductor device according to an embodiment of the present invention. The semiconductor device in the present embodiment includes a processor 10 and a data memory (bank p) 20-p. Note that p is a subscript, and p = 0, 1, 2, and 3 (the same applies to the following). Although FIG. 1 shows an example having four banks, the number of banks is arbitrary as long as it is plural, and is preferably a power of two.

プロセッサ10は、データメモリ(バンクp)20−pの各々に対応して、データメモリ(バンクp)20−pとの間でデータを入出力するためのインタフェース11−pを有する。プロセッサ10は、各インタフェース11−pにより、データメモリ(バンクp)20−p毎に独立してアクセスすることが可能である。インタフェース11−pは、データメモリ(バンクp)20−pに対する入出力データを保持するレジスタ等を有する。   The processor 10 has an interface 11-p for inputting / outputting data to / from the data memory (bank p) 20-p, corresponding to each of the data memories (bank p) 20-p. The processor 10 can access each data memory (bank p) 20-p independently by each interface 11-p. The interface 11-p includes a register that holds input / output data for the data memory (bank p) 20-p.

本実施形態における半導体装置は、配列に対するデータメモリのバンクの割り振り、すなわちデータメモリにおいて配列のデータ(要素)をどのバンクに配置するかを制御可能である。例えば、データに特殊な順序でアクセスを行いたい配列は、図2の領域201に示すように、ユーザが指定するバンクパターンで配列のデータを各バンクに配置する。また、例えば、データに順にアクセスするシーケンシャルアクセスを行いたい配列は、図2の領域202に示すように、通常のバンクパターンで配列のデータを各バンクに配置する。ここで、通常のバンクパターンとは、アドレス(配列のインデックス)の下位ビットの値によりバンクが一意に決定するバンクインターリーブ方式のバンクパターンであり、例えば図8(B)に示したような配置となる一定の規則を有するパターンである。   The semiconductor device according to the present embodiment can control the allocation of the banks of the data memory to the arrays, that is, which bank the array data (elements) is arranged in the data memory. For example, for an array in which data is to be accessed in a special order, the array data is arranged in each bank in a bank pattern designated by the user, as shown in an area 201 in FIG. Further, for example, in an array in which sequential access for sequentially accessing data is performed, the array data is arranged in each bank in a normal bank pattern as shown in an area 202 in FIG. Here, the normal bank pattern is a bank interleave type bank pattern in which the bank is uniquely determined by the value of the lower bits of the address (array index). For example, the bank pattern is arranged as shown in FIG. A pattern having a certain rule.

図2は、本実施形態におけるメモリマップの例を示す図である。図2において、塗りつぶしのパターンが、データメモリにおけるバンクの違いを示している。例えば、右下がり斜線と左下がり斜線とが交差しているブロックがデータメモリのバンク0に対応し、ドット塗りつぶしのブロックがデータメモリのバンク1に対応し、右下がり斜線のブロックがデータメモリのバンク2に対応し、左下がり斜線のブロックがデータメモリのバンク3に対応する。図2に示す例では、領域201では、アドレス方向に対して任意にバンクが割り当てられ、領域202では、アドレス方向に対して順に(規則的に)バンクが割り当てられている。   FIG. 2 is a diagram illustrating an example of a memory map in the present embodiment. In FIG. 2, the fill pattern indicates the bank difference in the data memory. For example, a block in which a right-down diagonal line and a left-down diagonal line intersect corresponds to bank 0 of the data memory, a dot-filled block corresponds to bank 1 of the data memory, and a block of right lower diagonal line corresponds to the bank of the data memory 2 corresponds to bank 3 of the data memory. In the example shown in FIG. 2, in the area 201, banks are arbitrarily assigned in the address direction, and in the area 202, banks are assigned in order (regularly) in the address direction.

また、図2において、BAD1は領域201のベースアドレスであり、BAD2は領域202のベースアドレスである。なお、ユーザが指定するバンクパターンで配列のデータを配置する場合でも、その領域のサイズは、通常のバンクパターンで配置する際の領域のサイズと同じである。すなわち、配列のデータを配置する領域は、配列のデータを格納するのに過不足のないサイズの領域である。   In FIG. 2, BAD 1 is the base address of the area 201, and BAD 2 is the base address of the area 202. Even when the array data is arranged in the bank pattern designated by the user, the size of the area is the same as the area size in the arrangement with the normal bank pattern. In other words, the area in which the array data is arranged is an area having a size that is sufficient for storing the array data.

このように本実施形態では、配列のデータ(要素)のデータメモリにおけるバンク配置をユーザ指定可能にして制御することで、配列に対するアプリケーションのデータアクセスパターンに応じた配列のデータの配置が可能になる。したがって、特殊な順序で配列のデータにアクセスするアプリケーションであっても、アプリケーションを修正(変更)することなく、アプリケーションに応じたデータ配置を行うことで適切なメモリアクセスを実現することができ、性能向上を図ることができる。   As described above, in the present embodiment, by controlling the bank arrangement in the data memory of the array data (elements) in a user-designable manner, the arrangement of the array data according to the data access pattern of the application with respect to the array becomes possible. . Therefore, even for applications that access array data in a special order, appropriate memory access can be achieved by arranging data according to the application without modifying (changing) the application. Improvements can be made.

図3は、本実施形態における半導体装置の構成例を示す図である。図3において、図1に示した構成要素と同一の構成要素には同一の符号を付している。なお、図3には、本実施形態の半導体装置におけるデータメモリへのアクセス制御に係る構成を示したが、プロセッサ10は、データメモリに対するデータ入出力に係る構成や、一般的なプロセッサが有する、図示しない演算処理等の他の処理に係る構成も有している。   FIG. 3 is a diagram illustrating a configuration example of the semiconductor device according to the present embodiment. 3, the same components as those shown in FIG. 1 are denoted by the same reference numerals. FIG. 3 shows the configuration related to access control to the data memory in the semiconductor device of the present embodiment, but the processor 10 has a configuration related to data input / output to the data memory and a general processor. It also has a configuration related to other processing such as arithmetic processing (not shown).

プロセッサ10は、命令制御部12、インデックス変換器13、セレクタ14、加算器15、アドレス保持部16、及びバンク選択用デコーダ17を有する。命令制御部12は、図示しない命令メモリから読み出された命令insが入力され、命令insをデコードして、デコード結果に応じた処理を行う。例えば、命令制御部12は、命令insがデータメモリ(バンクp)20−pへのアクセス命令である場合には、データメモリ(バンクp)20−pに対するアクセスを行う。   The processor 10 includes an instruction control unit 12, an index converter 13, a selector 14, an adder 15, an address holding unit 16, and a bank selection decoder 17. The instruction control unit 12 receives an instruction ins read from an instruction memory (not shown), decodes the instruction ins, and performs processing according to the decoding result. For example, when the instruction ins is an access instruction to the data memory (bank p) 20-p, the instruction control unit 12 accesses the data memory (bank p) 20-p.

命令制御部12は、命令insが配列に係るデータメモリ(バンクp)20−pへのアクセス命令である場合には、アクセス命令で指定されたベースアドレスbase及びインデックスindex1を出力する。ここで、アクセス命令で指定されるベースアドレスは、アクセスする配列に係るメモリ領域のベースアドレスであり、アクセス命令で指定されるインデックスは、アクセスする配列のデータを識別するためのインデックスである。   If the instruction ins is an access instruction to the data memory (bank p) 20-p related to the array, the instruction control unit 12 outputs the base address base and the index index1 specified by the access instruction. Here, the base address specified by the access instruction is the base address of the memory area related to the array to be accessed, and the index specified by the access instruction is an index for identifying the data of the array to be accessed.

また、命令制御部12は、命令insが配列に係るデータメモリ(バンクp)20−pへのアクセス命令であり、さらに配列のデータのデータメモリにおけるバンクの振り分け(バンク配置)を示すバンクパターンを指定する指定情報を含むアクセス命令である場合には、その指定情報bankptを出力する。また、命令制御部12は、命令insがバンクの振り分けを指定するバンクパターンの指定情報を含むアクセス命令であるか否かを示す信号S1を出力する。   Further, the instruction control unit 12 is an instruction to access the data memory (bank p) 20-p in which the instruction ins is an array, and further displays a bank pattern indicating bank allocation (bank arrangement) in the data memory of the array data. When the access instruction includes the designation information to be designated, the designation information bankpt is output. The instruction control unit 12 outputs a signal S1 indicating whether or not the instruction ins is an access instruction including bank pattern designation information for designating bank allocation.

インデックス変換器13は、命令制御部12から出力されたインデックスindex1及びバンクパターンの指定情報bankptが入力され、インデックスindex2を出力する。インデックス変換器13は、指定情報bankptにより指定されるバンクの振り分け(バンクパターン)に基づいて、入力されるインデックスindex1をインデックスindex2に変換して出力する。   The index converter 13 receives the index index1 output from the instruction control unit 12 and the bank pattern designation information bankpt, and outputs the index index2. The index converter 13 converts the input index index1 into the index index2 based on the bank assignment (bank pattern) specified by the specification information bankpt and outputs the index.

セレクタ14は、命令制御部12から出力された信号S1に基づいて、命令制御部12から出力されたインデックスindex1又はインデックス変換器13から出力されたインデックスindex2の一方を選択してインデックスindex3として出力する。セレクタ14は、命令insがバンクパターンの指定情報を含むアクセス命令であることを信号S1が示した場合には、インデックスindexをインデックスindex3として出力する。一方、セレクタ14は、命令insがバンクパターンの指定情報を含むアクセス命令ではないことを信号S1が示した場合には、インデックスindexをインデックスindex3として出力する。 Based on the signal S1 output from the instruction control unit 12, the selector 14 selects one of the index index1 output from the instruction control unit 12 or the index index2 output from the index converter 13 and outputs it as an index index3. . When the signal S1 indicates that the instruction ins is an access instruction including bank pattern designation information, the selector 14 outputs the index index 2 as the index index3. On the other hand, when the signal S1 indicates that the instruction ins is not an access instruction including bank pattern designation information, the selector 14 outputs the index index 1 as the index index3.

加算器15は、命令制御部12から出力されたベースアドレスbaseに、セレクタ14から出力されたインデックスindex3を加算して、データメモリ(バンクp)20−pにアクセスするためのメモリアドレスを生成する。加算器15により生成されたメモリアドレスは、アドレス保持部16に保持される。バンク選択用デコーダ17は、アドレス保持部16に保持されたメモリアドレスをデコードし、デコード結果に基づいてバンクを選択してアクセスを行う。すなわち、バンク選択用デコーダ17は、セレクタ14から出力されたインデックスindex3に応じたバンクの選択を行う。   The adder 15 adds the index index3 output from the selector 14 to the base address base output from the instruction control unit 12, and generates a memory address for accessing the data memory (bank p) 20-p. . The memory address generated by the adder 15 is held in the address holding unit 16. The bank selection decoder 17 decodes the memory address held in the address holding unit 16, selects a bank based on the decoding result, and performs access. That is, the bank selection decoder 17 selects a bank according to the index index 3 output from the selector 14.

データメモリ(バンクp)20−pには、例えば、配列datAのデータdatA[0]〜datA[31]を、図5に例示するセレクタ設定表での設定0のバンクパターンのテーブルに従ったバンク配置で配置する場合、領域21に示すように配置される。図5に例示するセレクタ設定表については、後述する。また、例えば、配列datBのデータdatB[0]〜datB[31]を、通常のバンクパターンに応じたバンク配置で配置する場合、領域22に示すように配置される。   In the data memory (bank p) 20-p, for example, the data datA [0] to datA [31] of the array datA are stored in the bank according to the bank pattern table of setting 0 in the selector setting table illustrated in FIG. When arranged by arrangement, the arrangement is performed as shown in the region 21. The selector setting table illustrated in FIG. 5 will be described later. Further, for example, when the data datB [0] to datB [31] of the array datB are arranged in a bank arrangement according to a normal bank pattern, they are arranged as shown in the region 22.

図4は、インデックス変換器13の構成例を示す図である。インデックス変換器13は、図4に示すように、セレクタ31、セレクタ設定表32、及びレジスタ33、34を有する。レジスタ33は、入力されるインデックスindex1を保持するレジスタであり、レジスタ34は、セレクタ31の出力であるインデックスindex2を保持するレジスタである。なお、図4においては、インデックスindex1、index2が6ビットである場合を一例として示しているが、インデックスindex1、index2のビット数は、これに限定されるものではない。   FIG. 4 is a diagram illustrating a configuration example of the index converter 13. As shown in FIG. 4, the index converter 13 includes a selector 31, a selector setting table 32, and registers 33 and 34. The register 33 is a register that holds an input index index 1, and the register 34 is a register that holds an index index 2 that is an output of the selector 31. FIG. 4 shows an example in which the indexes index1 and index2 are 6 bits, but the number of bits of the indexes index1 and index2 is not limited to this.

セレクタ31は、セレクタ設定表32が有するテーブルの内からバンクパターンの指定情報bankptに応じて選択されたバンクパターンのテーブルを参照して、インデックスindex1をインデックスindex2に変換し出力する。セレクタ設定表32は、図5に一例を示すような、配列のインデックスと配列のデータを配置するバンクとの対応関係(バンクパターン)を示すテーブルを有し、バンクパターンの指定情報bankptに応じて1つのテーブルが選択される。   The selector 31 refers to the bank pattern table selected according to the bank pattern designation information bankpt from the table of the selector setting table 32, converts the index index1 into the index index2, and outputs the index. The selector setting table 32 has a table indicating the correspondence (bank pattern) between the array index and the bank in which the array data is arranged, as shown in FIG. 5 according to the bank pattern designation information bankpt. One table is selected.

図5は、セレクタ設定表32の例を示す図である。セレクタ設定表は、配列のインデックスに対して、配列のデータを配置するバンクを振り分けるテーブルを有している。バンクパターンの指定情報bankptに応じて1つのテーブルが選択され、インデックスに応じた配列のデータが、選択されたテーブルにより指定されたバンクに配置される。図5においては、ハードウェア(HW)により固定の値が設定されている設定0及び設定1のテーブルと、ソフトウェア(SW)により任意の値を設定可能な設定2のテーブルを有する例を示している。   FIG. 5 is a diagram illustrating an example of the selector setting table 32. The selector setting table has a table for allocating banks in which array data is arranged with respect to the array index. One table is selected according to the bank pattern designation information bankpt, and data in an array corresponding to the index is arranged in the bank designated by the selected table. FIG. 5 shows an example having a table of setting 0 and setting 1 in which fixed values are set by hardware (HW) and a table of setting 2 in which arbitrary values can be set by software (SW). Yes.

ここで、セレクタ設定表は、すべてのテーブルをハードウェアで実現しても良いし、すべてのテーブルをソフトウェアで実現しても良い。また、セレクタ設定表の一部のテーブルをハードウェアで実現し、残りのテーブルをソフトウェアで実現しても良い。セレクタ設定表のテーブルをハードウェアにより実現する場合には、テーブルをアプリケーションに合わせて後から変更することはできないが、アプリケーションの開発者が、既存のテーブルの内からシミュレーション等でアクセス効率が高くなるようなテーブルを選択するだけで適切なメモリアクセスを実現できるアプリケーションの開発が可能になる。また、セレクタ設定表のテーブルをソフトウェアにより実現する場合には、アプリケーションの開発者がテーブルを入力しなくてはいけないが、アプリケーションに合わせたテーブルを自由に設定することができる。   Here, as for the selector setting table, all the tables may be realized by hardware, or all the tables may be realized by software. Further, a part of the selector setting table may be realized by hardware, and the remaining tables may be realized by software. When the selector setting table is realized by hardware, the table cannot be changed later according to the application, but the application developer can increase the access efficiency by simulation etc. from the existing table. By selecting such a table, it is possible to develop an application that can realize appropriate memory access. Further, when the selector setting table is realized by software, the application developer must input the table, but the table suitable for the application can be freely set.

図6(A)は、本実施形態における半導体装置で動作させるアプリケーションのソースコードの例を示す図である。コード601は、配列proposalのデータをバンクパターン3に従って各バンクに配置することを指示するコードであり、コード602、603は、配列proposal、normalをそれぞれ定義するコードである。なお、配列normalは、アドレス(配列のインデックス)の下位ビットの値によりバンクが一意に決定する通常のバンクパターンで配列のデータを配置する配列である。   FIG. 6A is a diagram illustrating an example of source code of an application that is operated on the semiconductor device according to the present embodiment. The code 601 is a code for instructing the data of the array proposal to be arranged in each bank according to the bank pattern 3, and the codes 602 and 603 are codes that define the arrays proposal and normal, respectively. The array normal is an array in which array data is arranged in a normal bank pattern in which the bank is uniquely determined by the value of the lower bits of the address (array index).

コード604は、配列proposalにおけるインデックス値0のデータproposal[0]を、データメモリから読み出して変数aに代入するコードである。また、コード605は、配列proposalにおけるインデックス値4のデータproposal[4]を、データメモリから読み出して変数bに代入するコードである。同様に、コード606は、配列normalにおけるインデックス値0のデータnormal[0]を、データメモリから読み出して変数xに代入するコードである。また、コード607は、配列normalにおけるインデックス値4のデータnormal[4]を、データメモリから読み出して変数yに代入するコードである。   The code 604 is a code for reading data proposal [0] having an index value 0 in the array proposal from the data memory and assigning it to the variable a. The code 605 is a code for reading the data proposal [4] of the index value 4 in the array proposal from the data memory and assigning it to the variable b. Similarly, the code 606 is a code for reading the data normal [0] of the index value 0 in the array normal from the data memory and assigning it to the variable x. The code 607 is a code for reading the data normal [4] of the index value 4 in the array normal from the data memory and assigning it to the variable y.

バンクパターン3で配置するバンクを振り分ける配列proposalに係るデータメモリへのアクセスには、通常の命令とは異なる特別な命令を利用することになる。例えば、コンパイラは、変数の型に基づいて、通常の命令を使用するか、特別な命令を使用するかを判別して、ソースコードをコンパイルする。   A special instruction different from a normal instruction is used for accessing the data memory related to the array proposal that distributes banks arranged in the bank pattern 3. For example, the compiler compiles the source code by determining whether to use a normal instruction or a special instruction based on the type of the variable.

図6(B)に、バンクパターンに従って、配置するバンクを振り分ける配列proposalのデータを読み出すためのロード命令の例を示す。配列proposalのデータをデータメモリから読み出す命令loadProposalにおいて、Registerは読み出したデータを格納するレジスタを示し、baseは配列のベースアドレスを示し、indexは配列におけるインデックスを示している。また、bankPatternは、配列のバンク配置を示すバンクパターンを指定する指定情報である。   FIG. 6B shows an example of a load instruction for reading the data of the array proposal that distributes the banks to be arranged according to the bank pattern. In the instruction loadProposal for reading data of the array proposal from the data memory, Register indicates a register for storing the read data, base indicates a base address of the array, and index indicates an index in the array. BankPattern is designation information for designating a bank pattern indicating the bank arrangement of the array.

図3に示した命令制御部12は、入力された命令insが命令loadProposalである場合には、命令loadProposalにおけるbase及びindexを、ベースアドレスbase及びインデックスindex1として出力する。また、命令制御部12は、命令loadProposalにおけるbankPatternを、バンクパターンの指定情報bankptとして出力するとともに、入力された命令insがバンクパターンの指定情報を含むアクセス命令であることを信号S1により示す。   When the input instruction ins is the instruction loadProposal, the instruction control unit 12 illustrated in FIG. 3 outputs the base and index in the instruction loadProposal as the base address base and the index index1. Further, the instruction control unit 12 outputs bankPattern in the instruction loadProposal as bank pattern designation information bankpt, and indicates that the inputted instruction ins is an access instruction including bank pattern designation information by a signal S1.

また、図6(C)に、通常のバンクパターンで配置するバンクを振り分ける配列normalのデータを読み出すためのロード命令の例を示す。配列normalのデータをデータメモリから読み出す命令loadにおいて、Registerは読み出したデータを格納するレジスタを示し、baseは配列のベースアドレスを示し、indexは配列におけるインデックスを示している。   FIG. 6C shows an example of a load instruction for reading data of an array normal for distributing banks arranged in a normal bank pattern. In an instruction load for reading data of the array normal from the data memory, Register indicates a register for storing the read data, base indicates a base address of the array, and index indicates an index in the array.

図3に示した命令制御部12は、入力された命令insが命令loadである場合には、命令loadにおけるbase及びindexを、ベースアドレスbase及びインデックスindex1として出力する。また、命令制御部12は、入力された命令insがバンクパターンの指定情報を含むアクセス命令ではないことを信号S1により示す。   When the input instruction ins is an instruction load, the instruction control unit 12 illustrated in FIG. 3 outputs the base and index in the instruction load as the base address base and the index index1. Further, the instruction control unit 12 indicates by a signal S1 that the input instruction ins is not an access instruction including bank pattern designation information.

本実施形態によれば、配列に対するデータメモリのバンクの任意な割り振りを可能にし、指定されるバンクの振り分けに従ってバンクの選択を行うことで、アプリケーションの配列に対するアクセスパターンに応じて、配列のデータのデータメモリにおけるバンク配置を制御することができる。したがって、特殊な順序で配列のデータにアクセスするアプリケーションであっても、アプリケーションを修正(変更)することなく、アプリケーションに応じたデータ配置を行うことで適切なメモリアクセスを実現することができ、性能向上を図ることができる。   According to the present embodiment, it is possible to arbitrarily allocate the banks of the data memory with respect to the array, and by selecting the bank according to the specified bank allocation, the data of the array can be determined according to the access pattern for the application array. The bank arrangement in the data memory can be controlled. Therefore, even for applications that access array data in a special order, appropriate memory access can be achieved by arranging data according to the application without modifying (changing) the application. Improvements can be made.

例えば、インデックスが0〜31の32個のデータ(要素)を有する配列について、インデックスが0、1、2、・・・、31というように1ずつ増加させて順にデータの書き込みを行うとする。その後、インデックスが0、4、8、12、16、20、24、28、1、5、9、13、17、21、25、29、2、6、10、14、18、22、26、30、3、7、11、15、19、23、27、31という順にデータの読み出しを行うとする。   For example, suppose that an array having 32 data (elements) with an index of 0 to 31 is incremented by 1 such that the index is 0, 1, 2,. After that, the index is 0, 4, 8, 12, 16, 20, 24, 28, 1, 5, 9, 13, 17, 21, 25, 29, 2, 6, 10, 14, 18, 22, 26, Assume that data is read in the order of 30, 3, 7, 11, 15, 19, 23, 27, and 31.

アドレス(配列のインデックス)の下位ビットによりバンクが一意に決定するバンクインターリーブ方式の通常のバンクパターン(アドレスの下位ビットによりバンクが一意に決定するバンクインターリーブ方式のバンクパターン)で配列のデータを各バンクに配置する場合には、図7(A)に示すように、データの書き込みに8サイクルを要し、データの読み出しに29サイクルを要し、全体で37サイクルを要する。それに対して、図5に示したセレクタ設定表での設定0のバンクパターンで配列のデータを各バンクに配置する場合には、図7(B)に示すように、データの書き込みに15サイクルを要し、データの読み出しに13サイクルを要し、全体で28サイクルを要する。このように、本実施形態では、配列のデータアクセスパターンに応じて、配列のデータのバンク配置を制御することで、適切なメモリアクセスを実現することができ、メモリアクセスに要するサイクル数を低減することができる。   Each bank stores array data in a normal bank interleaved bank pattern (bank interleaved bank pattern in which the bank is uniquely determined by the lower bits of the address), with the bank uniquely determined by the lower bits of the address (array index) 7A, as shown in FIG. 7A, 8 cycles are required to write data, 29 cycles are required to read data, and 37 cycles are required as a whole. On the other hand, when the array data is arranged in each bank with the bank pattern set to 0 in the selector setting table shown in FIG. 5, as shown in FIG. In other words, 13 cycles are required to read data, and 28 cycles are required in total. As described above, in this embodiment, by controlling the bank arrangement of the array data according to the array data access pattern, appropriate memory access can be realized, and the number of cycles required for memory access can be reduced. be able to.

なお、前述した実施形態では、通常のバンクパターンでバンク配置する配列については通常のアクセス命令を用い、セレクタ設定表が有するテーブルのバンクパターンでバンク配置する配列については特別なアクセス命令を用いるようにして区別している。本実施形態はこれに限定されるものではなく、例えば、セレクタ設定表に、アドレス(配列のインデックス)の下位ビットの値とデータを配置するバンクとが一意に対応するバンクインターリーブ方式の通常のバンクパターンのテーブルを備え、常にバンクパターンを指定するようにして1種類のアクセス命令でメモリアクセスを実現するようにしても良い。   In the above-described embodiment, a normal access instruction is used for the arrangement of banks in the normal bank pattern, and a special access instruction is used for the arrangement of banks in the bank pattern of the table included in the selector setting table. Are distinguished. The present embodiment is not limited to this. For example, in the selector setting table, the value of the lower bit of the address (array index) and the bank in which the data is allocated uniquely correspond to a bank interleaved normal bank A pattern table may be provided, and a memory pattern may be realized by one type of access instruction so that a bank pattern is always designated.

なお、前記実施形態は、何れも本発明を実施するにあたっての具体化のほんの一例を示したものに過ぎず、これらによって本発明の技術的範囲が限定的に解釈されてはならないものである。すなわち、本発明はその技術思想、またはその主要な特徴から逸脱することなく、様々な形で実施することができる。   The above-described embodiments are merely examples of implementation in carrying out the present invention, and the technical scope of the present invention should not be construed as being limited thereto. That is, the present invention can be implemented in various forms without departing from the technical idea or the main features thereof.

10 プロセッサ
11−0〜11−3 インタフェース
20−0〜20−4 データメモリ
12 命令制御部
13 インデックス変換器
14 セレクタ
15 加算器
16 アドレス保持部
17 バンク選択用デコーダ
31 セレクタ
32 セレクタ設定表
33、34 レジスタ
10 processor 11-0 to 11-3 interface 20-0 to 20-4 data memory 12 instruction control unit 13 index converter 14 selector 15 adder 16 address holding unit 17 bank selection decoder 31 selector 32 selector setting table 33, 34 register

Claims (7)

複数のバンクを有するデータメモリと、
前記データメモリへのアクセス命令に応じてアクセスを行うプロセッサとを有し、
前記プロセッサは、
入力された前記アクセス命令が、配列のデータを配置する前記データメモリのバンクの振り分けを指定する指定情報を含むアクセス命令である場合には、前記指定情報により指定されるバンクの振り分けに応じて、前記アクセス命令がアクセスするデータを配置するバンクに対応するインデックスを変換し、変換した前記インデックスに従って前記バンクの選択を行い、前記配列に係る前記データメモリへのアクセスを行うことを特徴とする半導体装置。
A data memory having a plurality of banks;
A processor that performs access in response to an access instruction to the data memory,
The processor is
In the case where the input access instruction is an access instruction including designation information for designating allocation of banks of the data memory in which the array data is arranged, according to the bank allocation specified by the designation information , A semiconductor device, wherein an index corresponding to a bank in which data accessed by the access instruction is arranged is converted, the bank is selected according to the converted index , and the data memory according to the array is accessed .
前記プロセッサは、
入力された前記アクセス命令がアクセスするデータを配置するバンクに対応するインデックスを、前記指定情報により指定されるバンクの振り分けに応じて変換するインデックス変換部を有し、
前記アクセス命令が前記指定情報を含むアクセス命令である場合には、変換したインデックスに基づいて前記バンクの選択を行い、前記配列に係る前記データメモリへのアクセスを行うことを特徴とする請求項1記載の半導体装置。
The processor is
An index conversion unit that converts an index corresponding to a bank in which data to be accessed by the access instruction that is input is converted according to the distribution of the bank designated by the designation information;
2. If the access instruction is an access instruction including the designation information, the bank is selected based on the converted index, and the data memory related to the array is accessed. The semiconductor device described.
前記インデックス変換部は、
配列のインデックスと前記配列のデータを配置する前記バンクとの対応関係を示すテーブルと、
前記指定情報に応じて選択した前記テーブルを参照して、前記アクセス命令がアクセスするデータを配置するバンクに対応するインデックスを変換する変換部とを有することを特徴とする請求項2記載の半導体装置。
The index conversion unit
A table showing a correspondence relationship between an index of the array and the bank in which the data of the array is arranged;
The semiconductor device according to claim 2, further comprising: a conversion unit that converts an index corresponding to a bank in which data to be accessed by the access instruction is referenced with reference to the table selected according to the designation information. .
前記インデックス変換部が有する前記テーブルには、配列のインデックスの下位ビットの値と前記配列のデータを配置する前記バンクとが一意に対応するテーブルを含むことを特徴とする請求項3記載の半導体装置。   4. The semiconductor device according to claim 3, wherein the table included in the index conversion unit includes a table in which a value of a lower-order bit of an array index uniquely corresponds to the bank in which the array data is arranged. . 前記プロセッサは、
前記アクセス命令が、前記指定情報を含むアクセス命令である場合には、変換したインデックスを選択し、前記指定情報を含むアクセス命令でない場合には、前記アクセス命令がアクセスするデータを配置するバンクに対応するインデックスを選択する選択部を有し、
前記選択部により選択したインデックスに基づいて前記バンクの選択を行い、前記配列に係る前記データメモリへのアクセスを行うことを特徴とする請求項2記載の半導体装置。
The processor is
When the access instruction is an access instruction including the designation information, the converted index is selected. When the access instruction is not an access instruction including the designation information, the access instruction corresponds to a bank in which data to be accessed is arranged. A selection unit for selecting an index to be
The semiconductor device according to claim 2, wherein the bank is selected based on the index selected by the selection unit, and the data memory related to the array is accessed.
複数のバンクを有するデータメモリと、前記データメモリへのアクセス命令に応じてアクセスを行うプロセッサとを有する半導体装置の制御方法であって、
入力された前記アクセス命令が、配列のデータを配置する前記データメモリのバンクの振り分けを指定する指定情報を含むアクセス命令である場合に、前記指定情報により指定されるバンクの振り分けに応じて、前記アクセス命令がアクセスするデータを配置するバンクに対応するインデックスを変換する工程と、
変換したインデックスに基づいて前記バンクの選択を行い、前記配列に係る前記データメモリへのアクセスを行う工程とを有することを特徴とする半導体装置の制御方法。
A method for controlling a semiconductor device, comprising: a data memory having a plurality of banks; and a processor that performs access in response to an access instruction to the data memory,
When the input access instruction is an access instruction including designation information for designating allocation of banks of the data memory in which data of an array is arranged, according to the allocation of banks specified by the designation information, Converting an index corresponding to a bank in which data to be accessed by an access instruction is placed ;
And a step of selecting the bank based on the converted index and accessing the data memory related to the array.
前記配列のインデックスを変換する工程は、
前記指定情報に応じて、配列のインデックスと前記配列のデータを配置する前記バンクとの対応関係を示すテーブルを選択する工程と、
選択した前記テーブルを参照して、前記アクセス命令がアクセスするデータを配置するバンクに対応するインデックスを変換する工程とを有することを特徴とする請求項6記載の半導体装置の制御方法。
Transforming the array index comprises:
Selecting a table indicating a correspondence relationship between an array index and the bank in which the array data is arranged according to the designation information;
7. The method of controlling a semiconductor device according to claim 6, further comprising: converting an index corresponding to a bank in which data accessed by the access instruction is arranged with reference to the selected table.
JP2013124053A 2013-06-12 2013-06-12 Semiconductor device and method for controlling semiconductor device Active JP6123510B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013124053A JP6123510B2 (en) 2013-06-12 2013-06-12 Semiconductor device and method for controlling semiconductor device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013124053A JP6123510B2 (en) 2013-06-12 2013-06-12 Semiconductor device and method for controlling semiconductor device

Publications (2)

Publication Number Publication Date
JP2014241107A JP2014241107A (en) 2014-12-25
JP6123510B2 true JP6123510B2 (en) 2017-05-10

Family

ID=52140311

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013124053A Active JP6123510B2 (en) 2013-06-12 2013-06-12 Semiconductor device and method for controlling semiconductor device

Country Status (1)

Country Link
JP (1) JP6123510B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116820344B (en) * 2023-07-03 2024-04-26 摩尔线程智能科技(北京)有限责任公司 Memory access circuit and memory access method, integrated circuit and electronic device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05143326A (en) * 1991-11-18 1993-06-11 Matsushita Electric Ind Co Ltd Bank processor
EP1050819A1 (en) * 1999-05-03 2000-11-08 Sgs Thomson Microelectronics Sa Computer memory access
JP2004157695A (en) * 2002-11-06 2004-06-03 Matsushita Electric Ind Co Ltd Information processing method and information processing apparatus

Also Published As

Publication number Publication date
JP2014241107A (en) 2014-12-25

Similar Documents

Publication Publication Date Title
JP3950831B2 (en) Memory interleaving method
US6968440B2 (en) Systems and methods for processor memory allocation
CN101341473B (en) Multiprocessor circuit with shared memory banks
KR20200129843A (en) Memory device including computing circuit, memory controller controlling the memory device and memory system including the memory device
CN109478252B (en) Multicast network and memory transfer optimization for neural network hardware acceleration
JP2009529756A (en) Test data format conversion
JP5040660B2 (en) Storage area allocation system and method, and control apparatus
GB2457309A (en) Process allocation in a processor array using a simulated annealing method
JP5885481B2 (en) Information processing apparatus, information processing method, and program
KR20130011961A (en) Arithmetic and control unit, arithmetic and control method, program and parallel processor
CN106681694A (en) Single-precision matrix multiplication optimization method and system based on NVIDIA Kepler GPU assembly instruction
JP6500505B2 (en) Control device, control method, and control program
JP2018194939A (en) Information processing apparatus, memory control apparatus, and information processing apparatus control method
US7313645B2 (en) Processor to reduce data rearrangement instructions for matrices in multiple memory banks
JP6123510B2 (en) Semiconductor device and method for controlling semiconductor device
JP5532132B2 (en) Apparatus and method enabling efficient time and area access to square matrix distributed and stored in internal memory of processing element operating in SIMD mode and its transpose matrix
US11625269B1 (en) Scheduling for locality of reference to memory
US20220318015A1 (en) Enforcing data placement requirements via address bit swapping
JP4901754B2 (en) Evaluation unit for flag register of single instruction multiple data execution engine
KR20150078951A (en) Memory management method and apparatus
JP4810542B2 (en) MEMORY CONTROL METHOD, PROGRAM, AND DEVICE
JP2014109938A (en) Program start-up device, program start-up method, and program start-up program
JP7168731B1 (en) MEMORY ACCESS CONTROL DEVICE, MEMORY ACCESS CONTROL METHOD, AND MEMORY ACCESS CONTROL PROGRAM
JP2020140284A (en) Vector arithmetic processing device, array variable initialization method by vector arithmetic processing device, and array variable initialization program using vector arithmetic processing device
Gorawski et al. Efficient processing of large data structures on GPUs: Enumeration scheme based optimisation

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20160310

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20161209

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20161220

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170215

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170320

R150 Certificate of patent or registration of utility model

Ref document number: 6123510

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150