JPH09114733A - Non-aligned data transfer mechanism in cache storage device - Google Patents

Non-aligned data transfer mechanism in cache storage device

Info

Publication number
JPH09114733A
JPH09114733A JP7318656A JP31865695A JPH09114733A JP H09114733 A JPH09114733 A JP H09114733A JP 7318656 A JP7318656 A JP 7318656A JP 31865695 A JP31865695 A JP 31865695A JP H09114733 A JPH09114733 A JP H09114733A
Authority
JP
Japan
Prior art keywords
byte
data
cache
address
cache memory
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.)
Pending
Application number
JP7318656A
Other languages
Japanese (ja)
Inventor
Atsushi Torii
淳 鳥居
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
NEC Corp
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 NEC Corp filed Critical NEC Corp
Priority to JP7318656A priority Critical patent/JPH09114733A/en
Publication of JPH09114733A publication Critical patent/JPH09114733A/en
Pending legal-status Critical Current

Links

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Abstract

PROBLEM TO BE SOLVED: To transfer non-aligned data between a cache and a register. SOLUTION: Two cache memories 10a and 10b for holding the copy of the main storage of addresses whose lower fifth bit is an odd number and an even number in terms of line units are provided and the respective cache memories 10a and 10b output a byte string for one word corresponding to the value of the lower four bits of the inputted address in a hit line. A data selector 42 selects one of outputs for respective bytes and outputs it to a general purpose register 21 based on byte selection signals 40. Based on the value of the lower five bits of a reference address 22, a cache selector 36 controls the independent operation of the cache memory 10a or the cache memory 10b by the reference address 22 or the parallel operation of the operation of the cache memory 10a by the reference address 22 and the operation of the cache memory 10b by the reference address 22 or the reference address for which '1' is added to the fifth bit in it and generates the byte selection signals 40.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は画像処理や符号化処
理などを行うマイクロプロセッサに関し、特に汎用レジ
スタとの間で非整列データを転送するキャッシュ記憶装
置における非整列データ転送機構に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microprocessor for performing image processing and encoding processing, and more particularly to a non-aligned data transfer mechanism in a cache storage device for transferring non-aligned data with a general-purpose register.

【0002】[0002]

【従来の技術】実画像処理やコンピュータグラフィック
ス処理を行う場合には、低精度演算を数多く行う必要が
生じる場合がある。このような演算には汎用マイクロプ
ロセッサの持つ算術論理演算装置の演算精度を必要とし
ない場合が多く、演算装置を有効利用しているとは言い
難かった。この問題に対して、演算装置を分割して複数
の低精度演算を同時に行う手法が提案され、SUN M
icrosystemsのUltra SPARCなど
幾つかのマイクロプロセッサに採用されている。このよ
うな低精度並列演算命令を利用する場合、計算に必要な
データの開始アドレスは動的に変化する場合が多く、デ
ータの先頭アドレスがワード単位のアドレスになるとは
限らない。このように先頭アドレスがワード単位のアド
レスとならないデータを非整列データと呼ぶ。しかしな
がら、マイクロプロセッサ、特にRISCプロセッサで
はレジスタ長に合ったワード単位のアドレスの場合にデ
ータを効率的にロード,ストアできる構造になってお
り、非整列データをロード,ストアする場合には、特別
な命令や処理が必要となる場合が多く、低精度並列演算
命令を必ずしも効率的に用いることはできなかった。
2. Description of the Related Art When performing real image processing or computer graphics processing, it may be necessary to perform many low-precision calculations. Such an operation often does not require the operation accuracy of the arithmetic logic operation unit of a general-purpose microprocessor, and it is difficult to say that the operation unit is effectively used. To solve this problem, a method has been proposed in which an arithmetic unit is divided and a plurality of low-precision arithmetic operations are simultaneously performed.
It is used in some microprocessors such as the UltraSPARC from the Microsystems. When such a low-precision parallel operation instruction is used, the start address of the data required for calculation often changes dynamically, and the start address of the data is not always an address in word units. Data in which the start address is not a word unit address is called unaligned data. However, a microprocessor, especially a RISC processor, has a structure that can efficiently load and store data in the case of an address in word units that matches the register length, and when loading and storing unaligned data, it is special. In many cases, instructions and processing are required, and low-precision parallel operation instructions cannot always be used efficiently.

【0003】例えば、MIPS Technology
Inc.のR3000,R4000などの命令セット
には、lwl(Load Word Left),lw
r(Load Word Right),swl(St
ore Word Left),swr(Store
Word Right)という命令が定義されている
(“MIPS RISC Architectur
e”,Prentice Hall,pp.A−42〜
A−45,pp.A−76〜A−79)。この命令を組
み合わせて用いることによって、非整列データのロー
ド,ストアを実現することができる。lwl命令は、メ
モリ内の指定されたバイトをレジスタの最右端バイトに
ロードし、メモリ内ワードとレジスタ内ワードの下位バ
イトの方に向かって順にデータのロードを行い、メモリ
内のワードの最下位バイトまで同様の処理を行う命令で
ある。また、lwrはその逆で最左端バイトから上位バ
イトに向かってロードを行う命令である。従って、メモ
リのワード単位を境界に2命令を用いて境界より上位、
下位のデータをロードすることになる。レジスタの内容
をメモリに書き戻すswl,swr命令も同様である。
For example, MIPS Technology
Inc. R3000, R4000 and other instruction sets include lwl (Load Word Left), lw
r (Load Word Right), swl (St
ore Word Left), swr (Store
An instruction called "Word Right" is defined ("MIPS RISC Architecture").
e ", Prentice Hall, pp. A-42.
A-45, pp. A-76 to A-79). By using this instruction in combination, loading and storing of unaligned data can be realized. The lwl instruction loads the specified byte in memory into the rightmost byte of a register, loads the data sequentially toward the word in memory and the low byte of the word in register, and then loads the least significant byte of the word in memory. This is an instruction that performs the same processing up to bytes. On the other hand, lwr is an instruction to load from the leftmost byte to the upper byte. Therefore, using two instructions with the word unit of the memory as the boundary,
The lower data will be loaded. The swl and swr instructions for writing back the contents of the register to the memory are similar.

【0004】このような命令を備えた従来のマイクロプ
ロセッサにおけるキャッシュ記憶装置の構成例と汎用レ
ジスタとの接続例を図8に示す。なお、同図に示す例で
は、汎用レジスタ21は、32ビット4バイト長であ
り、1ワード4バイトのアーキテクチャに対応してい
る。
FIG. 8 shows a configuration example of a cache memory device in a conventional microprocessor having such an instruction and a connection example of a general-purpose register. In the example shown in the figure, the general-purpose register 21 has a length of 32 bits and 4 bytes, and corresponds to an architecture of 1 word and 4 bytes.

【0005】キャッシュメモリ10’はデータ用のキャ
ッシュメモリであり、例えば16バイト(4ワード)容
量のデータメモリアレイ11,タグメモリアレイ12お
よび有効ビット13の組を複数個有するメモリ部と、そ
れ以外の制御部、つまり、キャッシュメモリ10’に与
えられる参照アドレス22中のインデックスアドレス2
4に基づいてメモリ部中の該当する組を選択するデコー
ダ14,選択された組のデータメモリアレイからデータ
線16を通じて出力されるデータをワード単位で選択す
る合計4個のスイッチゲート26’,参照アドレス22
中のワード・バイトアドレス25に基づいてスイッチゲ
ート16’を制御するセレクタ17’,参照アドレス2
2中のタグアドレス23と上記選択された組のタグメモ
リアレイ12の内容とを比較するアドレスコンパレータ
18,このアドレスコンパレータ18の出力と上記選択
された組の有効ビット13とに基づいてヒットミス結果
信号20を出力する有効判定器19,各スイッチゲート
26’の各バイト出力に接続される4本のデータ線27
a〜27d,これらのデータ線27a〜27dに接続さ
れたセンスアンプ32,ストアデータがセットされるラ
イトセル44とを含む制御部とで構成される。
The cache memory 10 'is a cache memory for data, and has, for example, a memory section having a plurality of sets of a data memory array 11, a tag memory array 12, and an effective bit 13 each having a capacity of 16 bytes (4 words), and other than that. Control unit, that is, the index address 2 in the reference address 22 given to the cache memory 10 '.
Decoder 14 for selecting the corresponding set in the memory unit based on 4 and a total of four switch gates 26 'for selecting the data output from the data memory array of the selected set through the data line 16 in word units. Address 22
Selector 17 'for controlling the switch gate 16' based on the word / byte address 25 therein, reference address 2
Address comparator 18 for comparing the tag address 23 in 2 with the contents of the tag memory array 12 of the selected set, and the hit-miss result based on the output of the address comparator 18 and the valid bit 13 of the selected set. A validity determiner 19 for outputting a signal 20 and four data lines 27 connected to each byte output of each switch gate 26 '.
a-27d, a sense amplifier 32 connected to these data lines 27a-27d, and a control unit including a write cell 44 in which store data is set.

【0006】参照アドレス22が与えられてキャッシュ
メモリ10’にロード要求が出されると、デコーダ14
は参照アドレス22のインデックスアドレス24を参照
して、メモリ部中の該当する組を選択する。図8の例で
は、網かけを施した組が選択されている。他方、アドレ
スコンパレータ18は、参照アドレス22のタグアドレ
ス23と上記選択された組のタグメモリアレイ12から
の出力とを比較し、上記選択されたデータメモリアレイ
15の内容が参照アドレス22に対応する内容であるか
否かを調べる。そして、このアドレスコンパレータ18
の判定結果と上記選択された組の有効ビット13とから
上記データメモリアレイ15の内容が有効か無効かを有
効判定器19で判定し、その判定結果をヒットミス結果
信号20として出力する。セレクタ17’は、図9に示
すように、参照アドレス22中の2ビット(A3,A
2)をワード・バイトアドレス25として入力し、それ
をデコードした結果でスイッチゲート26’の何れかを
アクティブにするデコーダ30で構成されており、該当
ラインの内容が有効で参照アドレス22と一致した場合
には、ワード・バイトアドレス25に対応する1つのス
イッチゲート26’をアクティブにする。そして、この
スイッチゲート26’で選択されたデータメモリアレイ
15の右側の4バイトから構成される1ワードがデータ
線27a〜27dを介し、センスアンプ32で増幅され
てリードデータ線35に出力される。
When the reference address 22 is given and a load request is issued to the cache memory 10 ', the decoder 14
Refers to the index address 24 of the reference address 22 and selects the corresponding set in the memory section. In the example of FIG. 8, a shaded group is selected. On the other hand, the address comparator 18 compares the tag address 23 of the reference address 22 with the output from the tag memory array 12 of the selected set, and the content of the selected data memory array 15 corresponds to the reference address 22. Check whether the contents. Then, this address comparator 18
Based on the result of the determination and the valid bit 13 of the selected group, the validity determiner 19 determines whether the contents of the data memory array 15 are valid or invalid, and outputs the determination result as a hit-miss result signal 20. As shown in FIG. 9, the selector 17 ′ has two bits (A 3, A 3) in the reference address 22.
2) is inputted as a word / byte address 25, and it is constituted by a decoder 30 which activates one of the switch gates 26 'according to the result of decoding, and the content of the corresponding line is valid and coincides with the reference address 22. In the case, one switch gate 26 'corresponding to the word byte address 25 is activated. Then, one word composed of 4 bytes on the right side of the data memory array 15 selected by the switch gate 26 ′ is amplified by the sense amplifier 32 via the data lines 27 a to 27 d and output to the read data line 35. .

【0007】さて、前述したlwl,lwr命令を実行
するために、キャッシュメモリ10’と汎用レジスタ2
1との間に、図8に示すようにリードデータ整列装置7
0とデータ選択装置71とが備えられる。リードデータ
整列装置70は、メモリ内の指定されたデータを上位バ
イトや下位バイトにそろえる役割を担う。例えば、[1
5−8]ビットに位置するバイトデータを[31−2
4]ビットの位置に直す処理を行う。また、データ選択
装置71は、lwl,lwrによって書き込みが生じな
いバイトフィールドに対しては、汎用レジスタに格納さ
れた値を保持するために汎用レジスタ21からのバイト
データを選択し、書き込みが生じるバイトフィールドに
はリードデータ整列装置70からのバイトデータを選択
する処理を行う。このような装置によって、非整列デー
タのロードを2命令、すなわち2命令サイクルを用いて
実現することができる。
Now, in order to execute the above-mentioned lwl and lwr instructions, the cache memory 10 'and the general-purpose register 2 are used.
1 and the read data alignment device 7 as shown in FIG.
0 and a data selection device 71 are provided. The read data alignment device 70 plays a role of aligning designated data in the memory with upper bytes and lower bytes. For example, [1
Byte data located at 5-8] bits is converted to [31-2]
4] Perform processing to restore the bit position. Further, the data selection device 71 selects the byte data from the general-purpose register 21 to hold the value stored in the general-purpose register for the byte field in which writing is not caused by lwl and lwr, and the byte in which the writing occurs. For the field, processing for selecting byte data from the read data alignment device 70 is performed. With such a device, loading of unaligned data can be realized using two instructions, that is, two instruction cycles.

【0008】なお、ストアオペレーションの場合、スト
アすべき入力データがライトデータ整列装置72を通じ
てライトデータ線34から、また入力データの大きさ
(1バイト,ハーフワード,1ワード)が入力データサ
イズ情報線33からキャッシュメモリ10’に入力さ
れ、ライトセル44中のセレクタ17’の出力および入
力データサイズ情報線33の出力で選択された何れかの
ワード位置にセットされ、キャッシュヒット時に、該当
するデータメモリアレイ15の該当するワード位置に書
き込まれる。
In the case of the store operation, the input data to be stored is from the write data line 34 through the write data alignment device 72, and the size of the input data (1 byte, half word, 1 word) is the input data size information line. 33 is input to the cache memory 10 ′ and is set to any word position selected by the output of the selector 17 ′ in the write cell 44 and the output of the input data size information line 33. It is written to the appropriate word position in array 15.

【0009】しかしながら、マイクロプロセッサの動作
周波数が向上するのに伴い、リードデータ整列装置7
0,ライトデータ整列装置72,データ選択装置71を
含めた動作を、マイクロプロセッサの処理の基本的な時
間単位である1サイクル中に行うのは困難になってき
た。そこで、例えばDigital Equipmen
tCorporationのAlphaアーキテクチャ
では、高い動作周波数を実現するために非整列データの
ロード,ストアだけでなく、バイトロード,ストア等を
命令セットとして定義しておらず、このため、リードデ
ータ整列装置70,ライトデータ整列装置72,データ
選択装置71が不要となり、高い動作周波数を実現して
いる。
However, as the operating frequency of the microprocessor is improved, the read data alignment device 7
It has become difficult to perform the operations including 0, the write data alignment device 72, and the data selection device 71 within one cycle which is a basic time unit of the processing of the microprocessor. So, for example, Digital Equipment
The tCorporation Alpha architecture does not define not only load and store of unaligned data but also byte load, store, etc. as an instruction set in order to realize a high operating frequency. Therefore, the read data alignment device 70, write The data aligning device 72 and the data selecting device 71 are not required, and a high operating frequency is realized.

