JPH0559453B2 - - Google Patents

Info

Publication number
JPH0559453B2
JPH0559453B2 JP61078655A JP7865586A JPH0559453B2 JP H0559453 B2 JPH0559453 B2 JP H0559453B2 JP 61078655 A JP61078655 A JP 61078655A JP 7865586 A JP7865586 A JP 7865586A JP H0559453 B2 JPH0559453 B2 JP H0559453B2
Authority
JP
Japan
Prior art keywords
subscript
array
dimensional
register
block
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.)
Expired - Lifetime
Application number
JP61078655A
Other languages
Japanese (ja)
Other versions
JPS62235659A (en
Inventor
Naoki Nishi
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.)
NEC Corp
Original Assignee
Nippon Electric Co 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 Nippon Electric Co Ltd filed Critical Nippon Electric Co Ltd
Priority to JP61078655A priority Critical patent/JPS62235659A/en
Publication of JPS62235659A publication Critical patent/JPS62235659A/en
Publication of JPH0559453B2 publication Critical patent/JPH0559453B2/ja
Granted legal-status Critical Current

Links

Landscapes

  • Memory System (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、多次元配列のブロツク化アドレツシ
ング装置に関し、特にページング方式により仮想
化された階層記憶システムを備える計算機システ
ムにおける多次元配列データの写像法、及び参照
法に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a blocking addressing device for multidimensional arrays, and in particular to mapping of multidimensional array data in a computer system equipped with a hierarchical storage system virtualized by a paging method. law and reference law.

〔従来の技術〕[Conventional technology]

従来のこの種の多次元配列のブロツク化アドレ
ツシング装置は多次元配列の一次元記憶への写像
法及び参照法として比較的単純な算出法で一次元
アドレスに変換できるため、多くのプログラミン
グ言語で採用されている。配列の添字から一次元
アドレスの算出は、通常の計算機が備えている加
減算器、乗算器を用いて計算される。
This type of conventional blocking addressing device for multidimensional arrays is used in many programming languages because it can be used to map and reference multidimensional arrays to one-dimensional memory and convert them into one-dimensional addresses using relatively simple calculation methods. has been done. A one-dimensional address is calculated from an array subscript using an adder/subtracter and a multiplier that are included in a normal computer.

配列要素A(I1,I2,……,In)への参照法とし
ては下記に示す計算式により与えられる。
The reference method for array element A (I 1 , I 2 , . . . , In) is given by the calculation formula shown below.

(l1−I1+|d1|×(l2−I2+|d2|×(……|do-1
|×(lo−Io)……)))×s+b なお、配列の宣言をa(d1,d2,……,do)::
sとする(n>=1)。aは配列名、d1〜doは寸
法宣言子であり、寸法宣言子diはli:hiのペアで記
述される。liは下限値を、hiは上限値を示す。|di
|を寸法宣言子diの寸法と呼び、hi−li+1に等し
い。配列要素が占める記憶単位はsバイトとす
る。さらにプログラミング言語上で宣言された配
列に対して言語処理系(コンバイラ、インタプリ
タ等)が決定する、配列データ記憶領域の起点ア
ドレスをbとする。この起点アドレスbは、配列
要素a(l1,l2,……,lo)を指すアドレスと等価
である。
(l 1 −I 1 + |d 1 |×(l 2 −I 2 + |d 2 |×(……|d o-1
|×( lo −I o )……)))×s+b Note that the array declaration is a(d 1 , d 2 ,……, d o )::
Let s be (n>=1). a is an array name, d 1 to d o are dimension declarators, and the dimension declarator d i is written as a pair of l i :h i . l i indicates the lower limit value, and h i indicates the upper limit value. |d i
| is called the dimension of the dimension declarator d i and is equal to h i −l i +1. The storage unit occupied by an array element is s bytes. Further, let b be the starting address of the array data storage area determined by the language processing system (compiler, interpreter, etc.) for the array declared in the programming language. This starting point address b is equivalent to the address pointing to array element a (l 1 , l 2 , . . . , lo ).

たとえば、二次元配列における多次元配列の写
像法は第4図aに示すように従来の写像法は縦割
り的で、配列要素A(1:4,1:4)の場合に、
A(i,j)に対する参照は計算式(i−1+3
×(j−1))×s+bにより求められる。これに
より、一次元空間上での配列要素の並びは第4図
bのようになる。配列データを用いてプログラミ
ングを行なう場合の典型的な配列要素への参照パ
ターンは、A(i,j)に対してiやjを変化さ
せて参照するループを構成する場合であるが、第
4図bからわかるように、添字iを+1もしくは
−1ずらして配列Aに参照することは一次元記憶
上では連続した記憶領域への参照になるのに対し
て、添字jを+1もしくは−1ずらして配列Aに
参照することは、一次元記憶上では不連続な記憶
領域への参照となる。
For example, the conventional mapping method for a multidimensional array in a two-dimensional array is vertically divided, as shown in Figure 4a, and in the case of array element A (1:4, 1:4),
Reference to A(i,j) is calculated using the formula (i-1+3
It is determined by ×(j-1))×s+b. As a result, the array elements are arranged in a one-dimensional space as shown in FIG. 4b. When programming using array data, a typical reference pattern to array elements is when constructing a loop that refers to A(i, j) by changing i and j. As can be seen from Figure b, shifting the subscript i by +1 or -1 and referencing array A is a reference to a continuous storage area in one-dimensional storage, whereas shifting the subscript j by +1 or -1 refers to a continuous storage area. Referring to array A is a reference to a discontinuous storage area on one-dimensional storage.

また、第4図bにおいて、配列要素A(1:4,
1:4)がページング方式による仮想記憶空間上
に展開されている様子を示すと、ページ・サイズ
は配列Aの要素4個分に等しい。計算機の処理装
置がある時間間隔γ中に配列要素4個を参照した
とする。この参照がA(i,1)i=1,4であ
るならばこの間に参照される記憶ページは1ペー
ジであるが、この参照がA(1,j)j=1,4
であるならばこの間に参照される記憶ページは4
ページに渡る。明かに後者の参照は局所性に欠
き、主記憶に配列A全体が入りきらない場合、主
記憶−二次記憶装置間で転送されるページ数が増
大する。平均的にみても必要となる主記憶ページ
数は2.5であり、A(1,j)j=1,4のような
参照になつて必要となる主記憶ページ数は増大す
る。このような現象によるプログラムの実行時間
増大、性能低下は、大規模な配列を用いる科学技
術計算プログラムにしばしばあらわれ、ワーキン
グ・セツト異常の一つとされている。この現象を
避けるためには、従来プログラムのコーデイング
法やアルゴリズムの設計階段において記憶参照の
局所性が保たれるように注意深く設計をすすめる
方法が一般的であり、プログラム作成を困難なも
のにしている。
In addition, in FIG. 4b, array element A (1:4,
1:4) is expanded on the virtual storage space using the paging method, the page size is equal to four elements of array A. Assume that the processing unit of the computer references four array elements during a certain time interval γ. If this reference is A (i, 1) i = 1, 4, the memory page referenced during this time is 1 page, but if this reference is A (1, j) j = 1, 4
If so, the number of memory pages referenced during this time is 4.
Across the page. Obviously, the latter reference lacks locality, and if the entire array A cannot fit into the main memory, the number of pages transferred between the main memory and the secondary memory will increase. On average, the number of main memory pages required is 2.5, and the number of main memory pages required increases as the reference becomes A(1,j)j=1,4. Increased program execution time and decreased performance due to such phenomena often appear in scientific and technical calculation programs that use large-scale arrays, and are considered to be one of the working set abnormalities. In order to avoid this phenomenon, it is common practice to carefully design programs so that the locality of memory references is maintained during program coding and algorithm design steps, making program creation difficult. There is.

そこで、比較的どのような参照パターンに対し
ても記憶参照の局所性の高い写像法が必要とな
る。これに関しては、サブマトリツクス法もしく
はブロツク化法と呼ばれる方式がある。ブロツク
化法により多次元配列を一次元記憶空間に写像す
る例として、二次元配列を一次元化する方式では
元の二次元配列の部分配列を一つのブロツクとし
て扱い、ブロツクに関する写像と、ブロツク内の
写像とを独立に行なう。例として配列要素A
(1:4,1:4)を部分配列2×2で写像した
場合の一次元記憶空間上での様子は第2図bに示
すようにページ・サイズが配列Aの要素4個分に
等しい場合を示している。計算機の処理装置があ
る時間間隔γ中に配列要素4個を参照したとす
る。この参照がA(i,1)i=1,4であるな
らばこの間に参照される記憶ページは2ページで
あり、この参照がA(1,j)j=1,4である
場合もこの間に参照される記憶ページは2ページ
である。前者の写像法と比べるとA(i,1)i
=1,4の場合の必要主記憶ページ数が1から2
に増加したかわりに、A(1,j)j=1,4の
場合の必要主記憶ページ数が4から2に減少して
いる。平均的には2ページの主記憶ページが必要
であり、前者の写像法よりも低く押さえられてい
る。
Therefore, a mapping method with high locality of memory reference is required for relatively any reference pattern. Regarding this, there is a method called a submatrix method or a blocking method. As an example of mapping a multidimensional array to a one-dimensional storage space using the blocking method, in the method of converting a two-dimensional array to one-dimensional, a subarray of the original two-dimensional array is treated as one block. The mapping is performed independently. For example, array element A
(1:4, 1:4) is mapped as a 2x2 subarray in one-dimensional storage space, as shown in Figure 2b, the page size is equal to 4 elements of array A. It shows the case. Assume that the processing unit of the computer references four array elements during a certain time interval γ. If this reference is A (i, 1) i = 1, 4, the number of memory pages referenced during this time is 2 pages, and if this reference is A (1, j) j = 1, 4, the number of memory pages referenced during this time is 2 pages. The number of memory pages referenced by is 2 pages. Compared to the former mapping method, A(i,1)i
= 1, 4, the required number of main memory pages is 1 to 2
However, the number of required main memory pages is reduced from 4 to 2 when A(1,j)j=1,4. On average, two main memory pages are required, which is lower than the former mapping method.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

上述したように従来の多次元配列の一次元記憶
空間への写像法及び参照法は、展開された一次元
記憶空間がページング方式による仮想記憶空間で
実現されている場合に問題を生ずる。すなわち、
仮想記憶システムは参照の局所性を利用し、定義
された記憶空間は二次記憶装置に確保し、実際に
現在参照されている記憶ページのみを主記憶に配
置することで主記憶の有効利用を計つている。仮
想記憶システムが有効に作用するためには前提条
件である参照の局所性が成り立たなければならな
い。多次元配列を従来の方法で一次元記憶空間に
写像及び参照することは、この局所性に反する場
合がある。
As described above, the conventional method of mapping and referencing a multidimensional array to a one-dimensional storage space causes a problem when the expanded one-dimensional storage space is realized as a virtual storage space using a paging method. That is,
Virtual memory systems utilize locality of reference, secure defined storage space in secondary storage, and place only the memory pages that are actually currently being referenced in main memory, thereby making effective use of main memory. I'm planning. In order for a virtual memory system to function effectively, locality of reference, which is a prerequisite, must be established. Mapping and referencing multidimensional arrays into one-dimensional storage space in conventional ways may violate this locality.

また、ブロツク化写像法の有効性を示したが、
ブロツク化法は従来法式と比べ多次元空間から一
次元空間への写像コストが高く、その変換にはビ
ツトフイールドの切出し等が含まれ、従来のよう
にソフトウエアにより変換を行うことには問題が
あり、また、主記憶バンク上での衝突等の問題も
ある。本発明の目的はこれらの問題点を計算機の
アドレツシング・ハードウエアにより解決する多
次元配列のブロツク化アドレツシング装置を提供
することにある。
We also demonstrated the effectiveness of the block mapping method, but
The blocking method has a higher cost for mapping from a multidimensional space to a one-dimensional space than the conventional method, and the conversion involves cutting out bit fields, so there are problems with performing the conversion using software as in the past. There are also problems such as collisions on the main memory bank. SUMMARY OF THE INVENTION An object of the present invention is to provide a multidimensional array blocking addressing device that solves these problems using computer addressing hardware.

〔問題点を解決するための手段〕[Means for solving problems]

本発明によれば、多次元配列データを一次元ア
ドレス空間に写像/参照するブロツク化アドレツ
シング装置において、 配列要素A(I1,I2,……Io)を示す各次元の添
字値Ii(0≦Ii≦di−1:1≦i≦n)を保持する
n個の添字値レジスタと、各次元の添字寸法di
(1≦i≦n−1)を2Nで割算を行い商が2のべ
き数となるように切上げたブロツク添字寸法RMi
(1≦i≦(n−1))を保持するn−1個の添字
寸法レジスタと、 前記添字値レジスタの上位N−1ビツトのブロ
ツクアドレス部RBi(1≦i≦n)と、前記添字
寸法レジスタのブロツク添字寸法値RMiから一次
元記憶空間のブロツクアドレスとして RB1+RM1×(RB2+RM2×(……(RMo-1×
RBo)……)を演算するブロツクアドレス演算手
段と、 前記添字値レジスタ下位Nビツト列のブロツク
内アドレス部RIi(1≦i≦n)のn個のビツト列
からRIo、(RIo+RIo-1)、(RIn+RIo-1+RIo-2)、
……(RIo+……RI1)のn個の演算値を求め、
演算結果の下位ビツト列を並べて一次元記憶空間
のブロツク内アドレスを生成するブロツク内アド
レス生成手段と、 前記ブロツクアドレス演算手段と前記ブロツク
内アドレス生成手段とに接続される一次元アドレ
スを保持する出力レジスタとから構成されること
を特徴とする多次元配列のブロツク化しアドレツ
シング装置が得られる。
According to the present invention, in a blocking addressing device that maps/references multidimensional array data to a one-dimensional address space, the subscript value I i of each dimension indicating an array element A (I 1 , I 2 , ... I o ) is used. n subscript value registers holding (0≦I i ≦d i −1:1≦i≦n) and subscript size d i of each dimension.
Block subscript dimension RM i obtained by dividing (1≦i≦n-1) by 2 N and rounding up the quotient to a power of 2.
n-1 subscript size registers holding (1≦i≦(n-1)); a block address part RB i (1≦i≦n) of the upper N-1 bits of the above-mentioned subscript value register; From the block index dimension value RM i of the index dimension register, the block address of the one-dimensional storage space is calculated as RB 1 + RM 1 × (RB 2 + RM 2 × (... (RM o-1 ×
RB o )...), and a block address calculation means for calculating RI o , ( RI o +RI o-1 ), (RIn+RI o-1 +RI o-2 ),
Find n calculated values of (RI o +...RI 1 ),
Intra-block address generation means for arranging lower bit strings of operation results to generate an intra-block address in a one-dimensional storage space; and an output for holding the one-dimensional address connected to the block address arithmetic means and the intra-block address generation means. A multidimensional array blocking addressing device is obtained, which is characterized in that it is composed of registers.

〔実施例〕〔Example〕

次に本発明の実施例について図面を参照して説
明する。
Next, embodiments of the present invention will be described with reference to the drawings.

第1図は本発明の一実施例を示す。第1図にお
いて、本実施例は多次元配列の一次元化アドレツ
シング方式により、三次元の添字アドレスから一
次元添字アドレスを生成する装置で、配列要素A
(i,j,k)を参照する場合配列添字k、配列
添字jおよび配列添字iをそれぞれ保持するレジ
スタ11,12および13と、添字iの添字寸法
を2のN乗で割つた商を切上げた値を保持する入
力レジスタ14と、添字jの添字寸法を2のN乗
で割つた商を切上げた値を保持する入力レジスタ
15と添字レベルでの一次元アドレスを出力する
出力レジスタ22とを含む。
FIG. 1 shows an embodiment of the invention. In FIG. 1, this embodiment is a device that generates a one-dimensional subscript address from a three-dimensional subscript address using a one-dimensional addressing method for a multidimensional array.
When referencing (i, j, k), use registers 11, 12, and 13 that hold array index k, array index j, and array index i, respectively, and divide the index size of index i by 2 to the N power and round up the quotient. an input register 14 that holds a value obtained by dividing the subscript dimension of subscript j by 2 to the N power, and an input register 15 that holds a value obtained by rounding up the quotient, and an output register 22 that outputs a one-dimensional address at the subscript level. include.

レジスタ11,12および13は下位からNビ
ツト目とN+1ビツト目を境にして2つのフイー
ルドから成つている。Nの値は対象とする計算機
のページ・サイズ等をもとに定める必要があるが
ページ・サイズが4Kバイトの単精度実数を配列
要素の基準と考えるとN=4程度となる。すなわ
ち16×16×16の部分配列がひとつのブロツクとな
り、この部分配列が占める記憶サイズは単精度実
数配列の場合、4ページに相当する。配列要素が
8バイトの倍精度実数配列の場合には16×16×16
の部分配列8ページを占めることになる。
Registers 11, 12 and 13 are composed of two fields with the Nth bit and N+1th bit from the lowest order as boundaries. The value of N needs to be determined based on the page size of the target computer, etc., but if a single-precision real number with a page size of 4K bytes is considered as the standard for array elements, N = about 4. In other words, a 16×16×16 partial array constitutes one block, and the storage size occupied by this partial array corresponds to 4 pages in the case of a single-precision real number array. 16×16×16 if the array element is an 8-byte double-precision real number array
The partial array will occupy 8 pages.

更にこの実施例においてはレジスタ11と入力
レジスタ15とに接続される掛け算器16と、レ
ジスタ12と掛け算器16とに接続される全加算
器18と、入力レジスタ14と全加算器18とに
接続される掛け算器17と、レジスタ13と掛け
算器17に接続されている全加算器19と、レジ
スタ11とレジスタ12とに接続されている全加
算器20と、全加算器20とレジスタ13とに接
続されている全加算器21とを含み、全加算器1
9〜21とレジスタ11とが出力レジスタ22に
接続されるように構成されている。
Furthermore, in this embodiment, a multiplier 16 is connected to the register 11 and the input register 15, a full adder 18 is connected to the register 12 and the multiplier 16, and a full adder 18 is connected to the input register 14 and the full adder 18. a multiplier 17 connected to the register 13 and the multiplier 17, a full adder 20 connected to the register 11 and the register 12, and a full adder 20 and the register 13. a full adder 21 connected to the full adder 1;
9 to 21 and the register 11 are configured to be connected to the output register 22.

本実施例においてはブロツク内の一次元アドレ
ス計算において添字i,j,kのいずれかを連続
的に変化させて参照に対してバンク衝突を避ける
ようにしている。この過程は添字入力i,jの下
位Nビツトをそのまま出力に導かず、添字kとj
の下位Nビツトの和(あふれは捨てる)、添字k,
j,iの下位Nビツトの和(あふれは捨てる)を
用いる。第2図は複数バンクからなる主記憶装置
にブロツク化写像した場合を示す。第2図におい
て、8バイト並列、16バンクから構成される主記
憶装置にA(1:16,1:16,1:16)::8の配
列が写像された状態を示す。ここではN=4とし
ている。A(i,1,1)j=1,16A(1,1,
k)k=1,16等添字のいずれかを連続的にスラ
イドさせてのアクセスに対してバンク衝突を起こ
さない。ただし、添字i,j,kの和が一定にな
るような形で添字を変化させると同一バンクへの
参照となるので、そのような形での参照を含むプ
ログラムに対しては添字i,j,kの下位Nビツ
トをそのまま出力に導く。
In this embodiment, one of the subscripts i, j, and k is continuously changed in one-dimensional address calculation within a block to avoid bank collisions with respect to references. This process does not directly lead the lower N bits of subscript inputs i and j to the output, but instead directs the subscripts k and j
The sum of the lower N bits of (overflows are discarded), index k,
The sum of the lower N bits of j and i (overflows are discarded) is used. FIG. 2 shows a case where blocks are mapped to a main memory device consisting of a plurality of banks. FIG. 2 shows a state in which an array A(1:16, 1:16, 1:16)::8 is mapped to a main memory device consisting of 8 bytes in parallel and 16 banks. Here, N=4. A(i,1,1)j=1,16A(1,1,
k) No bank collision occurs when access is made by continuously sliding one of the subscripts such as k=1, 16, etc. However, if the subscripts are changed in such a way that the sum of subscripts i, j, and k is constant, the references will be to the same bank, so for programs that include references in this way, the subscripts i, j , k are directly led to the output.

このように本実施例はバンク衝突を回避するた
めの機構を備えている。計算機の主記憶装置は演
算処理装置等との間高速データ転送を行なうため
に複数バンクに分割されている場合があり、異な
るバンクに対するアクセスは高速に処理すること
が可能である。配列A(i,j,k)に対するi
もしくはj,kを変化させての連続参照も主記憶
中で同一バンクへのアクセスとならなければ高速
に処理可能である。
In this way, this embodiment is provided with a mechanism for avoiding bank collisions. The main memory of a computer is sometimes divided into a plurality of banks for high-speed data transfer to and from an arithmetic processing unit, and accesses to different banks can be processed at high speed. i for array A(i, j, k)
Alternatively, continuous references by changing j and k can be processed at high speed as long as the same bank is not accessed in the main memory.

また、この実施例は三次元配列のブロツク化を
基本動作として行なうものであるのであるが、二
次元配列及び四次元以上の配列を一次元化するた
めにも使用可能である。第5図に本発明を多次元
の配列に対して構成した一実施例を示す。
Furthermore, although this embodiment is designed to block a three-dimensional array as a basic operation, it can also be used to convert a two-dimensional array and an array of four or more dimensions into one-dimensional array. FIG. 5 shows an embodiment in which the present invention is configured for a multidimensional array.

第5図において、配列要素A(I1,I2,……Io
を参照する場合に各次元の添字値I1,I2,……Io
を保持するn個の添字値レジスタ501〜50o
と、I1,I2,……Ioの添字寸法d1,d2,……do-1
2Nで割算を行い商が2のべき数となるように切り
上げたブロツク添字寸法RMi(1≦i≦(n−1))
を保持するn−1個の添字寸法レジスタ511
51o-1と、添字値レジスタ501〜50oと添字
寸法レジスタ511〜51o-1に接続される掛け算
器521〜52o-1及び全加算器531〜53o-1
541〜54o-1と一次元アドレスを保持する出力
レジスタ55とを含む。
In Figure 5, array element A (I 1 , I 2 , ... I o )
When referring to the subscript values of each dimension I 1 , I 2 , ... I o
n subscript value registers 50 1 to 50 o
and the subscript dimensions d 1 , d 2 , ... d o -1 of I 1 , I 2 , ... I o
2 Block subscript dimension RM i (1≦i≦(n-1)) divided by N and rounded up so that the quotient becomes a power of 2
n-1 subscript dimension registers 51 1 to
51 o-1 , multipliers 52 1 to 52 o-1 connected to subscript value registers 50 1 to 50 o , subscript size registers 51 1 to 51 o- 1 , and full adders 53 1 to 53 o-1 ,
54 1 to 54 o-1 and an output register 55 that holds one-dimensional addresses.

添字値レジスタ501〜50oは第1図のレジス
タ11,12と同様に下位ビツト目とN−1ビツ
ト目を境にして、下位Nビツトはブロツク内アド
レス部RIi(1≦i≦n)、上位N−1ビツトはブ
ロツクアドレス部RBi(1≦i≦n)とから成つ
ている。
The subscript value registers 501 to 50o are similar to the registers 11 and 12 in FIG. , the upper N-1 bits consist of a block address part RBi (1≦i≦n).

添字値レジスタ50oのブロツク内アドレス部
RIoは、出力レジスタ55及び全加算器54o-1
送られ、添字値レジスタ501〜50o-1のブロツ
ク内アドレス部RIi(1≦i≦n)は、全加算器5
1〜54o-1に送られ、RIo、(RIo+R1o-1)、
(RIo+RIo-1+RIo-2)、……(RIo+……RI1)の
n個の演算値を求め、ブロツク内アドレスとして
出力レジスタ55に送られる。
Block internal address part of subscript value register 50 o
RI o is sent to the output register 55 and the full adder 54 o-1 , and the intra-block address part RI i (1≦i≦n) of the subscript value registers 50 1 to 50 o-1 is sent to the full adder 54 o-1.
4 1 to 54 o-1 , RI o , (RI o + R1 o-1 ),
n calculation values of (RI o + RI o-1 + RI o-2 ), . . . (RI o + . . . RI 1 ) are determined and sent to the output register 55 as an intra-block address.

また、ブロツクアドレス生成のために添字レジ
スタ501から51oのブロツクアドレス部RBi(1
≦i≦n)は、掛け算器52o-1及び全加算器5
1〜53o-1に送られ、添字寸法レジスタ511
〜51o-1に保持されているブロツク添字寸法
RM1,RM2,……RMo-1は掛け算器521〜52
に送られ、一次元記憶空間のブロツクアドレス
として次式の演算を行い出力レジスタ54に送出
する。
Also, in order to generate block addresses, block address parts RB i ( 1
≦i≦n), multiplier 52 o-1 and full adder 5
3 1 to 53 o-1 , subscript size register 51 1
~51 Block subscript dimension held in o-1
RM 1 , RM 2 , ...RM o-1 are multipliers 52 1 to 52
o , the following equation is calculated as a block address in the one-dimensional storage space, and the result is sent to the output register 54.

RB1+RM1×(RB2+RM2×(……(RMo-1×
RBo)……)出力レジスタ55の出力は一次元ア
ドレスとして送出される。
RB 1 + RM 1 × (RB 2 + RM 2 × (……(RM o-1 ×
RB o )...) The output of the output register 55 is sent out as a one-dimensional address.

第3図はブロツク化写像法により二次元配列を
一次元記憶空間に写像する方式を示す。第3図に
おいて、まず二次元配列を一次元化する場合に
は、入力レジスタ13に値0をセツトする。ま
た、入力レジスタ14は値1をセツトする。すな
わち、配列要素A(i,j)の参照に対して、入
力レジスタ11に配列添字j、入力レジスタ12
に配列添字iの値をセツトし、入力レジスタ15
に添字iの添字寸法を2のN乗で割つた商を切上
げた値をセツトして使用する。この場合出力レジ
スタ22の下位Nビツトは意味を持たないので、
添字レベルの一次元アドレスから求めるべき一次
元アドレスを計算するまえに右にNビツトシフト
する必要がある。配列A(1:128,1:128)::
4に対して32×32でブロツク化されている状態で
A(i,j)に参照すると、各次元の添字値を保
持するレジスタ12,11に添字i,jの下限値
からの増分i−1,j−1をセツトする。各次元
の添字値を保持するレジスタ12,11はブロツ
ク化する単位が32×32であるので下位5ビツトが
ブロツク内アドレス部であり、下位5ビツトを除
いた上位がブロツクアドレス部である。添字寸法
を保持するレジスタ14には添字iの寸法128
を32で割つた商を切上げた値4をセツトする。二
次元配列の場合、添字寸法jは必要ない。
FIG. 3 shows a method of mapping a two-dimensional array to a one-dimensional storage space using the block mapping method. In FIG. 3, when converting a two-dimensional array into one-dimensional array, the value 0 is set in the input register 13. Also, the input register 14 is set to the value 1. That is, for a reference to array element A(i, j), input register 11 has array index j, input register 12
Set the value of array index i to input register 15.
The value obtained by dividing the subscript dimension of subscript i by 2 to the N power and rounding it up is used. In this case, the lower N bits of the output register 22 have no meaning, so
Before calculating the one-dimensional address to be obtained from the one-dimensional address at the subscript level, it is necessary to shift N bits to the right. Array A (1:128, 1:128)::
When A(i, j) is referenced in a state where A(i, j) is blocked in 32×32 for 4, the increment i- from the lower limit value of subscripts i, 1, set j-1. Since the registers 12 and 11 that hold the subscript values of each dimension are divided into blocks of 32×32, the lower 5 bits are the intra-block address part, and the upper part excluding the lower 5 bits is the block address part. The register 14 that holds subscript dimensions has the dimension 128 of subscript i.
Divide by 32, round up the quotient, and set the value 4. In the case of a two-dimensional array, the subscript dimension j is not necessary.

次に、装置を動作させることにより出力レジス
タ22に結果が得られる。出力レジスタ22のブ
ロツクアドレス部は、添字寸法iを保持するレジ
スタ12の値に添字値jの値を保持するレジスタ
11のブロツクアドレス部を掛けた値に、添字値
iの値を保持するレジスタのブロツクアドレスを
加算したものである。他方、出力レジスタ22の
ブロツク内アドレス部は、添字値jの値を保持す
るレジスタ11のブロツク内アドレス部と、この
値に添字値iの値を保持するレジスタ12のブロ
ツク内アドレス部を加算した値(あふれは捨て
る)を直列に並べたものである。
The result is then obtained in the output register 22 by operating the device. The block address part of the output register 22 is the value obtained by multiplying the value of the register 12 holding the subscript size i by the block address part of the register 11 holding the value of the subscript value j, and the value of the register holding the value of the subscript value i. This is the sum of block addresses. On the other hand, the intra-block address section of the output register 22 is obtained by adding the intra-block address section of the register 11 that holds the value of subscript value j and the intra-block address section of register 12 that holds the value of subscript value i to this value. It is a series of values (overflows are discarded).

最後に出力レジスタ22に得られた値は添字レ
ベルの一次元アドレスであるので、さらに演算処
理装置により、配列要素の占める記憶サイズ4と
出力レジスタ22の値を掛け、さらに配列Aの起
点アドレスbを加算することにより求める一次元
アドレスが生成される。
Since the value finally obtained in the output register 22 is a one-dimensional address at the subscript level, the arithmetic processing unit further multiplies the storage size 4 occupied by the array element by the value in the output register 22, and then multiplies the value in the output register 22, and then the starting address b of the array A. The desired one-dimensional address is generated by adding .

また、四次元以上の配列を写像する場合である
が、この場合は配列添字を三次元単位に区切りブ
ロツク化し、その合成には従来の方法を用いるこ
ともできる。すなわち、配列A(i,j,k,1)
に対してはこれをA(ijk,1)とみなし、添字
ijkの算出に本装置を用い、添字ijkと1の合成に
は従来方法でこれを行なう。
Furthermore, in the case of mapping an array of four dimensions or more, in this case, the array subscripts can be divided into three-dimensional units and made into blocks, and a conventional method can be used for composing them. That is, array A(i, j, k, 1)
, consider this as A(ijk, 1) and subscript
This device is used to calculate ijk, and the conventional method is used to combine the subscript ijk and 1.

〔発明の効果〕〔Effect of the invention〕

以上述べたように、本発明は多次元配列の一次
元記憶空間への写像/参照をブロツク化写像法式
により行なうことで、ページング方式による仮想
記憶システムの主記憶−二次記憶装置間のページ
転送回数を低減することができる。ブロツク化写
像方式は、参照する配列要素を指す各次元の添字
値を保持するレジスタと各次元の添字寸法を保持
するレジスタを有し、添字値を保持するレジスタ
のブロツクアドレス部と添字寸法を示すレジスタ
の積和から一次元記憶空間のブロツクアドレスを
生成し、添字値を保持するレジスタのブロツク内
アドレス部の加算結果から一次元記憶空間のブロ
ツク内アドレスを生成する。多次元配列のブロツ
ク化アドレツシング装置を計算機の演算処理装置
内に設けることにより、バンク衝突を避けるとと
もに、従来の写像方式と同程度の時間コストによ
り写像することが可能である。
As described above, the present invention performs mapping/reference to a one-dimensional storage space of a multidimensional array using a blocking mapping method, thereby transferring pages between the main memory and secondary storage of a virtual storage system using a paging method. The number of times can be reduced. The block mapping method has a register that holds the subscript value of each dimension that points to the array element to be referenced, and a register that holds the subscript size of each dimension, and indicates the block address part and subscript size of the register that holds the subscript value. A block address in the one-dimensional storage space is generated from the sum of products of the registers, and an intra-block address in the one-dimensional storage space is generated from the addition result of the intra-block address portion of the register that holds the subscript value. By providing a blocking addressing device for a multidimensional array in the arithmetic processing unit of a computer, it is possible to avoid bank collisions and perform mapping at the same time cost as the conventional mapping method.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の一実施例により三次元配列を
一次元記憶空間にブロツク化写像する装置を示す
図、第2図は複数バンクからなる主記憶装置にブ
ロツク化写像した場合を示す図、第3図はブロツ
ク化写像法により二次元配列を一次元記憶空間に
写像する方式を示す図、第4図は従来の方式によ
り二元配列を一次元記憶空間に写像する方式を示
す図、第5図は本発明の一実施例による多次元配
列を一次元記憶空間にブロツク化写像する装置を
示す図である。 11,12,13……配列添字を保持するレジ
スタ、14,15……入力レジスタ、16,17
……掛け算器、18,19……全加算器、20,
21……加算器、22……出力レジスタ。
FIG. 1 is a diagram showing an apparatus for mapping a three-dimensional array into a one-dimensional storage space into blocks according to an embodiment of the present invention, and FIG. 3 is a diagram showing a method of mapping a two-dimensional array to a one-dimensional storage space using the block mapping method, FIG. 4 is a diagram showing a method of mapping a two-dimensional array to a one-dimensional storage space using a conventional method, and FIG. FIG. 5 is a diagram showing an apparatus for mapping a multidimensional array into a one-dimensional storage space into blocks according to an embodiment of the present invention. 11, 12, 13...Register that holds array index, 14, 15...Input register, 16, 17
... Multiplier, 18, 19 ... Full adder, 20,
21... Adder, 22... Output register.

Claims (1)

【特許請求の範囲】 1 多次元配列データを一次元アドレス空間に写
像/参照するブロツク化アドレツシング装置にお
いて、 配列要素A(I1,I2,……Io)を指す各次元の添
字値Ii(O≦Ii≦di−1:1≦i≦n)を保持する
n個の添字値レジスタと、各次元の添字寸法di
(1≦i≦n−1)を2Nで割算を行い商が2のべ
き数となるように切上げたブロツク添字寸方法
RMi(1≦i≦(n−1)を保持するn−1個の添
字寸法レジスタと、 前記添字値レジスタの上位N−1ビツトのブロ
ツクアドレス部RBi(1≦i≦n)と、前記添字
寸法レジスタのブロツク添字寸法値RMiから一次
元記憶空間のブロツクアドレスとしてRB1
RM1×(RB2+RM2×(……(RMo-1×RBo)…
…)を演算するブロツクアドレス演算手段と 前記添字値レジスタの下位Nビツト列のブロツ
ク内アドレス部RIi(1≦i≦n)のn個のビツト
列からRIo、(RIo+RIo-1)、(RIn+RIo-1+RIo-2
……(RIn+……+RI1)のn個の演算値を求め、
演算結果の下位Nビツト列を並べて一次元記憶空
間のブロツク内アドレスを生成するブロツク内ア
ドレス生成手段と、 前記ブロツクアドレス演算手段と前記ブロツク
内アドレス生成手段とに接続される一次元アドレ
スを保持する出力レジスタとから構成されること
を特徴とする多次元配列のブロツク化アドレツシ
ング装置。
[Scope of Claims] 1. In a blocking addressing device that maps/references multidimensional array data to a one-dimensional address space, a subscript value I of each dimension pointing to array element A (I 1 , I 2 , ... I o ) i (O≦I i ≦d i −1:1≦i≦n) and the subscript size d i of each dimension.
Block subscript size method that divides (1≦i≦n-1) by 2 N and rounds up so that the quotient becomes a power of 2.
RM i (n-1 subscript size registers holding 1≦i≦(n-1); a block address part RB i (1≦i≦n) of the upper N-1 bits of the subscript value register; From the block index dimension value RM i of the index dimension register, RB 1 + as the block address of the one-dimensional storage space.
RM 1 × (RB 2 + RM 2 × (... (RM o-1 × RB o )...
...) from the n bit strings of the block internal address part RI i (1≦i≦n) of the lower N bit strings of the subscript value register, RI o , (RI o +RI o-1 ), (RIn+RI o-1 +RI o-2 )
Find n calculated values of (RIn+...+RI 1 ),
an intra-block address generating means for arranging the lower N bit strings of the operation results to generate an intra-block address in a one-dimensional storage space; and holding a one-dimensional address connected to the block address arithmetic means and the intra-block address generating means. 1. A multidimensional array blocking addressing device comprising: an output register;
JP61078655A 1986-04-04 1986-04-04 Blocking addressing device for multidimensional arrangement Granted JPS62235659A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP61078655A JPS62235659A (en) 1986-04-04 1986-04-04 Blocking addressing device for multidimensional arrangement

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP61078655A JPS62235659A (en) 1986-04-04 1986-04-04 Blocking addressing device for multidimensional arrangement

Publications (2)

Publication Number Publication Date
JPS62235659A JPS62235659A (en) 1987-10-15
JPH0559453B2 true JPH0559453B2 (en) 1993-08-31

Family

ID=13667873

Family Applications (1)

Application Number Title Priority Date Filing Date
JP61078655A Granted JPS62235659A (en) 1986-04-04 1986-04-04 Blocking addressing device for multidimensional arrangement

Country Status (1)

Country Link
JP (1) JPS62235659A (en)

Also Published As

Publication number Publication date
JPS62235659A (en) 1987-10-15

Similar Documents

Publication Publication Date Title
EP0739513B1 (en) Method of transmitting of data
US6381668B1 (en) Address mapping for system memory
Parsons et al. A++/P++ array classes for architecture independent finite difference computations
JPH06318154A (en) Method for minimizing necessity of arithmetic operation and resultant cache therefor
US6128639A (en) Array address and loop alignment calculations
JPH0812636B2 (en) Virtual memory control type computer system
KR100474357B1 (en) A method for memory allocation using multi-level partition
JPH06162227A (en) Vector parallel computer
US5900023A (en) Method and apparatus for removing power-of-two restrictions on distributed addressing
CA1115425A (en) Data processor with address extension
JP2814860B2 (en) Image scaling device
JPH0559453B2 (en)
Harper A multiaccess frame buffer architecture
EP0313787A2 (en) A hardware mechanism for the dynamic customization of permutation using bit-matrix multiplication
EP0888586B1 (en) Array indexing
JPH0289132A (en) Logical address generation system
JPH0214364A (en) Mapping and referring system for multi-dimensional arrangement to one-dimensional storing space
JPH0559454B2 (en)
Ye et al. High-performance NTT architecture for large integer multiplication
JPH0522238B2 (en)
Parkinson 12 Practical parallel processors and their uses
JP2806262B2 (en) Process allocation method for multiprocessor system
Moskowitz et al. An algebraic memory model
Lenfant Fast random and sequential access to dynamic memories of any size
JPH0331967A (en) Vector processor