【0010】また、キャッシュメモリを介さないで、直
接マイクロプロセッサのレジスタあるいは演算器とメモ
リを接続する形態においては、1命令で非整列データの
ロード,ストアを実現する機構が例えば特開平4−35
9334号公報において提案されている。図10にその
構成例を示す。同図において、マイクロプロセッサ87
がデータの先頭アドレスAを出力すると、アドレスイン
クリメント信号生成ブロック82は、アドレスAの下位
ビット83,84とバイトコントロール信号80a〜8
0dを用いて、メモリブロック88に対するアドレスイ
ンクリメント信号81a〜81cを生成する。メモリブ
ロック88は、アドレスインクリメント信号81a〜8
1cが入力された場合、指定されたアドレスより1加算
されたアドレス領域をアクセスする。これによって、1
度のバスサイクルで非整列データをロード,ストアする
ことを可能にしている。
Further, in a mode in which the register or arithmetic unit of the microprocessor is directly connected to the memory without passing through the cache memory, a mechanism for realizing loading and storing of unaligned data with one instruction is disclosed in, for example, Japanese Patent Laid-Open No. 4-35.
It is proposed in Japanese Patent No. 9334. FIG. 10 shows an example of the configuration. In the figure, a microprocessor 87
When the head address A of the data is output, the address increment signal generation block 82 causes the lower bits 83 and 84 of the address A and the byte control signals 80a-8.
0d is used to generate address increment signals 81a to 81c for the memory block 88. The memory block 88 has address increment signals 81a-8.
When 1c is input, the address area obtained by adding 1 to the specified address is accessed. This gives 1
It makes it possible to load and store unaligned data in every bus cycle.

【0011】[0011]

【発明が解決しようとする課題】このように、非整列デ
ータのロード,ストアは低精度並列演算命令などを用い
る場合には必須の機能であるが、実現には2命令サイク
ル必要となり、かつ動作周波数向上の妨げになる可能性
が大きいという問題があった。また、ロードデータ,ス
トアデータが整列データであるか、非整列データである
かが実行時にならないと決定できない場合には、条件判
断を行ったり非整列データとみなして処理を行う必要が
あった。
As described above, the loading and storing of unaligned data is an essential function when using a low-precision parallel operation instruction, etc., but it requires two instruction cycles to operate and operation. There is a problem that there is a great possibility that it will hinder the improvement of the frequency. Further, when it is not possible to determine whether the load data and the store data are the aligned data or the unaligned data only at the time of execution, it is necessary to judge the condition or to treat the data as the unaligned data.

【0012】また、直接メモリを接続する手法は、マイ
クロプロセッサ内外にキャッシュメモリを置いてデータ
を一括してロード,ストアして主記憶装置のレイテンシ
を隠蔽する方法には対応しておらず、現状の高速マイク
ロプロセッサの使用方法には適合しないという問題点が
あった。
Further, the method of directly connecting the memory does not correspond to the method of placing the cache memory inside and outside the microprocessor to load and store the data all at once to hide the latency of the main storage device. There is a problem that it is not suitable for the usage of the high speed microprocessor.

【0013】本発明の目的は、汎用プロセッサに広く使
用されているキャッシュメモリに拡張を施し、キャッシ
ュと汎用レジスタとの間で非整列データを効率良く転送
できる機構を提供することによって、これらの問題を解
決することにある。
It is an object of the present invention to extend these cache memories, which are widely used in general-purpose processors, to provide a mechanism for efficiently transferring non-aligned data between the cache and general-purpose registers. To solve.

【0014】[0014]

【課題を解決するための手段】本発明においては、従来
ワード単位でデータを選択していたキャッシュメモリに
おけるセレクタを拡張し、キャッシュ内で全てのアドレ
ス部分をデコードすることによって、バイト単位でデー
タをセレクトできるようにしている。これによって、1
ライン間における非整合データのロード,ストアが可能
になる。また、非整合データがキャッシュのラインを跨
がって存在する場合にも対処するために、一つの構成に
あっては、キャッシュライン内のデータを特定するビッ
トより1ビット上位のアドレスビットが偶数用のキャッ
シュメモリと奇数用のキャッシュメモリとを用意し、キ
ャッシュラインを跨がる場合には、両者のキャッシュを
同時にアクセスして、ロードの場合には各々から出力さ
れたデータを、ストアの場合には各々へ入力するデータ
をバイト単位で選択することによって解決している。ま
た、他の構成にあっては、キャッシュを複数ポート構成
にして複数ライン同時にアクセス可能な構成とし、ロー
ドの場合には各々から出力されたデータを、ストアの場
合には各々へ入力するデータをバイト単位で選択するこ
とによって解決している。以下に図面を参照して本発明
をより具体的に詳述するが、以下の開示は本発明の一実
施例に過ぎず、本発明の技術的範囲を何ら限定するもの
ではない。
According to the present invention, a selector in a cache memory, which conventionally selects data in word units, is expanded, and all address parts are decoded in the cache, so that data can be stored in byte units. I am able to select. This gives 1
Inconsistent data can be loaded and stored between lines. In addition, in order to deal with the case where the non-matching data exists across the cache line, in one configuration, the address bit that is one bit higher than the bit that identifies the data in the cache line is an even number. If a cache memory for odd numbers and a cache memory for odd numbers are prepared and both cache lines are crossed, both caches are accessed at the same time, and in the case of loading, the data output from each is stored, and in the case of storing Is solved by selecting the data to be input to each in byte units. In other configurations, the cache is configured with multiple ports so that multiple lines can be accessed at the same time. In the case of a load, the data output from each is stored, and in the case of a store, the data input to each is stored. It is solved by selecting in byte units. Hereinafter, the present invention will be described in more detail with reference to the drawings. However, the following disclosure is merely an example of the present invention, and does not limit the technical scope of the present invention.

【0015】[0015]

【発明の実施の形態】図1は本発明のキャッシュ記憶装
置の一実施例のブロック図である。この例のキャッシュ
記憶装置は、奇数ライン用のキャッシュメモリ10a
と、偶数ライン用のキャッシュメモリ10bと、データ
セレクタ42と、ヒットミス判定装置41と、加算器4
5と、これらを制御するキャッシュセレクタ36とから
その主要部が構成されている。なお、21はキャッシュ
記憶装置から読み出されたデータあるいはキャッシュ記
憶装置に書き込むべきデータを保持する汎用レジスタで
あり、この例では32ビット4バイト長の容量を有し、
1ワード4バイトのアーキテクチャに対応する。また、
22はロード要求あるいはストア要求にかかる参照アド
レスであり、この例では32ビットで構成されている。
この参照アドレス22は、下位4ビットがワード・バイ
トアドレス25として、下位5ビット目の1ビットが奇
数偶数選択ビット37として、下位6ビット目〜最上位
ビット目までのビット列は二分され、上位側がタグアド
レス23として、下位側がインデックスアドレス24と
して、それぞれ図示する如く各部に分配されて使用され
る。
1 is a block diagram of an embodiment of a cache storage device according to the present invention. The cache memory device of this example is a cache memory 10a for odd lines.
A cache memory 10b for even lines, a data selector 42, a hit / miss determination device 41, and an adder 4
5 and a cache selector 36 for controlling them, a main part thereof is configured. Reference numeral 21 is a general-purpose register that holds data read from the cache storage device or data to be written in the cache storage device, and has a capacity of 32 bits and 4 bytes in this example.
It corresponds to the architecture of 1 word 4 bytes. Also,
Reference numeral 22 is a reference address related to the load request or the store request, and is composed of 32 bits in this example.
In this reference address 22, the lower 4 bits are the word / byte address 25, the 1st bit of the lower 5th is the odd / even selection bit 37, and the bit string from the lower 6th bit to the most significant bit is divided into two, and the upper side is As the tag address 23, the lower side is used as the index address 24, which is distributed and used in each unit as shown in the drawing.

【0016】奇数ライン用のキャッシュメモリ10a
は、下位5ビット目が奇数(すなわち1)になるアドレ
スの主記憶の写しをライン単位で保持するためのキャッ
シュメモリ、偶数ライン用キャッシュメモリ10bは、
その反対に、下位5ビット目が偶数(すなわち0)にな
るアドレスの主記憶の写しをライン単位で保持するため
のキャッシュメモリである。何れのキャッシュメモリ1
0a,10bも、キャッシュヒット時には、ロードオペ
レーション時にあっては、ヒットしたラインのうち、入
力されたアドレスの下位4ビット(すなわちワード・バ
イトアドレス25)が指し示すバイトを先頭とする1ワ
ード長分バイト列を出力する機能,ストアオペレーショ
ン時にあっては、入力されたアドレスの下位4ビット
(すなわちワード・バイトアドレス25)の値,入力デ
ータサイズ情報線33からの入力データサイズ情報およ
びバイト選択信号40に応じて、汎用レジスタ21から
バイト単位で選択的に入力データを内部のライトセルに
セットした後、ヒットしたライン中の該当するバイト位
置へ選択的に書き込む機能を有している。
Cache memory 10a for odd lines
Is a cache memory for holding a copy of the main memory of an address in which the lower 5th bit is an odd number (that is, 1), and the even line cache memory 10b is
On the contrary, it is a cache memory for holding a copy of the main memory at an address where the lower 5th bit becomes an even number (that is, 0) in units of lines. Which cache memory 1
For 0a and 10b, at the time of a cache hit, at the time of a load operation, one word length byte starting from the byte indicated by the lower 4 bits of the input address (that is, word / byte address 25) in the hit line The function of outputting a column, the value of the lower 4 bits of the input address (that is, the word / byte address 25), the input data size information from the input data size information line 33, and the byte selection signal 40 during the store operation Accordingly, it has a function of selectively setting the input data from the general-purpose register 21 in a byte unit to the internal write cell and then selectively writing to the corresponding byte position in the hit line.

【0017】図2にキャッシュメモリ10a,10bの
構成例を、図3にその一部のより詳細な構成例を示す。
図2および図3において、11は、主記憶の写しをライ
ン単位(即ち、この例では4ワード単位)で保持するデ
ータメモリアレイであり、4ワード16バイト容量のも
のが複数個用意されている。各データメモリアレイ11
中の各バイトの識別は参照アドレス22の下位4ビッ
ト、つまりワード・バイトアドレス25で行われる。各
データメモリアレイ11中の同じバイト位置の読み出し
書き込みは、共通のデータ線16を通じて行うことがで
き、これらの共通のデータ線16は合計16個のスイッ
チゲート26および16バイト4ワード長のライトセル
44の各バイト位置に接続され、またスイッチゲート2
6は、各々1バイト幅の4本(ワードを構成するバイト
数に等しい本数)のデータ線27a,27b,27c,
27dと同図の実線および破線に示すような関係で接続
されている。即ち、スイッチゲート26を介して、同一
データメモリアレイ中の任意のバイト位置を先頭とする
連続する4バイト(1ワード)のデータがそれぞれ別々
のデータ線27a,27b,27c,27dに取り出せ
るようにしている。更に、各データ線27a,27b,
27c,27dにはセンスアンプ32が接続され、セン
スアンプ32にはリードデータ線35が接続されてい
る。また、ライトセル44には、ライトデータ線34上
のデータをセットするか否かを制御するゲート48が各
バイト毎に設けられ、このゲート48に入力データサイ
ズ情報線33,セレクタ17の出力およびバイト選択信
号40が入力されている。なお、各データメモリアレイ
11には、それに対応するタグメモリアレイ12と有効
ビット13とが設けられる。
FIG. 2 shows a configuration example of the cache memories 10a and 10b, and FIG. 3 shows a more detailed configuration example of a part thereof.
In FIGS. 2 and 3, reference numeral 11 denotes a data memory array for holding a copy of the main memory in line units (that is, in units of 4 words in this example), and a plurality of 4-word 16-byte capacity memories are prepared. . Each data memory array 11
The identification of each byte therein is performed by the lower 4 bits of the reference address 22, that is, the word byte address 25. Reading and writing of the same byte position in each data memory array 11 can be performed through a common data line 16, and these common data lines 16 have a total of 16 switch gates 26 and 16-byte 4-word long write cells. Connected to each byte position of 44, and also switch gate 2
Reference numeral 6 denotes four data lines 27a, 27b, 27c, each having a 1-byte width (the number equal to the number of bytes forming a word).
27d is connected in the relationship as shown by the solid line and the broken line in FIG. That is, through the switch gate 26, continuous 4 bytes (1 word) of data starting from an arbitrary byte position in the same data memory array can be taken out to separate data lines 27a, 27b, 27c and 27d. ing. Furthermore, each data line 27a, 27b,
A sense amplifier 32 is connected to 27c and 27d, and a read data line 35 is connected to the sense amplifier 32. In addition, the write cell 44 is provided with a gate 48 for controlling whether or not to set the data on the write data line 34 for each byte, and the gate 48 has an input data size information line 33, an output of the selector 17 and The byte selection signal 40 is input. Each data memory array 11 is provided with a tag memory array 12 and a valid bit 13 corresponding to it.

【0018】他方、図2において、29は、自キャッシ
ュメモリ10に加えられるキャッシュ選択信号39(図
1の39a,39bに相当する)がアクティブである場
合に、自キャッシュメモリ10の動作を有効とし、外部
からのタグアドレス23,インデックスアドレス24,
ワード・バイトアドレス25を内部の各部に分配するイ
ネーブラである。デコーダ14は、このイネーブラ29
からインデックスアドレス24が入力されると、そのイ
ンデックスアドレスに該当するラインを保持するデータ
メモリアレイ11を検索して選択する。選択されたデー
タメモリアレイでは、ロードオペレーション時には各バ
イトのデータが読み出されてスイッチゲート26に出力
され、ストアオペレーション時には該当するバイト位置
にライトセル44中の入力データが書き込まれる。な
お、選択されたデータメモリアレイを図2では符号15
を付けて他のデータメモリアレイと区別している。
On the other hand, in FIG. 2, 29 indicates that the operation of the self cache memory 10 is valid when the cache selection signal 39 (corresponding to 39a and 39b in FIG. 1) applied to the self cache memory 10 is active. , Tag address 23 from outside, index address 24,
It is an enabler that distributes the word / byte address 25 to each internal section. The decoder 14 uses this enabler 29.
When the index address 24 is input from, the data memory array 11 holding the line corresponding to the index address is searched and selected. In the selected data memory array, the data of each byte is read and output to the switch gate 26 during the load operation, and the input data in the write cell 44 is written into the corresponding byte position during the store operation. The selected data memory array is designated by the reference numeral 15 in FIG.
To distinguish it from other data memory arrays.

【0019】セレクタ17は、イネーブラ29からワー
ド・バイトアドレス25を入力し、ロードオペレーショ
ン時には、そのワード・バイトアドレス25に応じて必
要なスイッチゲート26のみを開くことにより、デコー
ダ14で選択されたデータメモリアレイ15中のライン
における、入力されたワード・バイトアドレス25が指
し示すバイトを先頭とする1ワード長分のバイト列を、
データ線27a,27b,27c,28dに接続させ
る。また、ストアオペレーション時には、ワード・バイ
トアドレス25の値に応じて必要なゲート48に対して
のみ書き込みを許可する信号を出力し、入力データサイ
ズ情報線33の情報およびバイト選択信号40の情報と
共に、ライトセル44の必要なバイト位置にのみ入力デ
ータをセットする制御を行う。
The selector 17 inputs the word / byte address 25 from the enabler 29, and opens only the switch gate 26 necessary for the word / byte address 25 at the time of the load operation, thereby selecting the data selected by the decoder 14. A byte string for one word length starting from the byte indicated by the input word / byte address 25 in a line in the memory array 15,
The data lines 27a, 27b, 27c and 28d are connected. Further, at the time of the store operation, a signal for permitting writing is output only to the necessary gate 48 according to the value of the word / byte address 25, and together with the information of the input data size information line 33 and the information of the byte selection signal 40, Control is performed to set the input data only to the required byte position of the write cell 44.

【0020】上述のようなセレクタ17は、図3に示す
ように、4個のデコーダ30a,30b,30c,30
dと、3個の加算器31a,31b,31cと、アンド
ゲート46と、ノアゲート47とから構成されている。
デコーダ30aはワード・バイトアドレス25の上位2
ビットA3,A2をデコードして、デコーダ14によっ
て選択されたデータメモリアレイ15中の4ワード16
バイトのうち、下位アドレス0x3,7,b,fのバイ
トの何れか1つを選択すべく同図に示す位置のスイッチ
ゲート26,ゲート48を制御する。デコーダ30b
は、ワード・バイトアドレス25の上位2ビットA3,
A2の値と下位2ビットA1,A0の論理積条件値とを
加算する加算器31aから出力される2ビットをデコー
ドして、下位アドレス0x2,6,a,eのバイトの何
れか1つを選択すべく同図に示す位置のスイッチゲート
26,ゲート48を制御する。デコーダ30cは、ワー
ド・バイトアドレス25の上位2ビットA3,A2の値
と2ビット目A1の値とを加算する加算器31bから出
力される2ビットをデコードして、下位アドレス0x
1,5,9,dのバイトの何れか1つを選択すべく同図
に示す位置のスイッチゲート26,ゲート48を制御す
る。デコーダ30dは、ワード・バイトアドレス25の
上位2ビットA3,A2の値と下位2ビットA1,A0
のノア条件値とを加算する加算器31cから出力される
2ビットをデコードして、下位アドレス0x0,4,
8,cのバイトの何れか1つを選択すべく同図に示す位
置のスイッチゲート26,ゲート48を制御する。
The selector 17 as described above has four decoders 30a, 30b, 30c and 30 as shown in FIG.
d, three adders 31a, 31b, 31c, an AND gate 46, and a NOR gate 47.
The decoder 30a is the upper 2 of the word / byte address 25.
4 bits 16 in the data memory array 15 selected by the decoder 14 by decoding the bits A3 and A2
Among the bytes, the switch gate 26 and the gate 48 at the positions shown in the figure are controlled to select any one of the bytes of the lower addresses 0x3, 7, b and f. Decoder 30b
Is the upper 2 bits A3 of the word / byte address 25.
The 2 bits output from the adder 31a for adding the value of A2 and the logical product condition value of the lower 2 bits A1 and A0 are decoded, and one of the bytes of the lower addresses 0x2, 6, a, and e is decoded. The switch gates 26 and 48 at the positions shown in the figure are controlled to be selected. The decoder 30c decodes the 2 bits output from the adder 31b that adds the values of the upper 2 bits A3 and A2 of the word / byte address 25 and the value of the second bit A1 to the lower address 0x.
The switch gate 26 and the gate 48 at the positions shown in the figure are controlled to select any one of the bytes 1, 5, 9 and d. The decoder 30d receives the values of the upper 2 bits A3 and A2 and the lower 2 bits A1 and A0 of the word / byte address 25.
Of the lower address 0x0, 4,
The switch gates 26 and 48 at the positions shown in the figure are controlled to select either one of the bytes 8 and c.

【0021】再び図2を参照すると、18は、イネーブ
ラ29から分配されるタグアドレス23と、デコーダ1
4によって選択されたデータメモリアレイ15に対応す
るタグメモリアレイ中のタグアドレスとを比較するアド
レスコンパレータである。また、19は、このアドレス
コンパレータ18の出力と、デコーダ14によって選択
されたデータメモリアレイ15に対応する有効ビット1
3の値とに基づいて、キャッシュヒットの有無を示すヒ
ットミス結果信号20を生成する有効判定器である。
Referring again to FIG. 2, 18 is the tag address 23 distributed from the enabler 29 and 18 is the decoder 1.
4 is an address comparator for comparing with the tag address in the tag memory array corresponding to the data memory array 15 selected by 4. Further, 19 is the output of the address comparator 18 and the valid bit 1 corresponding to the data memory array 15 selected by the decoder 14.
It is a validity determiner that generates a hit-miss result signal 20 indicating the presence or absence of a cache hit, based on the value of 3.

【0022】再び図1を参照すると、キャッシュセレク
タ36は、参照アドレス22の奇数偶数選択ビット37
およびワード・バイトアドレス25を入力し、それらの
値に応じて、インデックス加算信号38,奇数キャッシ
ュ選択信号39a,偶数キャッシュ選択信号39bを各
部に供給する。図4は、奇数偶数選択ビット37および
ワード・バイトアドレス25の値と、奇数キャッシュ選
択信号39a,偶数キャッシュ選択信号39bのアクテ
ィブ(○),非アクティブ(×)及びインデックス加算
信号38の値との関係を示す。また、キャッシュセレク
タ36は、参照アドレス22の奇数偶数選択ビット37
およびワード・バイトアドレス25に基づいてバイト選
択信号40を生成する。データセレクタ42は、このバ
イト選択信号40に基づき、ロードオペレーション時
に、キャッシュメモリ10aおよび10bからリードデ
ータ線35に出力されるバイト列を、各バイト単位で選
択して汎用レジスタ21に出力すべき1ワードのデータ
を生成する。
Referring again to FIG. 1, the cache selector 36 determines that the odd / even selection bits 37 of the reference address 22.
And the word / byte address 25 are input, and the index addition signal 38, the odd number cache selection signal 39a, and the even number cache selection signal 39b are supplied to each section according to their values. FIG. 4 shows the values of the odd / even selection bit 37 and the word / byte address 25 and the values of the odd cache selection signal 39a, the even cache selection signal 39b active (◯), inactive (×), and the index addition signal 38. Show the relationship. Further, the cache selector 36 uses the odd / even selection bits 37 of the reference address 22.
And a byte select signal 40 based on the word byte address 25. Based on the byte selection signal 40, the data selector 42 should select the byte string output from the cache memories 10a and 10b to the read data line 35 in each byte unit and output it to the general register 21 during the load operation. Generate word data.

【0023】図5に奇数ライン用のキャッシュメモリ1
0aおよび偶数ライン用のキャッシュメモリ10bに格
納されているデータのイメージを示す。同図の例は、主
記憶のアドレス0x70ac3010番地から0x70
ac304f番地の64バイトのデータが図1のキャッ
シュ記憶装置に格納されている場合のものであり、アド
レスの下位5ビット目の値が1となるアドレス0x70
ac3010番地〜0x70ac301f番地の16バ
イトと、アドレス0x70ac3030番地〜0x70
ac303f番地の16バイトとは奇数ライン用のキャ
ッシュメモリ10aに格納され、アドレスの下位5ビッ
ト目の値が0となるアドレス0x70ac3020番地
〜0x70ac302f番地の16バイトと、アドレス
0x70ac3040番地〜0x70ac304f番地
の16バイトとは偶数ライン用のキャッシュメモリ10
bに格納されている。
FIG. 5 shows the cache memory 1 for odd lines.
An image of data stored in the cache memory 10b for 0a and even lines is shown. In the example of the figure, addresses 0x70ac3010 to 0x70 of the main memory
Address 0x70 in which 64-byte data at address ac304f is stored in the cache storage device of FIG. 1 and the value of the lower 5th bit of the address is 1
16 bytes of addresses ac3010 to 0x70ac301f and addresses 0x70 ac3030 to 0x70
The 16 bytes of the address ac303f are stored in the cache memory 10a for odd lines and the 16th byte of the addresses 0x70ac3020 to 0x70ac302f and the 16 bytes of the addresses 0x70ac3040 to 0x70ac304f are stored so that the value of the lower 5th bit of the address is 0. Is an even line cache memory 10
It is stored in b.

【0024】以下、図1〜図5を参照して本実施例の動
作を説明する。
The operation of this embodiment will be described below with reference to FIGS.

【0025】(1)参照アドレスが4バイト境界の場合 (A)ロードオペレーション 汎用レジスタ21に対し、例えば0x70ac3010
番値から0x70ac3013番地の4バイトのデータ
をロードする場合、参照アドレス22に0x70ac3
010を指定して、キャッシュ記憶装置に対してロード
要求を行う。このような参照アドレス22の場合、奇数
偶数選択ビット37が奇数であり且つワード・バイトア
ドレス25が「1101」,「111X」以外であるの
で、キャッシュセレクタ36は奇数キャッシュ選択信号
39aをアクティブにし、偶数キャッシュ選択信号39
bは非アクティブにする(図4参照)。また、全バイト
とも奇数ライン用のキャッシュメモリ10aの出力側を
選択する旨のバイト選択信号40をデータセレクタ42
に出力する。
(1) When the reference address is on a 4-byte boundary (A) Load operation For the general-purpose register 21, for example, 0x70ac3010
When loading the 4-byte data at address 0x70ac3013 from address number 0x70ac3 to reference address 22
By designating 010, a load request is issued to the cache storage device. In the case of such a reference address 22, since the odd / even selection bit 37 is odd and the word / byte address 25 is other than "1101" and "111X", the cache selector 36 activates the odd cache selection signal 39a, Even cache selection signal 39
b is made inactive (see FIG. 4). In addition, for all bytes, the byte selector signal 40 for selecting the output side of the cache memory 10a for odd lines is used as the data selector 42.
Output to

【0026】奇数キャッシュ選択信号39aがアクティ
ブになると、奇数ライン用のキャッシュメモリ10a中
のイネーブラ29がロード要求にかかるキャッシュのロ
ードオペレーションの動作を開始すべく、参照アドレス
22のタグアドレス23をアドレスコンパレータ18
へ、インデックスアドレス24をデコーダ14へ、ワー
ド・バイトアドレス25をセレクタ17へ分配する。デ
コーダ14は、インデックスアドレス24を参照し、0
x70ac3010番地のバイトを含むラインが格納さ
れるべきデータメモリアレイ15を選択する。また、セ
レクタ17は、ワード・バイトアドレス25(この場
合、0000)に基づき、データメモリアレイ15から
データ線16に出力されたバイト列のうち、0x0〜0
x3を選択すべく該当するスイッチゲート26を制御す
る。更に、アドレスコンパレータ18はタグアドレス2
3とタグメモリアレイ12からの出力とを比較し、選択
されたデータメモリアレイ15の内容が参照アドレス2
2の内容であるか否かを調べる。そして、有効判定器1
9が、このアドレスコンパレータ18の比較結果と有効
ビット13の内容とに基づいて、データメモリアレイ1
5の内容が有効か無効かの判定を行い、ヒットミス結果
信号20を生成する。
When the odd cache select signal 39a becomes active, the enabler 29 in the cache memory 10a for the odd line starts the operation of the load operation of the cache in response to the load request, and the tag address 23 of the reference address 22 is used as the address comparator. 18
The index address 24 is distributed to the decoder 14, and the word / byte address 25 is distributed to the selector 17. The decoder 14 refers to the index address 24 and
Select the data memory array 15 in which the line containing the byte at address x70ac3010 is to be stored. Further, the selector 17 selects 0x0 to 0 of the byte string output from the data memory array 15 to the data line 16 based on the word / byte address 25 (0000 in this case).
Control the appropriate switch gate 26 to select x3. Further, the address comparator 18 uses the tag address 2
3 and the output from the tag memory array 12 are compared, and the content of the selected data memory array 15 is the reference address 2
Check whether it is the contents of 2. And the validity judging device 1
9 based on the comparison result of the address comparator 18 and the content of the valid bit 13
It is determined whether the contents of 5 are valid or invalid, and the hit-miss result signal 20 is generated.

【0027】データメモリアレイ15の内容が有効で参
照アドレス22と一致した場合には、データ線27a,
27b,27c,27dにスイッチゲート26を通じて
出力されたデータが、センスアンプ32によって増幅さ
れ、リードデータとしてリードデータ線35に出力され
る。そして、データセレクタ42は、バイト選択信号4
0に従って、全てのバイトで奇数ライン用のキャッシュ
メモリ10aからのデータを選択し、汎用レジスタ21
に書き込む。従って、図5に示した記憶内容の場合、デ
ータ線27aには0x70,データ線27bには0x0
a,データ線27cには0x65,データ線27cには
0x6eというデータが出力されるので、汎用レジスタ
21には0x700a656eという値の1ワードが格
納されることになる。
When the contents of the data memory array 15 are valid and match the reference address 22, the data lines 27a,
The data output to the switches 27b, 27c, and 27d through the switch gate 26 is amplified by the sense amplifier 32 and output to the read data line 35 as read data. Then, the data selector 42 uses the byte selection signal 4
According to 0, the data from the cache memory 10a for odd lines is selected in all bytes, and the general register 21
Write to. Therefore, in the case of the storage contents shown in FIG. 5, 0x70 is assigned to the data line 27a and 0x0 is assigned to the data line 27b.
a, 0x65 is output to the data line 27c, and 0x6e is output to the data line 27c, so one word having a value of 0x700a656e is stored in the general-purpose register 21.

【0028】上述の例では、参照アドレス22の奇数偶
数選択ビット37が奇数で且つワード・バイトアドレス
25が「1101」,「111X」以外であったので、
奇数ライン用のキャッシュメモリ10aが選択された
が、参照アドレス22の奇数偶数選択ビット37が偶数
で且つワード・バイトアドレス25が「1101」,
「111X」以外の場合には、偶数ライン用のキャッシ
ュメモリ10bが選択される。
In the above example, the odd / even selection bit 37 of the reference address 22 is odd and the word / byte address 25 is other than "1101" or "111X".
The cache memory 10a for the odd line is selected, but the odd / even selection bit 37 of the reference address 22 is even and the word / byte address 25 is "1101",
In cases other than "111X", the cache memory 10b for even lines is selected.

【0029】(B)ストアオペレーション ストアオペレーションの場合、汎用レジスタ21中のス
トアすべきデータがライトデータ線34を通じて奇数お
よび偶数ライン用のキャッシュメモリ10a,10bに
おけるライトセル44に図3に示すごとく印加される。
また、入力データサイズ情報線33によって入力データ
の大きさが各キャッシュメモリ10a,10bに通知さ
れる。この入力データサイズ情報線33は1ワード単位
のストア以外に1バイト単位のストアやハーフワード単
位のストアを実現するためのものであり、本発明の非整
列データ転送には本質的には関係しないので、以下、入
力データサイズ情報線33は1ワード単位のストアを指
示しているものとする。更に、キャッシュセレクタ36
からバイト選択信号40が各キャッシュメモリ10a,
10bのライトセル44前段のゲート48に入力され
る。参照アドレス22が与えられてストア要求が出され
たときの動作はほぼロードオペレーション時と同じであ
るが、ストアオペレーション時には、セレクタ17の出
力およびバイト選択信号40によって所望のゲート48
のみが有効とされる。例えば、0x70ac3010番
地から0x70ac3013番地の4バイトにデータを
ストアする場合、参照アドレス22に0x70ac30
10番地が指定されてストア要求が行われる。このと
き、キャッシュセレクタ36の制御によって奇数ライン
用のキャッシュメモリ10aによる単独キャッシング動
作が行われ、また全バイトとも奇数ライン用キャッシュ
メモリ10a側を選択する旨のバイト選択信号40が出
力される。従って、奇数ライト用のキャッシュメモリ1
0aにおけるセレクタ17は、ワード・バイトアドレス
25(この場合、0000)に基づき、ライトセル44
のバイト列のうち、0x0〜0x3を有効とすべくゲー
ト48を制御する。また、バイト選択信号40は全バイ
トとも奇数ライン用キャッシュメモリ10a側を選択す
る旨指示しているので、このバイト選択信号40はライ
トセル44の全バイト列を有効とすべくゲート48を制
御する。従って、汎用レジスタ21の4バイト1ワード
がライトセル44の0x0〜0x3のバイト位置にセッ
トされ、次いで、データ線16を通じて、ヒットしたデ
ータメモリアレイ15の0x0〜0x3のバイト位置に
書き込まれる。
(B) Store Operation In the case of store operation, the data to be stored in the general-purpose register 21 is applied to the write cells 44 in the cache memories 10a and 10b for odd and even lines through the write data line 34 as shown in FIG. To be done.
Further, the size of the input data is notified to the cache memories 10a and 10b by the input data size information line 33. The input data size information line 33 is used to realize a 1-byte unit store or a half-word unit store other than the 1-word unit store, and is not essentially related to the unaligned data transfer of the present invention. Therefore, hereinafter, it is assumed that the input data size information line 33 is instructing to store in units of one word. Furthermore, the cache selector 36
From the byte selection signal 40 to each cache memory 10a,
It is input to the gate 48 in the previous stage of the write cell 44 of 10b. The operation when the reference address 22 is given and a store request is issued is almost the same as the load operation, but during the store operation, the output of the selector 17 and the byte select signal 40 cause the desired gate 48.
Only valid. For example, when data is stored in 4 bytes of addresses 0x70ac3010 to 0x70ac3013, 0x70ac30 is stored in the reference address 22.
A store request is made by designating address 10. At this time, under the control of the cache selector 36, a single caching operation is performed by the odd line cache memory 10a, and a byte selection signal 40 indicating that the odd line cache memory 10a side is selected for all bytes is output. Therefore, cache memory 1 for odd write
The selector 17 at 0a determines the write cell 44 based on the word / byte address 25 (0000 in this case).
The gate 48 is controlled so that 0x0 to 0x3 of the byte sequence of 0 are valid. Further, since the byte selection signal 40 instructs all bytes to select the odd line cache memory 10a side, the byte selection signal 40 controls the gate 48 to make all the byte strings of the write cell 44 valid. . Therefore, one word of 4 bytes of the general register 21 is set to the byte positions of 0x0 to 0x3 of the write cell 44, and then written to the byte positions of 0x0 to 0x3 of the hit data memory array 15 through the data line 16.

【0030】(2)参照アドレス22が4バイト境界に
ならず且つキャッシュライン間に跨がらない場合 (A)ロードオペレーション 参照アドレス22が4バイト境界にならないような場合
は、従来例では同様のアクセスは許されていない。しか
し、本発明ではこのようなアクセスが可能である。具体
例として、参照アドレスが0x70ac3011の場合
の動作について説明する。
(2) When the reference address 22 does not come to a 4-byte boundary and does not straddle cache lines (A) Load operation When the reference address 22 does not come to a 4-byte boundary, a similar access is made in the conventional example. Is not allowed. However, according to the present invention, such access is possible. As a specific example, the operation when the reference address is 0x70ac3011 will be described.

【0031】参照アドレス22に0x70ac3011
を指定したロード要求時、キャッシュセレクタ36は、
奇数偶数選択ビット37が奇数であり且つワード・バイ
トアドレス25が「1101」,「111X」以外であ
るので、奇数キャッシュ選択信号39aをアクティブに
し、偶数キャッシュ選択信号39bは非アクティブにす
る(図4参照)。また、全バイトとも奇数ライン用のキ
ャッシュメモリ10aの出力側を選択する旨のバイト選
択信号40をデータセレクタ42に出力する。以下の動
作は、前述した0x70ac3010番地のアクセスと
同様であるが、セレクタ17を構成するデコーダ30
a,30b,30cには00の2ビットが入力されるの
で、選択されたデータメモリアレイ15の出力のうち、
デコーダ30aは0x3番地を、デコーダ30bは0x
2番地を、デコーダ30cは0x1番値をそれぞれ選択
し、一方、デコーダ31dには01の2ビットが入力さ
れるので、0x4番地を選択する。
0x70ac3011 at the reference address 22
When a load request is specified, the cache selector 36
Since the odd / even selection bit 37 is odd and the word / byte address 25 is other than "1101" and "111X", the odd cache selection signal 39a is activated and the even cache selection signal 39b is deactivated (FIG. 4). reference). In addition, a byte selection signal 40 for selecting the output side of the cache memory 10a for odd lines for all bytes is output to the data selector 42. The following operation is the same as the access to the address 0x70ac3010 described above, but the decoder 30 which constitutes the selector 17
Since 2 bits of 00 are input to a, 30b, and 30c, among the outputs of the selected data memory array 15,
The decoder 30a has the address 0x3, and the decoder 30b has the address 0x3.
For the address 2, the decoder 30c selects the value 0x1, and on the other hand, since 2 bits of 01 are input to the decoder 31d, the address 0x4 is selected.

【0032】従って、図5に示した記憶内容の場合、デ
ータ線27aには0x70,データ線27bには0x0
a,データ線27cには0x65,データ線27cには
0x85というデータが出力され、センスアンプ32,
リードデータ線35,データセレクタ42を介して汎用
レジスタ21には0x700a6585という値が格納
される。即ち、参照アドレス22が4バイト境界になら
ないようなデータ列が読み出せたことになる。
Therefore, in the case of the storage contents shown in FIG. 5, 0x70 is assigned to the data line 27a and 0x0 is assigned to the data line 27b.
a, data 0x65 is output to the data line 27c, and data 0x85 is output to the data line 27c.
A value of 0x700a6585 is stored in the general-purpose register 21 via the read data line 35 and the data selector 42. That is, it means that the data string in which the reference address 22 is not on the 4-byte boundary can be read.

【0033】ここで、図5を参照すると、0x70ac
3011番地を先頭とする4バイトの値は0x8570
0a65であるのに対し、上述のように汎用レジスタ2
1に読み出された値は0x700a6585であり、最
上位アドレスとなるデータがこの場合にはレジスタの最
下位バイトの位置に格納されている。従って、ワードデ
ータとしてこのデータを扱う場合にはこの値を回転シフ
トする必要が生じるが、前述した低精度並列演算を行う
場合には、必ずしも最上位アドレスとなるデータがレジ
スタの最上位バイトの位置に格納される必要はなく、演
算を行うレジスタ間の対応がとれていれば良いので、問
題はない。
Referring now to FIG. 5, 0x70ac
The 4-byte value starting at address 3011 is 0x8570
0a65, the general register 2 as described above
The value read to 1 is 0x700a6585, and the data serving as the highest address is stored in the lowest byte position of the register in this case. Therefore, when handling this data as word data, it is necessary to rotate and shift this value, but when performing the low-precision parallel operation described above, the data that is the highest address is not always the position of the highest byte of the register. There is no problem because it is not necessary to be stored in, and it suffices that the registers that perform the calculation be associated with each other.

【0034】例えば、 のようなプログラムにおいて、ループの開始場所が変数
で指定されていて不定の場合、従来例では低精度並列演
算命令は使用できなかったが、本実施例によれば、低精
度並列演算命令を利用することが可能となる。この場
合、配列変数a[0],b[0]のアドレスの下位2ビ
ットが同一であれば、演算を行うレジスタ間の対応がと
れるので、レジスタ内でのバイトの配置順は問題になら
ない。
For example, In such a program, when the loop start location is specified by a variable and is indefinite, the conventional example cannot use the low-precision parallel operation instruction, but according to the present embodiment, the low-precision parallel operation instruction is used. It becomes possible to do. In this case, if the lower 2 bits of the addresses of the array variables a [0] and b [0] are the same, the registers that perform the operation can be associated with each other, and therefore the order of arrangement of the bytes in the registers does not matter.

【0035】なお、上述の例では、参照アドレス22の
奇数偶数選択ビット37が奇数で且つワード・バイトア
ドレス25が「1101」,「111X」以外であった
ので、奇数ライン用のキャッシュメモリ10aが選択さ
れたが、参照アドレス22の奇数偶数選択ビット37が
偶数で且つワード・バイトアドレス25が「110
1」,「111X」以外の場合には、偶数ライン用のキ
ャッシュメモリ10bが選択されて、同様な動作が行わ
れる。
In the above example, since the odd / even selection bit 37 of the reference address 22 is odd and the word / byte address 25 is other than "1101" and "111X", the cache memory 10a for the odd line is Although selected, the odd / even selection bit 37 of the reference address 22 is even and the word / byte address 25 is "110".
In cases other than "1" and "111X", the cache memory 10b for even lines is selected and the same operation is performed.

【0036】(B)ストアオペレーション 参照アドレス22が4バイト境界にならず且つキャッシ
ュライン間に跨がらない場合の動作は前記(1)のスト
アオペレーションとほぼ同様に行われる。例えば、0x
70ac3011番地から0x70ac3014番地の
4バイトにデータをストアする場合、参照アドレス22
に0x70ac3011番地が指定されてストア要求が
行われるが、このとき奇数ライン用のキャッシュメモリ
10aによる単独キャッシング動作が行われ、そのセレ
クタ17は、ワード・バイトアドレス25(この場合、
0001)に基づき、ライトセル44のバイト列のう
ち、0x1〜0x4を有効とすべくゲート48を制御す
る。また、バイト選択信号40を全バイトを奇数ライン
用キャッシュメモリ10aを選択するよう指示する。従
って、汎用レジスタ21の4バイト1ワードがライトセ
ル44の0x1〜0x4のバイト位置にセットされ、次
いで、データ線16を通じて、ヒットしたデータメモリ
アレイ15の0x1〜0x4のバイト位置に書き込まれ
る。
(B) Store Operation The operation when the reference address 22 is not on the 4-byte boundary and does not straddle the cache lines is almost the same as the store operation of (1). For example, 0x
When storing data in 4 bytes from address 70ac3011 to address 0x70ac3014, reference address 22
A store request is made by specifying the address 0x70ac3011, but at this time, the cache memory 10a for the odd-numbered line performs the independent caching operation, and the selector 17 selects the word / byte address 25 (in this case,
0001), the gate 48 is controlled so that 0x1 to 0x4 of the byte string of the write cell 44 are valid. Further, the byte selection signal 40 is instructed to select all the bytes from the odd line cache memory 10a. Therefore, one word of 4 bytes of the general register 21 is set to the byte positions of 0x1 to 0x4 of the write cell 44, and then written to the byte positions of 0x1 to 0x4 of the hit data memory array 15 through the data line 16.

【0037】(3)参照アドレス22が4バイト境界に
ならず且つキャッシュライン間に跨がる場合 (A)ロードオペレーション 参照アドレス22が4バイト境界にならず、且つキャッ
シュライン間に跨がるような場合、即ちワード・バイト
アドレス25が「1101」,「111X」の何れかで
あって且つワードアクセスを行う場合、従来例では当然
アクセスは許されていないが、本発明では可能である。
具体例として、参照アドレスが0x70ac301eの
場合の動作について説明する。
(3) When the reference address 22 is not on a 4-byte boundary and straddles cache lines (A) Load operation: The reference address 22 is not on a 4-byte boundary and straddles cache lines. In this case, that is, when the word / byte address 25 is either "1101" or "111X" and word access is performed, the access is naturally not permitted in the conventional example, but it is possible in the present invention.
As a specific example, the operation when the reference address is 0x70ac301e will be described.

【0038】参照アドレス22に0x70ac301e
を指定したロード要求時、キャッシュセレクタ36は、
奇数偶数選択ビット37が奇数であり且つワード・バイ
トアドレス25が「1110」なので、奇数キャッシュ
選択信号39aおよび偶数キャッシュ選択信号39bを
共にアクティブにし、インデックス加算信号38を1に
する。また、上位2バイトは奇数ライン用のキャッシュ
メモリ10aからのデータを選択し、下位2バイトは偶
数ライン用のキャッシュメモリ10bからのデータを選
択する旨のバイト選択信号40をデータセレクタ42に
出力する。
0x70ac301e at the reference address 22
When a load request is specified, the cache selector 36
Since the odd / even selection bit 37 is odd and the word / byte address 25 is "1110", both the odd cache selection signal 39a and the even cache selection signal 39b are activated, and the index addition signal 38 is set to "1". Also, a byte selection signal 40 indicating that the upper 2 bytes select data from the odd-numbered line cache memory 10a and the lower 2 bytes select data from the even-line cache memory 10b are output to the data selector 42. .

【0039】奇数ライン用のキャッシュメモリ10aの
動作は、前述した場合と同様であるが、セレクタ17を
構成するデコーダ30a,30bには11の2ビットが
入力されるので、選択されたデータメモリアレイ15の
出力のうち、デコーダ30aは0xf番地を、デコーダ
30bは0xe番地をそれぞれ選択し、一方、デコーダ
30c,30dには00の2ビットが入力されるので、
デコーダ30cは0x1番地を、デコーダ30dは0x
0番地をそれぞれ選択する。従って、図5に示した記憶
内容の場合、奇数ライン用のキャッシュメモリ10aに
おけるデータ線27aには0x65,データ線27bに
は0x6e,データ線27cには0x65,データ線2
7cには0x6eというデータが出力され、これがセン
スアンプ32で増幅されて奇数ライン用のキャッシュメ
モリ10aのリードデータ線35に出力される。
The operation of the cache memory 10a for odd-numbered lines is the same as that described above, but since 2 bits of 11 are input to the decoders 30a and 30b forming the selector 17, the selected data memory array is selected. Of the 15 outputs, the decoder 30a selects the address 0xf and the decoder 30b selects the address 0xe, while the decoders 30c and 30d receive 2 bits of 00,
The decoder 30c has the address 0x1, and the decoder 30d has the address 0x1.
Select address 0 respectively. Therefore, in the case of the storage contents shown in FIG. 5, 0x65 is used for the data line 27a, 0x6e is used for the data line 27b, 0x65 is used for the data line 27c, and data line 2 is used in the cache memory 10a for odd lines.
Data 0x6e is output to 7c, is amplified by the sense amplifier 32, and is output to the read data line 35 of the cache memory 10a for odd lines.

【0040】他方、偶数ライン用のキャッシュメモリ1
0bでは、加算器45によりインデックスアドレス24
の値が+1された参照アドレス22、つまり0x70a
c302eが与えられる。この偶数ライン用のキャッシ
ュメモリ10bの動作は、奇数ライン用のキャッシュメ
モリ10aの動作と同様であり、セレクタ17を構成す
るデコーダ30a,30bには11の2ビットが入力さ
れるので、選択されたデータメモリアレイ15の出力の
うち、デコーダ30aは0xf番地を、デコーダ30b
は0xe番地をそれぞれ選択し、一方、デコーダ30
c,30dには00の2ビットが入力されるので、デコ
ーダ30cは0x1番地を、デコーダ30dは0x0番
地をそれぞれ選択する。従って、図5に示した記憶内容
の場合、偶数ライン用のキャッシュメモリ10bにおけ
るデータ線27aには0x75,データ線27bには0
x7e,データ線27cには0x55,データ線27c
には0x3eというデータが出力され、これがセンスア
ンプ32で増幅されて偶数ライン用のキャッシュメモリ
10bのリードデータ線35に出力される。
On the other hand, the cache memory 1 for even lines
In 0b, the adder 45 causes the index address 24
Reference address 22 with the value of +1 added, that is, 0x70a
c302e is given. The operation of the cache memory 10b for even lines is the same as the operation of the cache memory 10a for odd lines, and 2 bits of 11 are input to the decoders 30a and 30b forming the selector 17, so that they are selected. Of the outputs of the data memory array 15, the decoder 30a outputs the address 0xf to the decoder 30b.
Selects the address 0xe, while the decoder 30
Since 2 bits of 00 are input to c and 30d, the decoder 30c selects the address 0x1 and the decoder 30d selects the address 0x0. Therefore, in the case of the storage contents shown in FIG. 5, 0x75 is applied to the data line 27a and 0 is applied to the data line 27b in the cache memory 10b for even lines.
x7e, data line 27c has 0x55, data line 27c
Is output to the read data line 35 of the even-numbered cache memory 10b as a result of being amplified by the sense amplifier 32.

【0041】そして、データセレクタ42は、バイト選
択信号40に従って、上位2バイトは奇数ライン用のキ
ャッシュメモリ10aからのデータを選択し、下位2バ
イトは偶数ライン用のキャッシュメモリ10bからのデ
ータを選択し、汎用レジスタ21に書き込む。従って、
図5に示した記憶内容の場合、汎用レジスタ21には0
x656e553eという値の1ワードが格納されるこ
とになる。
Then, the data selector 42 selects the data from the cache memory 10a for the odd lines for the upper 2 bytes and the data from the cache memory 10b for the even lines for the lower 2 bytes according to the byte selection signal 40. Then, the general register 21 is written. Therefore,
In the case of the storage contents shown in FIG. 5, 0 is stored in the general-purpose register 21.
One word having a value of x656e553e will be stored.

【0042】なお、奇数および偶数用のキャッシュメモ
リ10a,10bを共にアクセスする場合には、両者の
キャッシュのヒットミス結果信号20が異なる可能性が
ある。この場合、ヒットミス判定装置41では、ミスと
いう結果として、ヒットミス結果信号43を出力する。
キャッシュミスとなった場合には、キャッシュの内容
を、要求するアドレスに入れ換えた後に、もう一度アク
セスを行う。
When both the odd and even cache memories 10a and 10b are accessed, the hit / miss result signal 20 of both caches may be different. In this case, the hit-miss determination device 41 outputs the hit-miss result signal 43 as a result of the miss.
If a cache miss occurs, the contents of the cache are replaced with the requested address, and then the access is performed again.

【0043】(B)ストアオペレーション 参照アドレス22が4バイト境界にならず且つキャッシ
ュライン間に跨がる場合、奇数および偶数ライン用のキ
ャッシュメモリ10a,10bによる並列動作が行われ
る。例えば、0x70ac301e番地から0x70a
c3021番地の4バイトにデータをストアする場合、
参照アドレス22に0x70ac301e番地が指定さ
れてストア要求が行われるが、このとき奇数ライン用の
キャッシュメモリ10aにおけるセレクタ17は、ワー
ド・バイトアドレス25(この場合、1110)に基づ
き、ライトセル44のバイト列のうち、0x0,0x
1,0xe,0xfを有効とすべくゲート48を制御す
る。但し、バイト選択信号40は、上位2バイトは奇数
ライン用のキャッシュメモリ10aからのデータを選択
する旨指示しているので、汎用レジスタ21の4バイト
1ワードのうち上位2バイトがライトセル44の0xe
〜0xfのバイト位置にセットされ、次いで、データ線
16を通じて、ヒットしたデータメモリアレイ15の0
xe〜0xfのバイト位置に書き込まれる。他方、偶数
ライン用のキャッシュメモリ10bにおけるセレクタ1
7も、ワード・バイトアドレス25(この場合、111
0)に基づき、ライトセル44のバイト列のうち、0x
0,0x1,0xe,0xfを有効とすべくゲート48
を制御する。但し、バイト選択信号40は、下位2バイ
トは偶数ライン用のキャッシュメモリ10bからのデー
タを選択する旨示しているので、汎用レジスタ21の4
バイト1ワードのうち下位2バイトがライトセル44の
0x0〜0x1のバイト位置にセットされ、次いで、デ
ータ線16を通じて、ヒットしたデータメモリアレイ1
5の0x0〜0x1のバイト位置に書き込まれる。
(B) Store Operation When the reference address 22 is not on a 4-byte boundary and straddles cache lines, parallel operations are performed by the cache memories 10a and 10b for odd and even lines. For example, from 0x70ac301e to 0x70a
To store data in 4 bytes at address c3021,
The address 0x70ac301e is designated as the reference address 22, and the store request is made. At this time, the selector 17 in the cache memory 10a for the odd line is based on the word / byte address 25 (1110 in this case) and the byte of the write cell 44. 0x0,0x of the columns
The gate 48 is controlled so that 1,0xe and 0xf are valid. However, since the byte selection signal 40 indicates that the upper 2 bytes select data from the cache memory 10a for odd lines, the upper 2 bytes of the 4 bytes 1 word of the general-purpose register 21 are the write cells 44. 0xe
Set to the byte position of 0xf, and then through the data line 16 to the 0 of the hit data memory array 15.
It is written in the byte position of xe to 0xf. On the other hand, the selector 1 in the cache memory 10b for even lines
7 also has a word byte address 25 (in this case, 111
0x of the byte sequence of the write cell 44 based on 0)
Gate 0 to make 0, 0x1, 0xe, 0xf valid
Control. However, since the byte selection signal 40 indicates that the lower 2 bytes select the data from the even-numbered line cache memory 10b, 4 of the general-purpose register 21 is selected.
The lower 2 bytes of the byte 1 word are set to the byte positions of 0x0 to 0x1 of the write cell 44, and then the data memory array 1 which is hit through the data line 16 is hit.
5 is written to the byte positions of 0x0 to 0x1.

【0044】図6は本発明のキャッシュ記憶装置の別の
実施例のブロック図である。この例のキャッシュ記憶装
置は、デュアルポート構造のデータメモリアレイ51,
タグメモリアレイ52および有効ビット53を備えてい
る。そして、これらをデュアルポート構造に拡張したの
に伴い、デコーダ14a,14b,セレクタ17a,1
7b,アドレスコンパレータ18a,18b,有効判定
器19a,19b,センスアンプ32a,32b,ライ
トセル44a,44b,データ線27a〜27hを二重
化し、同時に2つの参照アドレスについてキャッシュを
索くことが可能な構造になっている。なお、セレクタ1
7a,17b,ライトセル44a,44b周辺のより詳
しい構成は図3に示したものと同じである。
FIG. 6 is a block diagram of another embodiment of the cache memory device of the present invention. The cache storage device of this example includes a data memory array 51 having a dual port structure,
A tag memory array 52 and a valid bit 53 are provided. Then, as these are expanded to the dual port structure, the decoders 14a and 14b, the selectors 17a and 1
7b, address comparators 18a and 18b, validity determiners 19a and 19b, sense amplifiers 32a and 32b, write cells 44a and 44b, and data lines 27a to 27h can be duplicated and a cache can be searched for two reference addresses at the same time. It is structured. Note that selector 1
The detailed configuration around 7a, 17b and the write cells 44a, 44b is the same as that shown in FIG.

【0045】また、キャッシュセレクタ54は、参照ア
ドレス22の下位4ビットの値が「1101」,「11
1X」以外の場合は、2ライン検索信号56を無効と
し、「1101」,「111X」の場合は、インデック
ス加算信号37の値を1にし且つ2ライン検索信号56
を有効とする機構である。また、参照アドレス22の下
位4ビットの値に応じたバイト選択信号40をデータセ
レクタ42およびキャッシュメモリ50に出力する機能
も有する。
In the cache selector 54, the values of the lower 4 bits of the reference address 22 are "1101" and "11".
In the case of other than "1X", the 2-line search signal 56 is invalidated. In the case of "1101" and "111X", the value of the index addition signal 37 is set to 1 and the 2-line search signal 56 is set.
Is a mechanism that enables. It also has a function of outputting the byte selection signal 40 corresponding to the value of the lower 4 bits of the reference address 22 to the data selector 42 and the cache memory 50.

【0046】以下、図6の実施例の動作を説明する。The operation of the embodiment shown in FIG. 6 will be described below.

【0047】(1)参照アドレスが4バイト境界の場合 (A)ロードオペレーション 汎用レジスタ21に対し、例えば0x70ac3010
番値から0x70ac3013番地の4バイトのデータ
をロードする場合、参照アドレス22に0x70ac3
010を指定して、キャッシュ記憶装置に対してロード
要求を行う。このような参照アドレス22の場合、ワー
ド・バイトアドレス25が「1101」,「111X」
以外であるので、キャッシュセレクタ54は2ライン検
索信号56を無効とし、また、全バイトともリードデー
タ線35a側を選択する旨のバイト選択信号40を出力
する。
(1) When the reference address is on a 4-byte boundary (A) Load operation For the general-purpose register 21, for example, 0x70ac3010
When loading the 4-byte data at address 0x70ac3013 from address number 0x70ac3 to reference address 22
By designating 010, a load request is issued to the cache storage device. In the case of such a reference address 22, the word / byte address 25 is "1101", "111X".
Other than that, the cache selector 54 invalidates the 2-line search signal 56 and outputs the byte selection signal 40 to select the read data line 35a side for all bytes.

【0048】キャッシュメモリ50では、2ライン検索
信号56が無効の場合、参照アドレス22そのものに基
づくキャッシュ動作だけが実行される。先ず、デコーダ
14aは、参照アドレス22中のインデックスアドレス
24を参照し、0x70ac3010番値のバイトを含
むラインが格納されるべきデータメモリアレイ15aを
選択する。また、セレクタ17aは、ワード・バイトア
ドレス25(この場合、0000)に基づき、データメ
モリアレイ15aからデータ線16に出力されたバイト
列のうち、0x0〜0x3を選択すべく該当するスイッ
チゲート26を制御する。更に、アドレスコンパレータ
18aはタグアドレス23とタグメモリアレイ52から
の出力とを比較し、選択されたデータメモリアレイ15
aの内容が参照アドレス22の内容であるか否かを調べ
る。そして、有効判定器19aが、このアドレスコンパ
レータ18aの比較結果と有効ビット53の内容とに基
づいて、データメモリアレイ15aの内容が有効か無効
かの判定を行い、ヒットミス結果信号20aを生成す
る。
In the cache memory 50, when the 2-line search signal 56 is invalid, only the cache operation based on the reference address 22 itself is executed. First, the decoder 14a refers to the index address 24 in the reference address 22 and selects the data memory array 15a in which the line including the byte of value 0x70ac3010 is to be stored. In addition, the selector 17a sets the corresponding switch gate 26 to select 0x0 to 0x3 in the byte string output from the data memory array 15a to the data line 16 based on the word / byte address 25 (0000 in this case). Control. Further, the address comparator 18a compares the tag address 23 with the output from the tag memory array 52, and selects the selected data memory array 15
It is checked whether or not the content of a is the content of the reference address 22. Then, the validity determiner 19a determines whether the content of the data memory array 15a is valid or invalid based on the comparison result of the address comparator 18a and the content of the valid bit 53, and generates the hit-miss result signal 20a. .

【0049】データメモリアレイ15aの内容が有効で
参照アドレス22と一致した場合には、データ線27
a,27b,27c,27dにスイッチゲート26を通
じて出力されたデータが、センスアンプ32aによって
増幅され、リードデータとしてリードデータ線35aに
出力される。そして、データセレクタ42は、バイト選
択信号40に従って、全てのバイトでリードデータ線3
5a側を選択し、汎用レジスタ21に書き込む。従っ
て、図5に示した記憶内容の場合、データ線27aには
0x70,データ線27bには0x0a,データ線27
cには0x65,データ線27cには0x6eというデ
ータが出力されるので、汎用レジスタ21には0x70
0a656eという値の1ワードが格納されることにな
る。
When the content of the data memory array 15a is valid and coincides with the reference address 22, the data line 27
The data output to the a, 27b, 27c, and 27d through the switch gate 26 is amplified by the sense amplifier 32a and output to the read data line 35a as read data. Then, according to the byte selection signal 40, the data selector 42 reads the read data line 3 for all bytes.
5a side is selected and written in the general-purpose register 21. Therefore, in the case of the storage contents shown in FIG. 5, 0x70 is assigned to the data line 27a, 0x0a is assigned to the data line 27b, and data line 27 is assigned to the data line 27b.
Since 0x65 is output to c and 0x6e is output to the data line 27c, 0x70 is output to the general-purpose register 21.
One word having a value of 0a656e will be stored.

【0050】(B)ストアオペレーション ストアオペレーションの場合、汎用レジスタ21中のス
トアすべきデータがライトデータ線34を通じてキャッ
シュメモリ50における双方のライトセル44a,44
bに印加される。また、入力データサイズ情報線33に
よって入力データの大きさが各ライトセル44a,44
bに通知される。更に、キャッシュセレクタ54からバ
イト選択信号40がキャッシュメモリ50のライトセル
44a,44b前段のゲート48(図3)に入力され
る。参照アドレス22が与えられてストア要求が出され
たときの動作はほぼロードオペレーション時と同じであ
るが、ストアオペレーション時には、セレクタ17a,
17bによってワード・バイトアドレス25の値に応じ
たゲート48(図3参照)のみが有効とされる。例え
ば、0x70ac3010番地から0x70ac301
3番地の4バイトにデータをストアする場合、参照アド
レス22に0x70ac3010番地が指定されてスト
ア要求が行われる。このとき、参照アドレス22そのも
のによる単独キャッシング動作が行われ、セレクタ17
aは、ワード・バイトアドレス25(この場合、000
0)に基づき、ライトセル44aのバイト列のうち、0
x0〜0x3を有効とすべくゲート48を制御する。ま
た、この場合バイト選択信号40は全バイトともリード
データ線35a側を選択する旨を指示しており、バイト
選択信号40に関してライトセル44aの全バイトが有
効化される。従って、両者の論理積に基づき、汎用レジ
スタ21の4バイト1ワードがライトセル44aの0x
0〜0x3のバイト位置にセットされ、次いで、データ
線16を通じて、ヒットしたデータメモリアレイ15a
の0x0〜0x3のバイト位置に書き込まれる。
(B) Store Operation In the case of store operation, the data to be stored in the general-purpose register 21 is stored in both write cells 44a and 44 in the cache memory 50 through the write data line 34.
applied to b. In addition, the size of the input data is changed by the input data size information line 33 to the respective write cells 44a, 44a.
b is notified. Furthermore, the byte selector signal 40 is input from the cache selector 54 to the gate 48 (FIG. 3) in the previous stage of the write cells 44a and 44b of the cache memory 50. The operation when the reference address 22 is given and a store request is issued is almost the same as the load operation, but during the store operation, the selector 17a,
17b enables only the gate 48 (see FIG. 3) corresponding to the value of the word / byte address 25. For example, from 0x70ac3010 to 0x70ac301
When data is stored in the 4 bytes of the address 3, the address 0x70ac3010 is designated as the reference address 22 and a store request is made. At this time, the independent caching operation is performed by the reference address 22 itself, and the selector 17
a is a word / byte address 25 (000 in this case)
0) of the byte string of the write cell 44a based on 0).
The gate 48 is controlled so that x0 to 0x3 are valid. Further, in this case, the byte selection signal 40 instructs that all the bytes are selected on the read data line 35a side, and all the bytes of the write cell 44a are validated with respect to the byte selection signal 40. Therefore, based on the logical product of both, one word of 4 bytes of the general register 21 is 0x of the write cell 44a.
The data memory array 15a which is set to the byte position of 0 to 0x3 and then hits through the data line 16
Are written in the byte positions of 0x0 to 0x3.

【0051】(2)参照アドレス22が4バイト境界に
ならず且つキャッシュライン間に跨がらない場合(具体
例として、参照アドレスが0x70ac3011の場合
の動作について説明する)。
(2) The case where the reference address 22 is not on a 4-byte boundary and does not extend across the cache lines (as a concrete example, the operation when the reference address is 0x70ac3011 will be described).

【0052】(A)ロードオペレーション 参照アドレス22に0x70ac3011を指定したロ
ード要求時、キャッシュセレクタ54は、ワード・バイ
トアドレス25が「1101」,「111X」以外であ
るので、2ライン検索信号を無効とし、また、全バイト
ともリードデータ線35a側を選択する旨のバイト選択
信号40をデータセレクタ42に出力する。以下の動作
は、(1)における0x70ac3010番値のアクセ
スと同様であるが、セレクタ17aを構成する図3のデ
コーダ30a,30b,30cには00の2ビットが入
力されるので、選択されたデータメモリアレイ15aの
出力のうち、デコーダ30aは0x3番地を、デコーダ
30bは0x2番地を、デコーダ30cは0x1番値を
それぞれ選択し、一方、デコーダ31dには01の2ビ
ットが入力されるので、0x4番地を選択する。
(A) Load operation When a load request is made by designating 0x70ac3011 as the reference address 22, the cache selector 54 invalidates the 2-line search signal because the word / byte address 25 is not "1101" or "111X". Also, a byte selection signal 40 for selecting the read data line 35a side for all bytes is output to the data selector 42. The following operation is the same as the access to the 0x70ac3010 value in (1), but since 2 bits of 00 are input to the decoders 30a, 30b and 30c of FIG. 3 which constitute the selector 17a, the selected data is selected. Of the outputs of the memory array 15a, the decoder 30a selects the address 0x3, the decoder 30b selects the address 0x2, and the decoder 30c selects the value 0x1. On the other hand, since the decoder 31d receives 2 bits of 01, it selects 0x4. Select an address.

【0053】従って、図5に示した記憶内容の場合、デ
ータ線27aには0x70,データ線27bには0x0
a,データ線27cには0x65,データ線27cには
0x85というデータが出力され、センスアンプ32
a,リードデータ線35a,データセレクタ42を介し
て汎用レジスタ21には0x700a6585という値
が格納される。
Therefore, in the case of the storage contents shown in FIG. 5, 0x70 is assigned to the data line 27a and 0x0 is assigned to the data line 27b.
a, data 0x65 is output to the data line 27c, and data 0x85 is output to the data line 27c.
A value of 0x700a6585 is stored in the general-purpose register 21 via a, the read data line 35a, and the data selector 42.

【0054】(B)ストアオペレーション 参照アドレス22が4バイト境界にならず且つキャッシ
ュライン間に跨がらない場合の動作は前記(2)のスト
アオペレーションとほぼ同様に行われる。例えば、0x
70ac3011番地から0x70ac3014番地の
4バイトにデータをストアする場合、参照アドレス22
に0x70ac3011番地が指定されてストア要求が
行われるが、このとき参照アドレスそのものによる単独
キャッシング動作が行われ、セレクタ17aは、ワード
・バイトアドレス25(この場合、0001)に基づ
き、ライトセル44aのバイト列のうち、0x1〜0x
4を有効とすべくゲート48を制御する。また、バイト
選択信号40も全バイトともリードデータ線35aを選
択するよう指示している。従って、汎用レジスタ21の
4バイト1ワードがライトセル44aの0x1〜0x4
のバイト位置にセットされ、次いで、データ線16を通
じて、ヒットしたデータメモリアレイ15aの0x1〜
0x4のバイト位置に書き込まれる。
(B) Store operation The operation when the reference address 22 is not on a 4-byte boundary and does not straddle the cache lines is almost the same as the store operation of (2). For example, 0x
When storing data in 4 bytes from address 70ac3011 to address 0x70ac3014, reference address 22
The address 0x70ac3011 is specified for the store request, but at this time, the single caching operation is performed by the reference address itself, and the selector 17a determines the byte of the write cell 44a based on the word / byte address 25 (0001 in this case). Of the columns, 0x1-0x
Gate 48 is controlled so that 4 is valid. The byte selection signal 40 also instructs all the bytes to select the read data line 35a. Therefore, one word of 4 bytes in the general-purpose register 21 corresponds to 0x1 to 0x4 of the write cell 44a.
Of the hit data memory array 15a through the data line 16
Written to byte position 0x4.

【0055】(3)参照アドレス22が4バイト境界に
ならず且つキャッシュライン間に跨がる場合 (A)ロードオペレーション 参照アドレス22が4バイト境界にならず、且つキャッ
シュライン間に跨がるような場合、即ちワード・バイト
アドレス25が「1101」,「111X」の何れかで
ある場合の動作を、参照アドレスが0x70ac301
eの場合の動作について説明する。
(3) When the reference address 22 is not on a 4-byte boundary and straddles cache lines (A) Load operation: The reference address 22 is not on a 4-byte boundary and straddles cache lines. If the word / byte address 25 is "1101" or "111X", the reference address is 0x70ac301.
The operation in the case of e will be described.

【0056】参照アドレス22に0x70ac301e
を指定したロード要求時、キャッシュセレクタ54は、
ワード・バイトアドレス25が「1110」なので、イ
ンデックス加算信号37を1にして2ライン検索信号5
6を有効とする。また、上記2バイトはリードデータ線
35a側の出力を、下位2バイトはリードデータ線35
b側の出力をそれぞれ選択する旨のバイト選択信号40
をデータセレクタ42に出力する。
0x70ac301e at reference address 22
When a load request specifying
Since the word / byte address 25 is "1110", the index addition signal 37 is set to 1 and the 2-line search signal 5
6 is valid. The above 2 bytes are the output on the read data line 35a side, and the lower 2 bytes are the read data line 35a.
Byte selection signal 40 for selecting each of the outputs on the b side
Is output to the data selector 42.

【0057】2ライン検索信号56が有効な場合、キャ
ッシュメモリ50では、参照アドレス22そのものを使
用したキャッシュ検索と、参照アドレス22中のインデ
ックスアドレス24を+1した参照アドレスを使用した
キャッシュ検索とが同時に行われる。前者のキャッシュ
検索は、デコーダ14a,セレクタ17a,アドレスコ
ンパレータ18a,有効判定器19a等によって(2)
で説明したと同様に実行される。また、後者のインデッ
クスアドレス24を+1した参照アドレス55に基づく
検索は、デコーダ14b,セレクタ17b,アドレスコ
ンパレータ18b,有効判定器19b等によって、他方
のキャッシュ検索と同様に行われる。
When the 2-line search signal 56 is valid, in the cache memory 50, the cache search using the reference address 22 itself and the cache search using the reference address obtained by adding 1 to the index address 24 in the reference address 22 are performed at the same time. Done. The former cache search is performed by the decoder 14a, selector 17a, address comparator 18a, validity determiner 19a, etc. (2)
It is executed in the same manner as described in. Further, the latter search based on the reference address 55 obtained by adding 1 to the index address 24 is performed by the decoder 14b, the selector 17b, the address comparator 18b, the validity determiner 19b, etc. in the same manner as the other cache search.

【0058】従って、参照アドレス22に0x70ac
301eを指定したロード要求時、セレクタ17aを構
成する図6のデコーダ30a,30bには11の2ビッ
トが入力されるので、選択されたデータメモリアレイ1
5aの出力のうち、デコーダ30aは0xf番地を、デ
コーダ30bは0xe番地をそれぞれ選択し、一方、デ
コーダ30c,30dには00の2ビットが入力される
ので、デコーダ30cは0x1番地を、デコーダ30d
は0x0番地をそれぞれ選択する。従って、図5に示し
た記憶内容の場合、データ線27aには0x65,デー
タ線27bには0x6e,データ線27cには0x6
5,データ線27cには0x6eというデータが出力さ
れ、これがセンスアンプ32aで増幅されてリードデー
タ線35aに出力される。
Therefore, the reference address 22 is 0x70ac.
At the time of a load request specifying 301e, 2 bits of 11 are input to the decoders 30a and 30b of FIG. 6 forming the selector 17a, so that the selected data memory array 1
Of the outputs of 5a, the decoder 30a selects the address 0xf and the decoder 30b selects the address 0xe. On the other hand, since 2 bits of 00 are input to the decoders 30c and 30d, the decoder 30c selects the address 0x1 and the decoder 30d.
Selects address 0x0. Therefore, in the case of the storage contents shown in FIG. 5, 0x65 is assigned to the data line 27a, 0x6e is assigned to the data line 27b, and 0x6 is assigned to the data line 27c.
5, data 0x6e is output to the data line 27c, amplified by the sense amplifier 32a and output to the read data line 35a.

【0059】他方、参照アドレス22中のインデックス
アドレス24を+1した参照アドレスによるキャッシュ
検索では、セレクタ17bを構成する図6のデコーダ3
0a,30bには11の2ビットが入力されるので、選
択されたデータメモリアレイ15の出力のうち、デコー
ダ30aは0xf番地を、デコーダ30bは0xe番地
をそれぞれ選択し、一方、デコーダ30c,30dには
00の2ビットが入力されるので、デコーダ30cは0
x1番地を、デコーダ30dは0x0番地をそれぞれ選
択する。従って、図5に示した記憶内容の場合、データ
線27eには0x75,データ線27fには0x7e,
データ線27gには0x55,データ線27hには0x
3eというデータが出力され、これがセンスアンプ32
bで増幅されてリードデータ線35bに出力される。
On the other hand, in the cache search by the reference address obtained by adding 1 to the index address 24 in the reference address 22, the decoder 3 of FIG. 6 which constitutes the selector 17b.
Since 2 bits of 11 are input to 0a and 30b, of the outputs of the selected data memory array 15, the decoder 30a selects the address 0xf and the decoder 30b selects the address 0xe, while the decoders 30c and 30d. Since 2 bits of 00 are input to the decoder 30, the decoder 30c outputs 0.
The address x1 and the decoder 30d select the address 0x0. Therefore, in the case of the storage contents shown in FIG. 5, 0x75 is assigned to the data line 27e and 0x7e is assigned to the data line 27f.
0x55 for data line 27g and 0x for data line 27h
The data 3e is output, and this is the sense amplifier 32.
It is amplified by b and output to the read data line 35b.

【0060】そして、データセレクタ42は、バイト選
択信号40に従って、上位2バイトはリードデータ線3
5aからのデータを選択し、下位2バイトはリードデー
タ線35bからのデータを選択し、汎用レジスタ21に
書き込む。従って、図5に示した記憶内容の場合、汎用
レジスタ21には0x656e553eという値の1ワ
ードが格納されることになる。
Then, according to the byte selection signal 40, the data selector 42 sets the upper 2 bytes to the read data line 3
The data from 5a is selected, the lower 2 bytes are selected from the read data line 35b, and are written in the general-purpose register 21. Therefore, in the case of the storage contents shown in FIG. 5, one word having a value of 0x656e553e is stored in the general-purpose register 21.

【0061】なお、2つの参照アドレスによる並列キャ
ッシングの場合には、両者のキャッシュのヒットミス結
果信号20a,20bが異なる可能性がある。この場
合、ヒットミス判定装置41では、ミスという結果とし
て、ヒットミス結果信号43を出力する。キャッシュミ
スとなった場合には、キャッシュの内容を、要求するア
ドレスに入れ換えた後に、もう一度アクセスを行う。
In the case of parallel caching with two reference addresses, the hit-miss result signals 20a and 20b of both caches may be different. In this case, the hit-miss determination device 41 outputs the hit-miss result signal 43 as a result of the miss. If a cache miss occurs, the contents of the cache are replaced with the requested address, and then the access is performed again.

【0062】(B)ストアオペレーション 参照アドレス22が4バイト境界にならず且つキャッシ
ュライン間に跨がる場合、参照アドレスそのものと、そ
のインデックスアドレスを+1した参照アドレスとに基
づくキャッシュ検索が並行して行われる。例えば、0x
70ac301e番地から0x70ac3021番地の
4バイトにデータをストアする場合、参照アドレス22
に0x70ac301e番地が指定されてストア要求が
行われるが、このとき参照アドレスそのものに基づくキ
ャッシュ検索では、セレクタ17aは、ワード・バイト
アドレス25(この場合、1110)に基づき、ライト
セル44aのバイト列のうち、0x0,0x1,0x
e,0xfを有効とすべくゲート48を制御する。但
し、バイト選択信号40が、上位2バイトはリードデー
タ線35a側を選択する旨示しているので、汎用レジス
タ21の4バイト1ワードのうち上位2バイトがライト
セル44aの0xe〜0xfのバイト位置にセットさ
れ、次いで、データ線16を通じて、ヒットしたデータ
メモリアレイ15aの0xe〜0xfのバイト位置に書
き込まれる。他方、インデックスアドレスを+1した参
照アドレスに基づくキャッシュ検索でも、セレクタ17
bは、ワード・バイトアドレス25(この場合、111
0)に基づき、ライトセル44bのバイト列のうち、0
x0,0x1,0xe,0xfを有効とすべくゲート4
8を制御する。但し、バイト選択信号40が、下位2バ
イトはリードデータ線35b側を選択する旨示している
ので、汎用レジスタ21の4バイト1ワードのうち下位
2バイトがライトセル44bの0x0〜0x1のバイト
位置にセットされ、次いで、データ線16を通じて、ヒ
ットしたデータメモリアレイ15bの0x0〜0x1の
バイト位置に書き込まれる。
(B) Store operation When the reference address 22 is not on a 4-byte boundary and extends across cache lines, cache search based on the reference address itself and the reference address obtained by adding 1 to the index address is performed in parallel. Done. For example, 0x
When data is stored in 4 bytes from address 70ac301e to address 0x70ac3021, reference address 22
The address 0x70ac301e is specified for a store request, but at this time, in the cache search based on the reference address itself, the selector 17a uses the word / byte address 25 (1110 in this case) to determine the byte string of the write cell 44a. Of which, 0x0, 0x1, 0x
The gate 48 is controlled so that e and 0xf are valid. However, since the byte selection signal 40 indicates that the upper 2 bytes select the read data line 35a side, the upper 2 bytes of the 4 byte 1 word of the general-purpose register 21 are the byte positions of 0xe to 0xf of the write cell 44a. Is written to the byte position of 0xe to 0xf of the hit data memory array 15a through the data line 16. On the other hand, even in the cache search based on the reference address obtained by adding 1 to the index address, the selector 17
b is the word / byte address 25 (in this case, 111
0) of the byte string of the write cell 44b based on 0).
Gate 4 to validate x0, 0x1, 0xe, 0xf
8 is controlled. However, since the byte selection signal 40 indicates that the lower 2 bytes select the read data line 35b side, the lower 2 bytes of the 4 byte 1 word of the general register 21 are the byte positions of 0x0 to 0x1 of the write cell 44b. Is written to the byte position of 0x0 to 0x1 of the hit data memory array 15b through the data line 16.

【0063】なお、以上の各実施例とも、キャッシュを
二重化し同時に2ラインを索くことによって、キャッシ
ュライン間に跨がったアクセスをサイクル数の増加なく
実現している。従って、二重化のために若干のコストが
上昇する可能性がある。しかしながら、高性能プロセッ
サには、複数のロード,ストア命令を同時に実行できる
ようにしたものがあり、その場合は、キャッシュメモリ
は二重化されており、キャッシュラインに跨がる非整列
ロード,ストア時には同時アクセスをしない構成に拡張
すれば、コスト上昇は最小に抑えることができる。
In each of the above-described embodiments, the cache is duplicated and two lines are searched at the same time, so that the access across the cache lines is realized without increasing the number of cycles. Therefore, the cost may be slightly increased due to the duplication. However, there are some high-performance processors that can execute multiple load and store instructions at the same time. In that case, the cache memory is duplicated, and at the time of unaligned load and store across cache lines, simultaneous execution is possible. The cost increase can be minimized by expanding the configuration to no access.

【0064】また、上述の各実施例では、最上位アドレ
スとなるデータがレジスタの最上位バイトの位置に格納
されない場合が生じる。このため低精度並列演算以外に
用いる場合には、ワードデータとしてデータを扱えるよ
うにするためにデータの値を回転シフトする必要が生じ
る。第7図はこのような問題に対処すべく拡張を行った
本発明の更に別の実施例のブロック図であり、図1の実
施例に、バイト単位で回転シフトを行うバイトローテー
タ60とシフト量を保持しておく整列用レジスタ61を
追加したものである。なお、図6の実施例に対しても同
様の変形を行うことが可能である。
Further, in each of the above-mentioned embodiments, there is a case where the data of the highest address is not stored in the position of the highest byte of the register. Therefore, when it is used for other than the low-precision parallel operation, it becomes necessary to rotationally shift the data value so that the data can be handled as word data. FIG. 7 is a block diagram of a further embodiment of the present invention which has been expanded to cope with such a problem. In the embodiment of FIG. 1, a byte rotator 60 for performing rotation shift in byte units and a shift amount. Alignment register 61 for holding is added. It should be noted that similar modifications can be made to the embodiment of FIG.

【0065】整列用レジスタ61には、汎用レジスタ2
1にロードしたデータのアドレスの下位2ビットのバイ
ト情報が格納される。非整列ロード命令によって汎用レ
ジスタ21にロードされた値は、レジスタ整列命令を実
行すると、バイトローテータ60によって整列用レジス
タ61の値だけバイト単位で右回転シフトされ、その値
が汎用レジスタ21に書き戻される。
The alignment register 61 includes a general-purpose register 2
The byte information of the lower 2 bits of the address of the data loaded into 1 is stored. When the register alignment instruction is executed, the value loaded into the general-purpose register 21 by the unaligned load instruction is right-shifted in bytes by the byte rotator 60 by the value of the alignment register 61, and the value is written back to the general-purpose register 21. Be done.

【0066】例えば、前述の0x70ac3011番地
をアクセスした場合には、汎用レジスタ21には当初レ
ジスタ700a6585という順に値が格納されるが、
整列命令を実行することによって、整列用レジスタ61
の内容はこの場合は1なので、右に1バイト回転シフト
が生じ、その値が汎用レジスタ21に書き戻されるた
め、汎用レジスタ21の内容は0x85700a65と
なる。
For example, when the above-mentioned address 0x70ac3011 is accessed, values are initially stored in the general register 21 in the order of the register 700a6585.
By executing the alignment instruction, the alignment register 61
Since the content of 1 is 1 in this case, a 1-byte rotation shift occurs to the right and the value is written back to the general-purpose register 21, so the content of the general-purpose register 21 becomes 0x85700a65.

【0067】従って、ロード命令後に1命令の整列命令
を追加する必要が生じるが、従来例よりも簡単な機構で
データのメモリ配置順にレジスタにロードすることが可
能となる。
Therefore, although it is necessary to add one alignment instruction after the load instruction, it is possible to load the data into the registers in the memory arrangement order with a simpler mechanism than the conventional example.

【0068】以上本発明の実施例について説明したが、
本発明は以上の実施例にのみ限定されず、その他各種の
付加変更が可能である。例えば、キャッシュへの書き込
みには一度ラインの全てを読み込んでから変更するとい
ったキャッシュメモリ構造の場合にも同様に適用可能で
ある。
The embodiments of the present invention have been described above.
The present invention is not limited to the above embodiments, and various other additions and changes are possible. For example, the same can be applied to the case of a cache memory structure in which all the lines are once read and then changed for writing to the cache.

【0069】[0069]

【発明の効果】以上説明したように、ワード境界に跨が
って格納されている非整列データをキャッシュとレジス
タ装置間で転送する場合、従来はデータ整列装置を用い
て2回に分けて転送を行う必要があったが、本発明よれ
ば、1回の転送で終了させることができる。これによっ
て、画像処理などのバイト単位や2バイト単位でデータ
が格納されている問題などで、低精度並列演算命令と組
み合わせることによって、処理を高速化することが可能
となる。
As described above, when transferring unaligned data stored across word boundaries between a cache and a register device, conventionally, the data is aligned and transferred in two steps. However, according to the present invention, the transfer can be completed by one transfer. This makes it possible to speed up the processing by combining it with a low-precision parallel operation instruction in the problem that data is stored in byte units or 2-byte units such as in image processing.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の一実施例のブロック図である。FIG. 1 is a block diagram of one embodiment of the present invention.

【図2】奇数ライン用および偶数ライン用のキャッシュ
メモリの構成例を示すブロック図である。
FIG. 2 is a block diagram showing a configuration example of an odd line cache memory and an even line cache memory.

【図3】キャッシュメモリ内の一部分のより詳細な構成
例を示すブロック図である。
FIG. 3 is a block diagram showing a more detailed configuration example of a part of the cache memory.

【図4】奇数偶数選択ビットおよびワード・バイトアド
レスの値と、奇数キャッシュ選択信号,偶数キャッシュ
選択信号の状態およびインデックス加算信号の値との関
係を示す図である。
FIG. 4 is a diagram showing a relationship between values of odd / even selection bits and word / byte addresses, states of odd cache selection signals and even cache selection signals, and values of index addition signals.

【図5】キャッシュに格納されているデータのイメージ
を示す図である。
FIG. 5 is a diagram showing an image of data stored in a cache.

【図6】本発明の別の実施例のブロック図である。FIG. 6 is a block diagram of another embodiment of the present invention.

【図7】本発明の更に別の実施例のブロック図である。FIG. 7 is a block diagram of yet another embodiment of the present invention.

【図8】従来のキャッシュ構成を示すブロック図であ
る。
FIG. 8 is a block diagram showing a conventional cache configuration.

【図9】従来のキャッシュ構成の一部分のより詳細な構
成例を示すブロック図である。
FIG. 9 is a block diagram showing a more detailed configuration example of a part of a conventional cache configuration.

【図10】非整列データの転送を行う従来技術のブロッ
ク図である。
FIG. 10 is a block diagram of a conventional technique for transferring non-aligned data.

【符号の説明】[Explanation of symbols]

10,10a,10b…キャッシュメモリ 11…データメモリアレイ 12…タグメモリアレイ 13…有効ビット 14,14a,14b…デコーダ 15,15a,15b…選択されたデータメモリアレイ 16…データ線(8ビット幅) 17,17a,17b…セレクタ 18,18a,18b…アドレスコンパレータ 19,19a,19b…有効判定部 20,20a,20b…ヒットミス結果信号 21…汎用レジスタ 22…参照アドレス 23…タグアドレス 24…インデックスアドレス 25…ワード・バイトアドレス 26…スイッチゲート 27a,27b,27c,27d,27e,27f,2
7g,27h…データ線 29…イネーブラ 30,30a,30b,30c,30d…デコーダ 31a,31b,31c…加算器 32,32a,32b…センスアンプ 33…入力データサイズ情報線 34…ライトデータ線 35,35a,35b…リードデータ線 36…キャッシュセレクタ 37…奇数偶数選択ビット 38…インデックス加算信号 39a…奇数キャッシュ選択信号 39b…偶数キャッシュ選択信号 40…バイト選択信号 41…ヒットミス判定装置 42…データセレクタ 43…ヒットミス結果信号 44,44a,44b…ライトセル 45…加算器 46…アンドゲート 47…ノアゲート 48…ゲート 50…2ポート構造のキャッシュメモリ 51…2ポート構造のデータメモリアレイ 52…2ポート構造のタグメモリアレイ 53…2ポート構造の有効ビット 54…キャッシュセレクタ 55…加算後のインデックスアドレス 56…2ライン検索信号 60…バイトローテータ 61…整列用レジスタ
10, 10a, 10b ... Cache memory 11 ... Data memory array 12 ... Tag memory array 13 ... Effective bit 14, 14a, 14b ... Decoder 15, 15a, 15b ... Selected data memory array 16 ... Data line (8-bit width) 17, 17a, 17b ... Selector 18, 18a, 18b ... Address comparator 19, 19a, 19b ... Validity determination section 20, 20a, 20b ... Hit-miss result signal 21 ... General-purpose register 22 ... Reference address 23 ... Tag address 24 ... Index address 25 ... Word / byte address 26 ... Switch gate 27a, 27b, 27c, 27d, 27e, 27f, 2
7g, 27h ... Data line 29 ... Enabler 30, 30a, 30b, 30c, 30d ... Decoder 31a, 31b, 31c ... Adder 32, 32a, 32b ... Sense amplifier 33 ... Input data size information line 34 ... Write data line 35, 35a, 35b ... Read data line 36 ... Cache selector 37 ... Odd / even selection bit 38 ... Index addition signal 39a ... Odd cache selection signal 39b ... Even cache selection signal 40 ... Byte selection signal 41 ... Hit miss judgment device 42 ... Data selector 43 ... hit miss result signal 44, 44a, 44b ... write cell 45 ... adder 46 ... AND gate 47 ... NOR gate 48 ... gate 50 ... 2-port structure cache memory 51 ... 2-port structure data memory array 52 ... 2-port structure Tag memorial B 53 ... 2-port index address 56 ... 2 line search signal 60 ... byte rotator 61 ... alignment register valid bit 54 ... cache selector 55 ... after the addition of structure

Claims (7)

【特許請求の範囲】[Claims] 【請求項1】 演算に必要なデータを、キャッシュ記憶
装置からレジスタ装置に転送して、計算を行う手段を備
えたプロセッサにおいて、 転送するデータの基本データ長(ワード長)が、データ
領域を指定するアドレスを付加する単位(バイト)より
も長い場合で且つ転送するデータの先頭アドレスがワー
ド長の整数倍にならない非整列データのロード,ストア
において、ワード単位でのデータのバイト整列順序を、
所望データの先頭アドレスとキャッシュ記憶装置の記憶
単位に応じて変えることによって、1回の転送で非整列
データをロード,ストアし、さらに、偶数アドレスと奇
数アドレスを保持するキャッシュ記憶装置と、バイト単
位でこれらの出力を選択する手段を備え、キャッシュ記
憶装置を同時にアクセスし、バイト単位で所望データを
選択することによって、1回の転送でレジスタ装置との
データ転送を行う構成を有することを特徴とするキャッ
シュ記憶装置における非整列データ転送機構。
1. In a processor having means for transferring data required for calculation from a cache storage device to a register device and performing calculation, a basic data length (word length) of data to be transferred specifies a data area. When the length is longer than the unit (byte) to add the address to be transferred and the start address of the data to be transferred does not become an integer multiple of the word length, when loading or storing unaligned data, the byte alignment order of the data in word units,
By changing the start address of the desired data and the storage unit of the cache storage device, the unaligned data is loaded and stored in one transfer, and the cache storage device holds even and odd addresses, and byte unit And a structure for performing data transfer with the register device by one-time transfer by simultaneously accessing the cache storage device and selecting desired data in byte units. A non-aligned data transfer mechanism in a cache storage device.
【請求項2】 ワード長がデータ領域を指定するアドレ
スを付加する単位であるバイトの2のN(Nは正の整
数)乗倍となるアーキテクチャを採用するマイクロプロ
セッサで使用され、ワード単位の2のM(Mは正の整
数)乗倍のサイズであるライン単位で主記憶の写しを保
持するキャッシュ記憶装置において、 下位(M+N+1)ビット目が奇数になるアドレスの主
記憶の写しをライン単位で保持し、キャッシュヒット時
には、ヒットしたラインのうち、入力されたアドレスの
下位(M+N)ビットが指し示すバイトを先頭とする1
ワード長分のバイト列を出力する奇数キャッシュメモリ
と、 下位(M+N+1)ビット目が偶数になるアドレスの主
記憶の写しをライン単位で保持し、キャッシュヒット時
には、ヒットしたラインのうち、入力されたアドレスの
下位(M+N)ビットが指し示すバイトを先頭とする1
ワード長分のバイト列を出力する偶数キャッシュメモリ
と、 前記奇数キャッシュメモリから出力されたバイト列と前
記偶数キャッシュメモリから出力されたバイト列とを入
力とし、バイト選択信号に基づいて、各バイト単位で何
れか一方の出力を選択してレジスタ装置に出力すべきワ
ードを生成するデータセレクタと、 ロードオペレーション時、キャッシュに対する参照アド
レスの下位(M+N+1)ビットの値に基づいて、参照
アドレスを与えての前記奇数キャッシュメモリによる単
独キャッシング動作、参照アドレスを与えての前記偶数
キャッシュメモリによる単独キャッシング動作,参照ア
ドレスを与えての前記奇数キャッシュメモリによるキャ
ッシング動作と参照アドレスまたは参照アドレス中の
(M+N+1)ビット目に1を加算した参照アドレスを
与えての前記偶数キャッシュメモリによるキャッシング
動作との並列動作を制御すると共に、前記バイト選択信
号を出力するキャッシュセレクタとを備えることを特徴
とするキャッシュ記憶装置における非整列データ転送機
構。
2. The microprocessor is used in a microprocessor adopting an architecture in which a word length is a power of 2 times N (N is a positive integer) times a byte, which is a unit for adding an address designating a data area. In a cache memory device that holds a copy of the main memory in units of lines that is M times the size of M (M is a positive integer), a copy of the main memory at the address where the lower (M + N + 1) th bit is an odd number Hold, and at the time of a cache hit, start with the byte indicated by the lower (M + N) bits of the input address in the line hit
Holds a line-by-line copy of the odd-numbered cache memory that outputs a word-length byte string and the main memory at the address where the lower (M + N + 1) th bit becomes an even number. 1 starting from the byte indicated by the lower (M + N) bits of the address
An even cache memory that outputs a byte string for a word length, and a byte string output from the odd cache memory and a byte string output from the even cache memory are input, and each byte unit is based on a byte selection signal. And a data selector that selects one of the outputs to generate a word to be output to the register device and a reference address is given based on the value of the lower (M + N + 1) bits of the reference address for the cache during the load operation. Single cache operation by the odd cache memory, single cache operation by the even cache memory with a reference address, cache operation by the odd cache memory with a reference address, and a reference address or (M + N + 1) th bit in the reference address Add 1 to Controls the parallel operation of the caching operation by the even cache memory of giving reference address, unaligned data transfer unit in the cache memory, characterized in that it comprises a cache selector for outputting the byte selection signal.
【請求項3】 ワード長がデータ領域を指定するアドレ
スを付加する単位であるバイトの2のN(Nは正の整
数)乗倍となるアーキテクチャを採用するマイクロプロ
セッサで使用され、ワード単位の2のM(Mは正の整
数)乗倍のサイズであるライン単位で主記憶の写しを保
持するキャッシュ記憶装置において、 下位(M+N+1)ビット目が奇数になるアドレスの主
記憶の写しをライン単位で保持し、キャッシュヒット時
には、入力されたアドレスの下位(M+N)ビットの値
およびバイト選択信号に応じてレジスタ装置からバイト
単位で選択的に入力データをライトセルにセットした
後、ヒットしたライン中の該当するバイト位置へ選択的
に書き込む奇数キャッシュメモリと、 下位(M+N+1)ビット目が偶数になるアドレスの主
記憶の写しをライン単位で保持し、キャッシュヒット時
には、入力されたアドレスの下位(M+N)ビットの値
およびバイト選択信号に応じてレジスタ装置からバイト
単位で選択的に入力データをライトセルにセットした
後、ヒットしたライン中の該当するバイト位置へ選択的
に書き込む偶数キャッシュメモリと、 ストアオペレーション時、キャッシュに対する参照アド
レスの下位(M+N+1)ビットの値に基づいて、参照
アドレスを与えての前記奇数キャッシュメモリによる単
独キャッシング動作、参照アドレスを与えての前記偶数
キャッシュメモリによる単独キャッシング動作,参照ア
ドレスを与えての前記奇数キャッシュメモリによるキャ
ッシング動作と参照アドレスまたは参照アドレス中の
(M+N+1)ビット目に1を加算した参照アドレスを
与えての前記偶数キャッシュメモリによるキャッシング
動作との並列動作を制御すると共に、前記バイト選択信
号を出力するキャッシュセレクタとを備えることを特徴
とするキャッシュ記憶装置における非整列データ転送機
構。
3. The microprocessor is used in a microprocessor adopting an architecture in which a word length is a power of 2 times N of a byte (N is a positive integer), which is a unit for adding an address designating a data area, and 2 in a word unit is used. In a cache memory device that holds a copy of the main memory in units of lines that is M times the size of M (M is a positive integer), a copy of the main memory at the address where the lower (M + N + 1) th bit is an odd number When a cache hit occurs, after the input data is selectively set in the write cell in byte units from the register device according to the value of the lower (M + N) bits of the input address and the byte select signal, the data in the hit line is Odd cache memory that selectively writes to the corresponding byte position, and main memory at addresses where the lower (M + N + 1) th bit is even The copy is held in line units, and at the time of a cache hit, after input data is selectively set in the write cell from the register device in byte units according to the value of the lower (M + N) bits of the input address and the byte selection signal, By the even cache memory that selectively writes to the corresponding byte position in the hit line, and by the odd cache memory that gives the reference address based on the value of the lower (M + N + 1) bits of the reference address for the cache during the store operation. Single caching operation, single caching operation by the even cache memory given a reference address, caching operation by the odd cache memory given a reference address, and 1 is added to the (M + N + 1) th bit of the reference address or reference address reference Controls the parallel operation of the caching operation by the even cache memory of giving dresses, unaligned data transfer unit in the cache memory, characterized in that it comprises a cache selector for outputting the byte selection signal.
【請求項4】 演算に必要なデータを、キャッシュ記憶
装置からレジスタ装置に転送して、計算を行う手段を備
えたプロセッサにおいて、 転送するデータの基本データ長(ワード長)が、データ
領域を指定するアドレスを付加する単位(バイト)より
も長い場合で且つ転送するデータの先頭アドレスがワー
ド長の整数倍にならない非整列データのロード,ストア
において、ワード単位でのデータのバイト整列順序を、
所望データの先頭アドレスとキャッシュ記憶装置の記憶
単位に応じて変えることによって、1回の転送で非整列
データをロード,ストアし、さらに、記憶装置のデータ
記憶単位の境界に跨がるようなデータ転送が必要な場合
において、同時に複数のアクセスを可能とするキャッシ
ュ記憶装置と、バイト単位でこれらの出力を選択する手
段を備え、キャッシュ記憶装置を同時にアクセスするこ
とによって、1回の転送でレジスタ装置とのデータ転送
を行う構成を有することを特徴とするキャッシュ記憶装
置における非整列データ転送機構。
4. In a processor having means for transferring data required for operation from a cache storage device to a register device and performing calculation, a basic data length (word length) of data to be transferred specifies a data area. When the length is longer than the unit (byte) to add the address to be transferred and the start address of the data to be transferred does not become an integer multiple of the word length, when loading or storing unaligned data, the byte alignment order of the data in word units,
Data that loads and stores unaligned data in a single transfer by changing it according to the start address of the desired data and the storage unit of the cache storage device, and also that spans the boundaries of the data storage unit of the storage device. When a transfer is required, a cache storage device that enables a plurality of accesses at the same time and a means for selecting these outputs in byte units are provided. By simultaneously accessing the cache storage device, the register device can be transferred in one transfer. A non-aligned data transfer mechanism in a cache storage device, which is configured to transfer data to and from.
【請求項5】 ワード長がデータ領域を指定するアドレ
スを付加する単位であるバイトの2のN(Nは正の整
数)乗倍となるアーキテクチャを採用するマイクロプロ
セッサで使用され、ワード単位の2のM(Mは正の整
数)乗倍のサイズであるライン単位で主記憶の写しを保
持するキャッシュ記憶装置において、 主記憶の写しをライン単位で保持するデュアルポート構
造のデータメモリアレイを有し、同時に2つの参照アド
レスについてキャッシュを索くことができ、且つ、各々
のキャッシュヒット時には参照アドレスの下位(M+
N)ビットが指し示すバイトを先頭とする1ワード長分
のバイト列を出力するキャッシュメモリと、 該キャッシュメモリから出力される2個のバイト列を入
力とし、バイト選択信号に基づいて、各バイト単位で何
れか一方のバイト列を選択してレジスタ装置に出力すべ
きワードを生成するデータセレクタと、 キャッシュに対する参照アドレスの下位(M+N)ビッ
トの値に基づいて、その参照アドレスそのものを前記キ
ャッシュメモリに与えての単独キャッシング動作、その
参照アドレスそのものとその参照アドレス中の(M+N
+1)ビット目に1を加算した参照アドレスとの2つの
参照アドレスを前記キャッシュメモリに与えての並列キ
ャッシュング動作とを制御すると共に、前記バイト選択
信号を出力するキャッシュセレクタとを備えることを特
徴とするキャッシュ記憶装置における非整列データ転送
機構。
5. A microprocessor is used in a microprocessor adopting an architecture in which a word length is a power of 2 times N (N is a positive integer) which is a unit for adding an address designating a data area. In a cache storage device that holds a copy of the main memory in line units, which is a size that is M times (where M is a positive integer) times, a data memory array having a dual port structure that holds a copy of the main memory in line units. , The cache can be searched for two reference addresses at the same time, and at the time of each cache hit, the lower order of the reference address (M +
N) A cache memory that outputs a byte string for one word length starting with the byte indicated by the bit, and two byte strings output from the cache memory are input, and each byte unit is based on the byte selection signal. , A data selector which selects one of the byte strings to generate a word to be output to the register device, and the reference address itself is stored in the cache memory based on the value of the lower (M + N) bits of the reference address for the cache. The given independent caching operation, the reference address itself and (M + N
A cache selector that outputs a byte selection signal while controlling two parallel reference addresses, that is, a reference address obtained by adding 1 to the +1) th bit, to the cache memory and outputting the byte selection signal. A non-aligned data transfer mechanism in a cache storage device.
【請求項6】 ワード長がデータ領域を指定するアドレ
スを付加する単位であるバイトの2のN(Nは正の整
数)乗倍となるアーキテクチャを採用するマイクロプロ
セッサで使用され、ワード単位の2のM(Mは正の整
数)乗倍のサイズであるライン単位で主記憶の写しを保
持するキャッシュ記憶装置において、 主記憶の写しをライン単位で保持するデュアルポート構
造のデータメモリアレイを有し、同時に2つの参照アド
レスについてキャッシュを索くことができ、且つ、各々
のキャッシュヒット時には、参照アドレスの下位(M+
N)ビットの値およびバイト選択信号に応じてレジスタ
装置からバイト単位で選択的に入力データを各々のライ
トセルにセットした後、ヒットしたライン中の該当する
バイト位置ヘ選択的に書き込むキャッシュメモリと、 キャッシュに対する参照アドレスの下位(M+N)ビッ
トの値に基づいて、その参照アドレスそのものを前記キ
ャッシュメモリに与えての単独キャッシング動作、その
参照アドレスそのものとその参照アドレス中の(M+N
+1)ビット目に1を加算した参照アドレスとの2つの
参照アドレスを前記キャッシュメモリに与えての並列キ
ャッシュング動作とを制御すると共に、前記バイト選択
信号を出力するキャッシュセレクタとを備えることを特
徴とするキャッシュ記憶装置における非整列データ転送
機構。
6. A word length is used in a microprocessor adopting an architecture in which a byte is a power of 2 times N (N is a positive integer), which is a unit for adding an address designating a data area, and 2 in a word unit is used. In a cache storage device that holds a copy of the main memory in line units, which is a size that is M times (where M is a positive integer) times, a data memory array having a dual port structure that holds a copy of the main memory in line units. , The cache can be searched for two reference addresses at the same time, and at the time of each cache hit, the lower (M +
N) A cache memory in which input data is selectively set in byte units from a register device according to a bit value and a byte selection signal and then selectively written to a corresponding byte position in a hit line. , A single caching operation in which the reference address itself is given to the cache memory based on the value of the lower (M + N) bits of the reference address for the cache, the reference address itself and (M + N) in the reference address
A cache selector that outputs a byte selection signal while controlling two parallel reference addresses, that is, a reference address obtained by adding 1 to the +1) th bit, to the cache memory and outputting the byte selection signal. A non-aligned data transfer mechanism in a cache storage device.
【請求項7】 前記レジスタ装置に保持されたバイト列
を前記参照アドレスの値に応じて回転シフトして、前記
レジスタ装置内のバイトの配置順序をアドレス順に並べ
替えるバイトローテータを備えることを特徴とする請求
項1,2,3,4,5または6記載のキャッシュ記憶装
置における非整列データ転送機構。
7. A byte rotator for rotating and shifting the byte string held in the register device according to the value of the reference address, and rearranging the byte arrangement order in the register device in the order of address. An unaligned data transfer mechanism in a cache storage device according to claim 1, 2, 3, 4, 5 or 6.
JP7318656A 1995-10-17 1995-10-17 Non-aligned data transfer mechanism in cache storage device Pending JPH09114733A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7318656A JPH09114733A (en) 1995-10-17 1995-10-17 Non-aligned data transfer mechanism in cache storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7318656A JPH09114733A (en) 1995-10-17 1995-10-17 Non-aligned data transfer mechanism in cache storage device

Publications (1)

Publication Number Publication Date
JPH09114733A true JPH09114733A (en) 1997-05-02

Family

ID=18101575

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7318656A Pending JPH09114733A (en) 1995-10-17 1995-10-17 Non-aligned data transfer mechanism in cache storage device

Country Status (1)

Country Link
JP (1) JPH09114733A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6112297A (en) * 1998-02-10 2000-08-29 International Business Machines Corporation Apparatus and method for processing misaligned load instructions in a processor supporting out of order execution
KR100335747B1 (en) * 1998-02-09 2002-05-08 포만 제프리 엘 Method and apparatus for loading an instruction buffer of a processor capable of out-of-order instruction issue
WO2012135429A3 (en) * 2011-04-01 2012-12-27 Intel Corporation Method and system for optimizing prefetching of cache memory lines

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100335747B1 (en) * 1998-02-09 2002-05-08 포만 제프리 엘 Method and apparatus for loading an instruction buffer of a processor capable of out-of-order instruction issue
US6112297A (en) * 1998-02-10 2000-08-29 International Business Machines Corporation Apparatus and method for processing misaligned load instructions in a processor supporting out of order execution
WO2012135429A3 (en) * 2011-04-01 2012-12-27 Intel Corporation Method and system for optimizing prefetching of cache memory lines
US9063860B2 (en) 2011-04-01 2015-06-23 Intel Corporation Method and system for optimizing prefetching of cache memory lines

Similar Documents

Publication Publication Date Title
US7370150B2 (en) System and method for managing a cache memory
EP1047989B1 (en) Digital signal processor having data alignment buffer for performing unaligned data accesses
US7694109B2 (en) Data processing apparatus of high speed process using memory of low speed and low power consumption
US5239642A (en) Data processor with shared control and drive circuitry for both breakpoint and content addressable storage devices
US8793433B2 (en) Digital data processing apparatus having multi-level register file
US7707393B2 (en) Microprocessor with high speed memory integrated in load/store unit to efficiently perform scatter and gather operations
JP3593346B2 (en) Multiport memory and data processing device accessing the same
CN101432703B (en) Method and apparatus for caching variable length instructions
JP2004157593A (en) Multiport integration cache
JPH01502700A (en) RISC type computer and method for processing unaligned references
JP2001142776A (en) How to load data and how to store data
JPH03129433A (en) Device and method for parallel processing
JPH05173837A (en) Data processing system wherein static masking and dynamic masking of information in operand are both provided
JPH0786845B2 (en) Data processing device
US6687808B2 (en) Data processor using indirect register addressing
EP0772819B1 (en) Apparatus and method for efficiently determining addresses for misaligned data stored in memory
US7103756B2 (en) Data processor with individually writable register subword locations
JPH09114733A (en) Non-aligned data transfer mechanism in cache storage device
JPS6049340B2 (en) Branch instruction prefetch method
US4737908A (en) Buffer memory control system
US5276853A (en) Cache system
JPH10116229A (en) Data processing device
JP2861560B2 (en) Data processing device
JPH07200406A (en) Cash system
JP2001505327A (en) Data memory unit configured to store data within one clock cycle, and method of operation thereof