JP5968693B2 - Semiconductor device - Google Patents
Semiconductor device Download PDFInfo
- Publication number
- JP5968693B2 JP5968693B2 JP2012141718A JP2012141718A JP5968693B2 JP 5968693 B2 JP5968693 B2 JP 5968693B2 JP 2012141718 A JP2012141718 A JP 2012141718A JP 2012141718 A JP2012141718 A JP 2012141718A JP 5968693 B2 JP5968693 B2 JP 5968693B2
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- cache
- bit
- address
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Advance Control (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Description
本発明は、半導体装置に関し、たとえば、キャッシュメモリを有する半導体装置に関する。 The present invention relates to a semiconductor device, for example, a semiconductor device having a cache memory.
従来から、メモリアクセスを高速化する方式が知られている。
特許文献1(特開2001−142698号公報)のメモリアクセス方式では、主記憶装置が、複数の命令コードにより記述されたプログラムを記憶し、中央演算処理装置が、記主記憶装置に記憶されたプログラムを読み込み、読み込んだプログラムに記述された命令コードに従って命令を実行する。命令用メモリは、主記憶装置と比べて高速に読み込み可能であり、中央演算処理装置が実行中の命令の次に実行する次命令の命令コードが記憶されているアドレスが、実行中の命令の命令コードが記憶されているアドレスと連続していないアドレス不連続命令について、アドレス不連続命令の命令コードを記憶する。高速アクセス制御部が、次命令がアドレス不連続命令であることを検出し、アドレス不連続命令の場合には、命令用メモリに記憶されたアドレス不連続命令の命令コードを検索して命令用メモリからアドレス不連続命令の命令コードを取得し、取得した命令コードを中央演算処理装置に転送する。
Conventionally, a method for speeding up memory access is known.
In the memory access method of Patent Document 1 (Japanese Patent Laid-Open No. 2001-142698), the main storage device stores a program described by a plurality of instruction codes, and the central processing unit is stored in the storage device. The program is read and the instruction is executed according to the instruction code described in the read program. The instruction memory can be read faster than the main memory, and the address where the instruction code of the next instruction to be executed next to the instruction being executed by the central processing unit is stored is the address of the instruction being executed. For an address discontinuous instruction that is not continuous with the address where the instruction code is stored, the instruction code of the address discontinuous instruction is stored. The high-speed access control unit detects that the next instruction is an address discontinuous instruction, and in the case of an address discontinuous instruction, searches the instruction code of the address discontinuous instruction stored in the instruction memory to search the instruction memory. The instruction code of the address discontinuous instruction is obtained from the data, and the obtained instruction code is transferred to the central processing unit.
また、特許文献2(特開2006−293748号公報)には、情報処理モジュールの入力インターフェースにスキップビット数を設定できるようにすることで、先頭アドレスに対して設定されたスキップビット数分を読み飛ばしてから、処理を開始することできるため、nビットアライメントされていない領域からも正しく入力データを与えることを可能とした情報処理装置が記載されている。 Patent Document 2 (Japanese Patent Application Laid-Open No. 2006-293748) reads the number of skip bits set for the head address by enabling the number of skip bits to be set in the input interface of the information processing module. An information processing apparatus is described in which processing can be started after skipping, so that input data can be correctly supplied from an area that is not n-bit aligned.
しかしながら、特許文献1および特許文献2の方式では、分岐先命令などの命令が複数のキャッシュラインに跨って登録されてしまうことがあり、キャッシュのヒット率が上がらず、メモリアクセス待ちが発生するという問題がある。
However, in the methods of
その他の課題と新規な特徴は、本明細書の記述および添付図面から明らかであろう。 Other problems and novel features will be apparent from the description of this specification and the accompanying drawings.
一実施の形態の半導体装置は、ビット幅がNビットであるメインメモリと、L(N×X:Xは2以上の整数)ビット幅のキャッシュラインを有するキャッシュメモリと、キャッシュ制御部を備える。キャッシュ制御部は、メインメモリに記憶されているMビット(2×M≦L)の命令をキャッシュメモリに登録する場合に、命令の先頭が含まれるNビットの読出し単位データと、後続する(X−1)個のNビットの読出し単位データを1つのキャッシュラインに登録する。 A semiconductor device according to an embodiment includes a main memory having a bit width of N bits, a cache memory having a cache line of L (N × X: X is an integer of 2 or more) bit width, and a cache control unit. When registering an M-bit (2 × M ≦ L) instruction stored in the main memory in the cache memory, the cache control unit includes N-bit read unit data including the head of the instruction and the following (X -1) Register N-bit read unit data in one cache line.
一実施の形態によれば、キャッシュのヒット率を向上させることができる。 According to one embodiment, the cache hit rate can be improved.
以下、本発明の実施の形態について、図面を用いて説明する。
[第1の実施形態]
図1は、第1の実施形態の半導体装置の構成を表わす図である。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[First Embodiment]
FIG. 1 is a diagram illustrating the configuration of the semiconductor device according to the first embodiment.
図1を参照して、この半導体装置1は、メインメモリである命令メモリ8と、CPU2とを備える。
Referring to FIG. 1, the
CPU2は、CPUコア4と、キャッシュメモリ3と、キャッシュ制御部81とを備える。
The
命令メモリ8は、Nビットのビット幅を有する。Nビットの読出し単位データ内で命令の位置がsビットで指定されるものとする。たとえば、s=log2(N/8)とする。N=64の場合には、3である。
The
キャッシュメモリ3は、L(N×X:Xは2以上の自然数)ビット幅のキャッシュラインを有する。キャッシュメモリ3は、各キャッシュラインのデータの命令メモリ内での格納位置を表わすタグアドレスとを記憶する。
The
キャッシュ制御部81は、命令メモリ8に記憶されているMビット(2×M≦L)の命令をキャッシュメモリに登録する場合に、命令の先頭が含まれるNビットの読出し単位データと、後続する(X−1)個のNビットの読出し単位データを1つのキャッシュラインに登録する。ただし、Xは2以上の自然数である。
When registering an M-bit (2 × M ≦ L) instruction stored in the
より具体的には、キャッシュ制御部81は、命令を指定するアドレスの下位のs個のビットを0とした第1のアドレスで指定されるNビットの読出し単位データと、次の(X−1)個のNビットの読出し単位データをキャッシュラインに登録する。また、キャッシュ制御部81は、第1のアドレスの下位sビットを除いた部分をキャッシュラインを指定するタグアドレスとしてキャッシュメモリ3に登録する。
More specifically, the
以上のように、本実施の形態によれば、1つのキャッシュラインに命令の全体が登録されるので、キャッシュのヒット率を向上させることができる。 As described above, according to this embodiment, since the entire instruction is registered in one cache line, the cache hit rate can be improved.
[第2の実施形態]
第2の実施形態では、分岐先命令をキャッシュする好適な構成を説明する。
[Second Embodiment]
In the second embodiment, a preferred configuration for caching a branch destination instruction will be described.
図2は、第2の実施形態の半導体装置の構成を表わす図である。
図2を参照して、この半導体装置1は、CPU(Central Processing Unit)2と、ROM(Read Only Memory)5と、RAM(Random Access Memory)7と、CIF(Cpu InterFace)6とを備える。
FIG. 2 is a diagram illustrating the configuration of the semiconductor device according to the second embodiment.
Referring to FIG. 2, the
CIF6は、RAM7およびROM5と、CPU2との間でデータおよび命令のやりとりを制御する。ROM5は、命令を記憶する命令メモリ8を含む。
The
CPUコア4とROM5との間、CPUコア4とRAM7との間は、CIF6を介して64ビットのバスで接続される。
The CPU core 4 and the
CPU2は、CPUコア4と、キャッシュメモリ3と、キャッシュ制御部81とを有する。
The
CPUコア4は、命令をデコードし、実行する。
キャッシュメモリ3は、キャッシュデータメモリ9と、タグメモリ11と、Vビットメモリ13とを有する。
The CPU core 4 decodes and executes the instruction.
The
キャッシュ制御部81は、LRU(Least Recently Used)15と、入出力制御部10と、アドレス比較器12と、Vビット制御部14と、LRU制御部16と、第1キュー17と、第2キュー18と、シーケンサ19とを有する。
The
命令メモリ8は、64ビットのビット幅を有する。64ビットの読出し単位データ内で命令の位置が3ビット(A0〜A2)で指定される。命令メモリ8内の命令の位置は、25ビットのアドレス(A0〜A24)で指定される。命令メモリ8内の読出し単位データのアドレスは、22ビットのアドレス(A3〜A24)で指定される。
The
キャッシュデータメモリ9は、128ビット幅のキャッシュラインを有する。すなわち、命令メモリ8内の連続する2つの読出し単位データを記憶する。キャッシュラインの2つの読出し単位データのうち、命令メモリ8においてアドレスが小さい方に記憶されていた読出し単位データを前半の64ビットデータ、命令メモリ8においてアドレスが大きい方に記憶されていた読出し単位データを後半の64ビットデータと呼ぶことにする。
The
タグメモリ11は、タグアドレス(A3〜A24)を記憶する。タグアドレスは、対応するキャッシュラインの前半の64ビットデータの命令メモリ8におけるアドレスを表わす。
The
Vビットメモリ13は、バリッドビットV0、V1を記憶する。バリッドビットV0が、「1」の場合には、対応するキャッシュラインの前半の64ビットデータが有効であり、「0」の場合には、対応するキャッシュラインの前半の64ビットデータが無効である。バリッドビットV1が、「1」の場合には、対応するキャッシュラインの後半の64ビットデータが有効であり、「0」の場合には、対応するキャッシュラインの後半の64ビットデータが無効である。
The
1つのキャッシュラインと、そのキャッシュラインに対応するタグアドレスと、そのキャッシュラインに対応するバリッドビットとが1つのエントリを構成する。 One cache line, a tag address corresponding to the cache line, and a valid bit corresponding to the cache line constitute one entry.
LRU15は、最近使用されていないラインを表わす情報を記憶する。
入出力制御部10は、命令メモリ8に記憶されている分岐先命令をキャッシュデータメモリ9に登録する場合に、分岐先命令の先頭が含まれる64ビットの読出し単位データと、後続する64ビットの読出し単位データとを1つのキャッシュラインに登録する。具体的には、入出力制御部10は、分岐先命令を指定するアドレスの下位の3個のビットを0とした第1のアドレスで指定される64ビットの読出し単位データと、次の64ビットの読出し単位データをキャッシュラインに登録する。また、入出力制御部10は、第1のアドレスの下位3ビットを除いた部分をキャッシュラインを指定するタグアドレスとしてタグメモリ11に登録する。
The
When registering the branch destination instruction stored in the
また、入出力制御部10は、キャッシュデータメモリ9から、指定されたキャッシュラインの128ビットのデータを読み出す。
Further, the input /
アドレス比較器12は、タグメモリ11に記憶されているタグアドレス(A3〜A24)と、分岐先命令のアドレスJADDRのうち下位3ビットを除くアドレスJADDR[24:3]とを比較する。
The
Vビット制御部14は、Vビットメモリ13におけるバリッドビットV0,V1の更新を制御する。
The V
LRU制御部16は、LRU15内のデータの更新を制御する。
第1キュー17は、キャッシュのヒット時に、キャッシュデータメモリ9から読みだされたキャッシュラインの前半の64ビットデータを一時的に保持する。第2キュー18は、キャッシュのヒット時に、キャッシュデータメモリ9から読みだされたキャッシュラインの後半の64ビットデータを一時的に保持する。
The
The
図3は、命令メモリ8に記憶される命令を表わす図である。
命令メモリ8は、可変長の命令、すなわち8ビット、16ビット、24ビット、32ビット、40ビット、48ビット、56ビット、または64ビットの命令を記憶する。命令メモリ8からは、64ビットの命令バスを通じて、64ビット単位でデータが読みだされる。命令メモリ8からのデータの読み出し位置を指定するアドレス(A3〜A24)は、64ビットの読出し単位データ#0、データ#1、データ#2・・・の先頭を表わす0b0・・・00000000、0b0・・・00001000、0b0・・・00010000、・・・で与えられる。
FIG. 3 is a diagram showing instructions stored in the
The
図4(a)は、Vビットメモリ13に記憶されるバリッドビット(V0,V1)と、タグメモリに記憶されるタグアドレス(A3〜A24)を表わす図である。
FIG. 4A shows valid bits (V0, V1) stored in the V-
図4(b)は、キャッシュデータメモリ9に記憶される1つのキャッシュラインのデータを表わす図である。
FIG. 4B shows data of one cache line stored in the
1つのキャッシュラインのデータは、128ビットのデータ(D0〜D127)からなる。1つのキャッシュラインのデータのうち、64ビットのデータ(D0〜D63)が前半の64ビットデータを構成し、64ビットのデータ(D64〜D127)が後半の64ビットデータを構成する。 The data of one cache line consists of 128-bit data (D0 to D127). Of the data on one cache line, 64-bit data (D0 to D63) constitutes the first half of 64-bit data, and 64-bit data (D64 to D127) constitutes the second half of 64-bit data.
図5は、アドレス比較器12の構成を表わす図である。
図5を参照して、アドレス比較器12は、比較器21_1〜21_Nと、論理積回路22_1〜22_Nと、論理和回路23とを含む。ただし、Nは、キャッシュデータメモリに格納可能なラインの総数である。
FIG. 5 is a diagram showing the configuration of the
Referring to FIG. 5, address
比較器21_i(i=1〜N)は、第iエントリのタグアドレスA3〜A24と、分岐先命令のアドレスJADDRのうち下位3ビットを除くアドレスJADDR[24:3]とを比較して、一致する場合には「H」レベルの信号を出力し、不一致の場合には「L」レベルの信号を出力する。 The comparator 21_i (i = 1 to N) compares the tag addresses A3 to A24 of the i-th entry with the address JADDR [24: 3] excluding the lower 3 bits of the address JADDR of the branch destination instruction, and matches. If it does, an “H” level signal is output, and if they do not match, an “L” level signal is output.
論理積回路22_iは、比較器21_iの出力と、バリッドビットV0の論理積を出力する。論理和回路23は、論理積回路22_1〜22_Nの論理和を出力する。この出力は、キャッシュのヒットまたはミスを示す信号であり、「H」レベルのときに、キャッシュがヒットしたことを表わし、「L」レベルのときに、キャッシュがミスしたことを表わす。また、ヒットしたエントリのタグアドレスに対応するキャッシュラインが、入出力制御部10によって読出される。
(従来のキャッシュ方式)
図6は、従来のキャッシュ方式において、分岐先命令がキャッシュされる例を説明するための図である。
The AND circuit 22_i outputs a logical product of the output of the comparator 21_i and the valid bit V0. The OR
(Conventional cache method)
FIG. 6 is a diagram for explaining an example in which a branch destination instruction is cached in the conventional cache method.
従来のキャッシュ方式は、命令メモリからのデータの読み出し箇所(アライメント境界)が固定されている。図6に示すように、分岐先命令100をキャッシュデータメモリへ登録する場合には、アライメント境界である0b0・・・00010000を先頭アドレスとした128ビットのデータがキャッシュデータメモリの1つのキャッシュラインのデータとして登録される。 In the conventional cache system, the data reading position (alignment boundary) from the instruction memory is fixed. As shown in FIG. 6, when registering the branch destination instruction 100 in the cache data memory, 128-bit data with the start address of 0b0... 00010000 as the alignment boundary is stored in one cache line of the cache data memory. Registered as data.
図7は、従来のキャッシュ方式において、分岐先命令がキャッシュされる別の例を説明するための図である。 FIG. 7 is a diagram for explaining another example in which a branch destination instruction is cached in the conventional cache method.
図7に示すように、分岐先命令200をキャッシュデータメモリへ登録する場合には、まず、アライメント境界である0b0・・・00000000を先頭アドレスとした128ビットのデータがキャッシュデータメモリの1つのキャッシュラインのデータとして登録されるが、この場合には、分岐先命令200の一部のみしか、キャッシュデータメモリに登録されない。したがって、分岐先命令へのジャンプ時に、分岐先命令200がキャッシュにヒットしたとしても、メモリアクセス待ちとなり性能が上がらないという問題がある。
(本実施の形態のキャッシュ方式)
図8は、本実施の形態のキャッシュ方式において、分岐先命令がキャッシュされる例を説明するための図である。
As shown in FIG. 7, when registering the branch destination instruction 200 in the cache data memory, first, 128-bit data having a start address of 0b0... 00000000 as an alignment boundary is stored in one cache data memory. In this case, only a part of the branch destination instruction 200 is registered in the cache data memory. Therefore, even when the branch destination instruction 200 hits the cache at the time of jump to the branch destination instruction, there is a problem that the performance is not improved due to waiting for memory access.
(Cache method of this embodiment)
FIG. 8 is a diagram for explaining an example in which a branch destination instruction is cached in the cache system according to the present embodiment.
本実施の形態のキャッシュ方式では、命令メモリ8からのデータの読み出し境界(アライメント境界)が固定されていない。図8に示すように、分岐先命令100をキャッシュデータメモリ9へ登録する場合には、分岐先命令100の先頭が含まれる64ビットの読出し単位データ(アドレス0b0・・・00010000で指定される)がキャッシュラインの前半に登録されて、前半の64ビットデータ(D0〜D63)となる。さらに、その次の64ビットの読出し単位データ(0b0・・・00011000で指定される)がキャッシュラインの後半に登録されて、後半64ビットデータ(D64〜D127)となる。
In the cache system of the present embodiment, the data reading boundary (alignment boundary) from the
図9は、本実施の形態のキャッシュ方式において、分岐先命令がキャッシュされる別の例を説明するための図である。 FIG. 9 is a diagram for explaining another example in which a branch destination instruction is cached in the cache system according to the present embodiment.
図9に示すように、分岐先命令200をキャッシュデータメモリ9へ登録する場合には、まず、分岐先命令200の先頭が含まれる64ビットの読出し単位データ(アドレス0b0・・・00001000で指定される)がキャッシュラインの前半に登録されて、前半の64ビットデータ(D0〜D63)となる。さらに、その次の64ビットの読出し単位データ(0b0・・・00010000で指定される)がキャッシュラインの後半に登録されて、後半の64ビットデータ(D64〜D127)となる。この場合には、分岐先命令200の全部が、キャッシュデータメモリ9に登録されるので、従来のようなメモリアクセス待ちが発生しない。
(分岐先命令キャッシュメモリへの登録)
図10は、分岐先命令をキャッシュメモリへ登録する処理を制御するシーケンサ19の動作を説明するための図である。
As shown in FIG. 9, when registering the branch destination instruction 200 in the
(Register to branch destination instruction cache memory)
FIG. 10 is a diagram for explaining the operation of the
シーケンサ19は、以下の(1)〜(3)の処理を制御する。
(1) タグアドレスを登録、バリッドビットをクリア、LRU更新。
(2) 前半の64ビットデータのキャッシュデータメモリへの書き込み、バリッドビットV0の書き込み。
(3) 後半の64ビットデータのキャッシュデータメモリへの書き込み、バリッドビットV1の書き込み。
The
(1) Register tag address, clear valid bit, update LRU.
(2) Write the first half of 64-bit data to the cache data memory and write the valid bit V0.
(3) Write the latter half of 64-bit data to the cache data memory and write the valid bit V1.
シーケンサ19は、通常”IDLE状態”にあり、キャッシュミスしたときに登録を開始する。シーケンサ19は、登録開始によって、上記の(1)を実行し、”D0待ち状態”に移行する。その後、シーケンサ19は、データの前半を受け付けると、(2)を実行し、”D1待ち状態”に移行する。最後に、シーケンサ19は、データの後半を受け付けると(3)を実行し、”IDLE”状態に戻る。
The
なお、シーケンサ19は、登録データを待っているときに分岐を行って、分岐先の命令がキャッシュにヒットしたときは、1つのキャッシュラインが埋まらないまま登録を終了する場合がある。また、シーケンサ19は、登録データを待っているときに分岐を行って、分岐先の命令がキャッシュにミスしたときには、別のキャッシュラインの登録を開始する場合がある。
Note that the
(ヒット時の動作)
図11は、分岐先命令がヒットする場合の動作例を示す図である。
(Action when hit)
FIG. 11 is a diagram illustrating an operation example when a branch destination instruction hits.
図11を参照して、CPUコア4は、分岐先アドレスJADDR(ここでは、命令Aのアドレス@A)を指定した分岐命令JUMPを実行する。 Referring to FIG. 11, CPU core 4 executes branch instruction JUMP specifying branch destination address JADDR (here, address @A of instruction A).
アドレス比較器12は、分岐先アドレスの下位3ビットを除く部分JADDR[24:3]といずれかのタグアドレスが一致するので、キャッシュヒット信号brahitを「H」レベルとする。
The
シーケンサ19は、バリッドビットV0が有効を示す「1」であるため、キャッシュデータメモリの中のヒットしたキャッシュラインの前半の64ビットデータbradat0[63:0]を第1キュー17に送る。ここでは、前半の64ビットデータには、命令Aと命令Bが含まれるものとする。
Since the
また、シーケンサ19は、バリッドビットV1が有効を示す「1」であるため、キャッシュデータメモリの中のヒットしたキャッシュラインの後半の64ビットデータbradat1[127:64]を第2キュー18に送る。こでは、後半の64ビットのデータには、命令Cと命令Dが含まれるものとする。
Further, since the valid bit V1 is “1” indicating that the valid bit V1 is valid, the
LRU制御部16は、LRUの先頭に命令Aのアドレスを登録する。
シーケンサ19は、第1キュー17、第2キュー18の命令を順番にCPUコア4に送り、CPUコア4によって命令がデコードされる。命令Cがデコードされた後、CPUコア4は、分岐先アドレスJADDR(ここでは、命令Eのアドレス@E)を指定した分岐命令JUMPを実行する。
The
The
アドレス比較器12は、分岐先アドレスの下位3ビットを除く部分JADDR[24:3]といずれかのタグアドレスが一致するので、キャッシュヒット信号brahitを「H」レベルとする。
The
シーケンサ19は、バリッドビットV0が有効を示す「1」であるため、キャッシュデータメモリの中のヒットしたキャッシュラインの前半の64ビットデータbradat0[63:0]を第1キュー17に送る。ここでは、前半の64ビットのデータには、命令Eと命令Fが含まれるものとする。
Since the
シーケンサ19は、バリッドビットV1が無効を示す「0」であるため、キャッシュデータメモリの中のヒットしたキャッシュラインの後半の64ビットデータbradat1[127:64]を第2キュー18に送らない。
Since the valid bit V1 is “0” indicating invalidity, the
LRU制御部16は、LRUの先頭に命令Eのアドレスを登録する。
シーケンサ19は、第1キュー17の命令を順番にCPUコア4に送り、CPUコア4によって命令がデコードされる。
The
The
(ミス時の動作)
図12は、分岐先命令がミスする場合の動作例を示す図である。
(Operation at the time of mistake)
FIG. 12 is a diagram illustrating an operation example when a branch destination instruction misses.
図12を参照して、CPUコア4は、分岐先アドレスJADDR(ここでは、命令Aのアドレス@A)を指定した分岐命令JUMPが実行する。 Referring to FIG. 12, CPU core 4 executes a branch instruction JUMP that designates branch destination address JADDR (here, address @A of instruction A).
アドレス比較器12は、分岐先アドレスの下位3ビットを除く部分JADDR[24:3]がいずれかのタグアドレスとも一致しないので、キャッシュヒット信号brahitが「H」レベルとしない。
In the
シーケンサ19は、分岐先アドレスJADDRの下位3ビットを除いた部分を、タグアドレスA3〜A24としてタグメモリに書き込む。
The
LRU制御部16は、LRUの先頭に命令Aのアドレスを登録する。
CPUコア4は、要求信号REQを出力し、これに応答して命令メモリ8から送信される応答信号ACQを受け取る。Vビット制御部14は、バリッドビットV0,V1を「0」,「0」にクリアする。
The
The CPU core 4 outputs a request signal REQ and receives a response signal ACQ transmitted from the
CPUコア4は、命令メモリ8から前半の64ビットデータD0を受けると、キャッシュデータメモリの対応するキャッシュラインの前半の位置に前半の64ビットデータD0を書き込む。Vビット制御部14は、命令メモリ8から完了信号ENDを受けると、バリッドビットV0を「1」に設定する。
When the CPU core 4 receives the first-half 64-bit data D0 from the
CPUコア4は、さらに要求信号REQを出力し、これに応答して命令メモリ8から送信される応答信号ACQを受け取る。CPUコア4は、命令メモリ8から後半64ビットのデータD1を受けると、キャッシュデータメモリの対応するキャッシュラインの後半の位置に後半の64ビットデータD1を書き込む。Vビット制御部14は、命令メモリ8から完了信号ENDを受けると、バリッドビットV1を「1」に設定する。
The CPU core 4 further outputs a request signal REQ, and receives a response signal ACQ transmitted from the
以上のように、本実施の形態によれば、分岐先命令の先頭が命令メモリのどこにあろうと、分岐先命令の全体を1つのキャッシュラインに保持することができる。これにより、キャッシュヒット時は、メモリアクセスを待つことなく分岐先命令の実行を開始することができる。 As described above, according to the present embodiment, the entire branch destination instruction can be held in one cache line regardless of where the head of the branch destination instruction is in the instruction memory. As a result, when a cache hit occurs, execution of the branch destination instruction can be started without waiting for memory access.
[第3の実施形態]
第2の実施形態では、ジャンプ時にキャッシュラインの前半にある分岐先命令の先頭が検索される。しかしながら、キャッシュラインの後半にも、別の分岐先命令が格納されている場合がある。この分岐先命令も検索の対象とすることによって、ヒット率を向上させることができる。第3の実施形態では、後半の64ビットデータに対応するアドレスをタグアドレスから算出して、ヒット判定に使用する。
[Third Embodiment]
In the second embodiment, the head of the branch destination instruction in the first half of the cache line is searched at the time of jump. However, another branch destination instruction may be stored in the second half of the cache line. By making this branch destination instruction a search target, the hit rate can be improved. In the third embodiment, an address corresponding to the latter 64-bit data is calculated from the tag address and used for hit determination.
図13は、第3の実施形態のアドレス比較器の構成を表わす図である。
図13を参照して、アドレス比較器512は、比較器21_1〜21_N,25_1〜25_Nと、論理積回路22_1〜22_N,26_1〜26_Nと、論理和回路23,27と、加算器24_1〜24_Nと、論理和回路28と、論理積回路29とを備える。ただし、Nは、キャッシュデータメモリに格納可能なキャッシュラインの総数である
比較器21_i(i=1〜N)は、第iエントリのタグアドレスA3〜A24と、分岐先命令のアドレスJADDRのうち下位3ビットを除くアドレスJADDR[24:3]とを比較して、一致する場合には「H」レベルの信号を出力し、不一致の場合には「L」レベルの信号を出力する。
FIG. 13 is a diagram illustrating the configuration of the address comparator according to the third embodiment.
Referring to FIG. 13, address comparator 512 includes comparators 21_1 to 21_N, 25_1 to 25_N, AND circuits 22_1 to 22_N, 26_1 to 26_N, OR
論理積回路22_iは、比較器21_iの出力と、バリッドビットV0の論理積を出力する。この出力は、キャッシュラインの前半のヒットまたはミスを示す信号であり、「H」レベルのときに、いずれかのキャッシュラインの前半がヒットしたことを表わし、「L」レベルのときに、すべてのキャッシュラインの前半がミスしたことを表わす。 The AND circuit 22_i outputs a logical product of the output of the comparator 21_i and the valid bit V0. This output is a signal indicating the hit or miss of the first half of the cache line. When it is at “H” level, it indicates that the first half of one of the cache lines has been hit. Indicates that the first half of the cash line missed.
論理和回路23は、論理積回路22_1〜22_Nの出力の論理和を出力する。
加算器24_iは、第iエントリのタグアドレスA3〜A24に「1」を加算することによって、タグアドレスの次のアドレスを出力する。タグアドレスがあるキャッシュラインの前半の64ビットデータの命令メモリ8内でのアドレスを示すので、タグアドレスの次のアドレスは、同一のキャッシュラインの後半の64ビットデータの命令メモリ8内でのアドレスを示す。
The
The adder 24_i adds “1” to the tag addresses A3 to A24 of the i-th entry, and outputs the next address of the tag address. Since the address in the
比較器25_iは、加算器24_iから出力される第iエントリのタグアドレスA3〜A24の次のアドレスと、分岐先命令のアドレスJADDRのうち下位3ビットを除くアドレスJADDR[24:3]とを比較して、一致する場合には「H」レベルの信号を出力し、不一致の場合には「L」レベルの信号を出力する。 The comparator 25_i compares the address next to the tag addresses A3 to A24 of the i-th entry output from the adder 24_i and the address JADDR [24: 3] excluding the lower 3 bits of the address JADDR of the branch destination instruction. If they match, an “H” level signal is output, and if they do not match, an “L” level signal is output.
論理積回路26_iは、比較器25_iの出力と、バリッドビットV1の論理積を出力する。 The AND circuit 26_i outputs a logical product of the output of the comparator 25_i and the valid bit V1.
論理和回路27は、論理積回路26_1〜26_Nの出力の論理和を出力する。この出力は、キャッシュラインの後半のヒットまたはミスを示す信号であり、「H」レベルのときに、いずれかのキャッシュラインの後半がヒットしたことを表わし、「L」レベルのときに、すべてのキャッシュラインの後半がミスしたことを表わす。
The OR
論理和回路28は、論理和回路23の出力と論理和回路28の出力の論理和を出力する。この出力は、キャッシュラインのヒットまたはミスを示す信号であり、「H」レベルのときに、いずれかのキャッシュラインが前半または後半でヒットしたことを表わし、「L」レベルのときに、すべてのキャッシュラインがミスしたことを表わす。また、ヒットしたエントリのタグアドレスに対応するキャッシュラインが、入出力制御部10によって読出される。
The
図14は、第3の実施形態の入出力制御部を表わす図である。
入出力制御部10は、セレクタ70とシフタ51を含む。
FIG. 14 is a diagram illustrating an input / output control unit according to the third embodiment.
The input /
セレクタ70は、ヒットしたキャッシュラインの128ビットのデータ「D0〜D127」を出力する。
The
キャッシュラインの前半のデータがヒットしたときには、第2の実施形態と同様に、セレクタ70の出力が、CPUコア4に送られる。
When the first half of the cache line hits, the output of the
キャッシュラインの後半のデータがヒットしたときには、セレクタ70から出力される「D0〜D127」をシフタ51が64ビット右シフトする。その結果、第0ビット目〜第63ビット目が「D64〜D127」(後半の64ビットのデータ)で、第64ビット目〜第127ビット目がダミーのデータがCPUコア4に送られる。
When data in the latter half of the cache line is hit, the shifter 51 right-shifts “D0 to D127” output from the
図15は、1つのキャッシュラインに2つの分岐先命令が格納されている場合の格納状態を表わす図である。 FIG. 15 is a diagram illustrating a storage state when two branch destination instructions are stored in one cache line.
キャッシュラインの前半には、分岐先命令100の先頭が位置し、キャッシュラインの後半には、分岐先命令200の先頭が位置する。 The beginning of the branch destination instruction 100 is located in the first half of the cache line, and the beginning of the branch destination instruction 200 is located in the second half of the cache line.
第2の実施形態では、1つのキャッシュラインに2つの分岐先命令が登録されていても、キャッシュラインの前半の64ビットデータに先頭が含まれる分岐先命令100のみがキャッシュのヒット判定の対象となる。これに対して、本実施の形態では、キャッシュラインの後半の64ビットデータに先頭が含まれる分岐先命令200もキャッシュのヒット判定の対象となる。 In the second embodiment, even if two branch destination instructions are registered in one cache line, only the branch destination instruction 100 whose head is included in 64-bit data in the first half of the cache line is subject to cache hit determination. Become. On the other hand, in the present embodiment, the branch destination instruction 200 whose head is included in the latter half of the 64-bit data of the cache line is also subject to cache hit determination.
以上のように、本実施の形態によれば、タグアドレスに1を加算したアドレスも、アドレス比較の対処に加えることによって、第2の実施形態よりもキャッシュのヒット率を増加させることができる。 As described above, according to the present embodiment, the address obtained by adding 1 to the tag address can be increased in the cache hit rate as compared with the second embodiment by adding to the address comparison.
[第4の実施形態]
本実施の形態では、命令メモリからのデータの読み出し単位が、第2の実施形態よりも小さい場合について説明する。
[Fourth Embodiment]
In this embodiment, a case where the unit of reading data from the instruction memory is smaller than that in the second embodiment will be described.
図16は、第4の実施形態の半導体装置の構成を表わす図である。
図16の半導体装置101が、図2の半導体装置1と相違する点は以下である。
FIG. 16 is a diagram illustrating the configuration of the semiconductor device of the fourth embodiment.
The
CPUコア4とROM5との間、CPUコア4とRAM7との間は、CIF6を介して32ビットの命令バスで接続される。
The CPU core 4 and the
命令メモリ108は、32ビットのビット幅を有する。32ビットの読出し単位データ内で命令の位置が2ビット(A0〜A1)で指定される。命令メモリ108内の命令の位置は、A0〜A24の25ビットのアドレスで指定される。
The
キャッシュデータメモリ9は、128ビット幅のキャッシュラインを有する。すなわち、キャッシュデータメモリ9は、命令メモリ108内の連続する4つの読出し単位データを記憶する。キャッシュラインの4つの読出し単位データについて、命令メモリ108においてアドレスが小さい方に記憶されていた読出し単位データから順番に第1番目の32ビットデータ、第2番目の32ビットデータ、第3番目の32ビットデータ、第4番目の32ビットデータと呼ぶことにする。
The
Vビットメモリ113は、バリッドビットV0、V1、V2を記憶する。バリッドビットV0は、キャッシュラインの第1番目の32ビットデータが有効か無効かを表わすビットである。バリッドビットV1は、キャッシュラインの第2番目の32ビットデータが有効か無効かを表わすビットである。バリッドビットV2は、キャッシュラインの第3番目の32ビットデータが有効か無効かを表わすビットである。バリッドビットV3は、キャッシュラインの第4番目の32ビットデータが有効か無効かを表わすビットである。
The
タグメモリ111は、キャッシュデータメモリ9の各キャッシュラインのタグアドレス(A2〜A24)を記憶する。タグアドレスは、対応するキャッシュラインの第1の32ビットデータの命令メモリ8におけるアドレスを表わす。
The tag memory 111 stores the tag address (A2 to A24) of each cache line of the
入出力制御部110は、命令メモリ108に記憶されている分岐先命令をキャッシュデータメモリ9に登録する場合に、分岐先命令の先頭が含まれる32ビットの読出し単位データと、後続する3個の32ビットの読出し単位データとを1つのキャッシュラインに登録する。具体的には、入出力制御部110は、分岐先命令を指定するアドレスの下位の2個のビットを0とした第1のアドレスで指定される32ビットの読出し単位データと、次の3個の32ビットの読出し単位データとをキャッシュラインに登録する。また、入出力制御部110は、第1のアドレスの下位2ビットを除いた部分をキャッシュラインを指定するタグアドレスとしてタグメモリ111に登録する。
When the branch destination instruction stored in the
また、入出力制御部110は、キャッシュデータメモリ9から、指定されたキャッシュラインの128ビットのデータを読み出す。
Further, the input /
図17は、命令メモリ108に記憶される命令を表わす図である。
命令メモリ108は、可変長の命令、すなわち8ビット、16ビット、24ビット、32ビット、40ビット、48ビット、56ビット、または64ビットの命令を記憶する。命令メモリ108からは、32ビットの命令バスを通じて、32ビット単位でデータが読みだされる。命令メモリ108からのデータの読み出し位置を指定するアドレスは、32ビットのデータ#0、データ#1、データ#2・・・の先頭を表わす0b0・・・0000000、0b0・・・0000100、0b0・・・0001000、・・・で与えられる。
FIG. 17 is a diagram showing instructions stored in
The
図18(a)は、Vビットメモリ113に記憶されるバリッドビット(V0,V1,V2)と、タグメモリ111に記憶されるタグアドレス(A2〜A24)を表わす図である。
FIG. 18A shows valid bits (V0, V1, V2) stored in the V-
図18(b)は、キャッシュデータメモリ9に記憶される1つのキャッシュラインのデータを表わす図である。
FIG. 18B shows data of one cache line stored in the
1キャッシュラインのデータは、128ビットのデータ(D0〜D127)からなる。1キャッシュラインのデータのうち、32ビットのデータ(D0〜D31)が第1番目の32ビットデータを構成し、32ビットのデータ(D32〜D63)が第2番目の32ビットデータを構成し、32ビットのデータ(D64〜D95)が第3番目の32ビットデータを構成し、32ビットのデータ(D96〜D127)が第4番目の32ビットデータを構成する。 The data for one cache line consists of 128-bit data (D0 to D127). Among the data of one cache line, 32-bit data (D0 to D31) constitutes the first 32-bit data, and 32-bit data (D32 to D63) constitutes the second 32-bit data, The 32-bit data (D64 to D95) constitutes the third 32-bit data, and the 32-bit data (D96 to D127) constitutes the fourth 32-bit data.
(分岐先命令キャッシュメモリへの登録)
図19は、分岐先命令をキャッシュメモリへ登録する処理を制御するシーケンサ119の動作を説明するための図である。
(Register to branch destination instruction cache memory)
FIG. 19 is a diagram for explaining the operation of the
シーケンサ119は、以下の(1)〜(5)の処理を制御する。
(1) タグアドレスを登録、バリッドビットをクリア、LRU更新。
(2) 第1番目の32ビットデータのキャッシュデータメモリへの書き込み、バリッドビットV0の書き込み。
(3) 第2番目の32ビットデータのキャッシュデータメモリへの書き込み、バリッドビットV1の書き込み。
(4) 第3番目の32ビットデータのキャッシュデータメモリへの書き込み、バリッドビットV2の書き込み。
(5) 第4番目の32ビットデータのキャッシュデータメモリへの書き込み、バリッドビットV3の書き込み。
The
(1) Register tag address, clear valid bit, update LRU.
(2) Write the first 32-bit data to the cache data memory and write the valid bit V0.
(3) Writing the second 32-bit data to the cache data memory and writing the valid bit V1.
(4) Writing the third 32-bit data to the cache data memory and writing the valid bit V2.
(5) Write the fourth 32-bit data to the cache data memory and write the valid bit V3.
シーケンサ119は、通常”IDLE状態”にあり、キャッシュミスしたときに登録を開始する。シーケンサ119は、登録開始によって、上記の(1)を実行し、”D0待ち状態”に移行する。その後、シーケンサ119は、第1番目の32ビットのデータを受け付けると、(2)を実行し、”D1待ち状態”に移行するその後、シーケンサ119は、第2番目の32ビットのデータを受け付けると、(3)を実行し、”D2待ち状態”に移行する。その後、シーケンサ119は、第3番目の32ビットのデータを受け付けると、(4)を実行し、”D3待ち状態”に移行する。最後に、シーケンサ119は、第4番目の32ビットのデータを受け付けると、(5)を実行し、”IDLE”状態に戻る。
The
以上のように、本実施の形態では、命令メモリのビット幅がキャッシュラインのビット幅の1/4で、命令の最大長の1/2の場合であっても、第2の実施形態と同様に、分岐先命令の先頭が命令メモリのどこにあろうと、分岐先命令の全体を1つのキャッシュラインに保持することができる。これにより、キャッシュヒット時は、メモリアクセスを待つことなく分岐先命令の実行を開始することができる。 As described above, in this embodiment, even if the bit width of the instruction memory is 1/4 of the bit width of the cache line and 1/2 of the maximum length of the instruction, the same as in the second embodiment. In addition, the entire branch destination instruction can be held in one cache line regardless of where the head of the branch destination instruction is in the instruction memory. As a result, when a cache hit occurs, execution of the branch destination instruction can be started without waiting for memory access.
[第5の実施形態]
第5の実施形態では、分岐先命令をキャッシュメモリにシフトして格納する。
[Fifth Embodiment]
In the fifth embodiment, the branch destination instruction is shifted and stored in the cache memory.
本実施の形態では、第1の実施形態と異なり、命令メモリから読み出した分岐先命令をシフトしてつめてキャッシュメモリに格納することで、キャッシュメモリの少ない面積で分岐先命令を格納することができる。 In the present embodiment, unlike the first embodiment, the branch destination instruction read from the instruction memory is shifted and stored in the cache memory, so that the branch destination instruction can be stored in a small area of the cache memory. it can.
図20は、第5の実施形態の半導体装置の構成を表わす図である。
図20の半導体装置201が、図2の半導体装置1と相違する点は以下である。
FIG. 20 is a diagram illustrating the configuration of the semiconductor device of the fifth embodiment.
The
キャッシュデータメモリ209は、64ビット幅のキャッシュラインを有する。すなわち、命令メモリ8内の1つの読出し単位データを記憶する。
The
分岐先命令アドレスメモリ211は、分岐先命令アドレス(A0〜A24)を記憶する。分岐先命令アドレスは、タグアドレス(A3〜A24)と、読出しデータ単位内の分岐先命令の位置を表わすアドレス(A0〜A2)からなる。
The branch destination
Vビットメモリ213は、バリッドビットV0を記憶する。バリッドビットV0が、「1」の場合には、対応するキャッシュラインの64ビットデータが有効であり、「0」の場合には、対応するキャッシュラインの64ビットデータが無効である。
The
1つのキャッシュラインと、そのキャッシュラインに対応する分岐先命令アドレスと、そのキャッシュラインに対応するバリッドビットとが1つのエントリを構成する。 One cache line, a branch destination instruction address corresponding to the cache line, and a valid bit corresponding to the cache line constitute one entry.
入出力制御部210は、命令メモリ8に記憶されている分岐先命令をキャッシュデータメモリ209に登録する場合に、分岐先命令を指定するアドレスの下位の3個のビットを0とした第1のアドレスで指定される64ビットの読出し単位データと、次の64ビットの読出し単位データとを読み出す。入出力制御部210は、分岐先命令の先頭がキャッシュラインの先頭にくるように、読み出された128ビットのデータをシフトして、キャッシュラインに登録する。
When registering the branch destination instruction stored in the
また、入出力制御部210は、第1のアドレスの下位3ビットを除いた部分をキャッシュラインを指定するタグアドレスとし、分岐先命令のアドレスの下位3ビットを読出し単位データ内の分岐先命令の位置を表わすアドレスとして分岐先命令アドレスメモリ211に記憶する。
Further, the input /
また、入出力制御部210は、キャッシュデータメモリ209から、指定されたキャッシュラインの64ビットのデータを読み出す。
In addition, the input /
アドレス比較器212は、分岐先命令アドレスメモリ211に記憶されているタグアドレス(A3〜A24)と、分岐先命令のアドレスJADDRのうち下位3ビットを除くアドレスJADDR[24:3]とを比較する。
The
Vビット制御部214は、Vビットメモリ213におけるバリッドビットV0の更新を制御する。
The V
図21は、キャッシュデータメモリへの登録を説明するための図である。
入出力制御部210は、シフタ61を含み、シフタ61は、分岐先命令のアドレスJADDRの下位3ビットの値だけ、命令メモリ8から読みだされた128ビットの読出しデータをシフトして、64ビット幅のキャッシュラインに出力する。
FIG. 21 is a diagram for explaining registration in the cache data memory.
たとえば、分岐先命令のアドレスの下位3ビットが、「000」の場合には、シフタ61は、読み出された128ビットの読出しデータをシフトせずに、64ビット幅のキャッシュラインに登録する。
For example, when the lower 3 bits of the address of the branch destination instruction are “000”, the
分岐先命令のアドレスの下位3ビットが、「001」の場合には、シフタ61は、読み出された128ビットの読出しデータを8ビットだけ右シフトして64ビットのキャッシュラインに登録する。同様に、分岐先命令のアドレスの下位3ビットが、「010」の場合には、シフタ61は、読み出された128ビットの読出しデータを16ビットだけ右シフトして64ビットのキャッシュラインに登録する。分岐先命令のアドレスの下位3ビットが、「011」の場合には、シフタ61は、読み出された128ビットの読出しデータを24ビットだけ右シフトして64ビットのキャッシュラインに登録する。分岐先命令のアドレスの下位3ビットが、「100」の場合には、シフタ61は、読み出された128ビットの読出しデータを32ビットだけ右シフトして64ビットのキャッシュラインに登録する。分岐先命令のアドレスの下位3ビットが、「101」の場合には、シフタ61は、読み出された128ビットの読出しデータを40ビットだけ右シフトして64ビットのキャッシュラインに登録する。分岐先命令のアドレスの下位3ビットが、「110」の場合には、シフタ61は、読み出された128ビットの読出しデータを48ビットだけ右シフトして64ビットのキャッシュラインに登録する。分岐先命令のアドレスの下位3ビットが、「111」の場合には、シフタ61は、読み出された128ビットの読出しデータを56ビットだけ右シフトして64ビットのキャッシュラインに登録する。
When the lower 3 bits of the address of the branch destination instruction are “001”, the
これによって、分岐先命令が最大(64ビット長)であっても1つのキャッシュラインに登録することができる。 As a result, even if the branch destination instruction is maximum (64-bit length), it can be registered in one cache line.
図22は、キャッシュデータメモリからの読出しを説明するための図である。
入出力制御部210は、シフタ62を含み、シフタ62は、分岐先命令アドレスメモリ211に記憶されている分岐先命令の下位3ビット(A0〜A2)の値だけ、キャッシュデータメモリ209から読みだされた64ビットのデータをシフトして、CPUコア4へ出力する。
FIG. 22 is a diagram for explaining reading from the cache data memory.
たとえば、分岐先命令のアドレスの下位3ビット(A0〜A2)が、「000」の場合には、シフタ62は、キャッシュデータメモリ209から出力された分岐先命令をシフトせずに、CPUコア4へ出力する。分岐先命令のアドレスの下位3ビット(A0〜A2)が、「001」の場合には、シフタ62は、キャッシュデータメモリ209から出力された分岐先命令を8ビットだけ左シフトして、CPUコア4へ出力する。同様に、分岐先命令のアドレスの下位3ビット(A0〜A2)が、「010」の場合には、シフタ62は、キャッシュデータメモリ209から出力された分岐先命令を16ビットだけ左シフトして、CPUコア4へ出力する。分岐先命令のアドレスの下位3ビット(A0〜A2)が、「011」の場合には、シフタ62は、キャッシュデータメモリ209から出力された分岐先命令を24ビットだけ左シフトして、CPUコア4へ出力する。分岐先命令のアドレスの下位3ビット(A0〜A2)が、「100」の場合には、シフタ62は、キャッシュデータメモリ209から出力された分岐先命令を32ビットだけ左シフトして、CPUコア4へ出力する。分岐先命令のアドレスの下位3ビット(A0〜A2)が、「101」の場合には、シフタ62は、キャッシュデータメモリ209から出力された分岐先命令を40ビットだけ左シフトして、CPUコア4へ出力する。分岐先命令のアドレスの下位3ビット(A0〜A2)が、「110」の場合には、シフタ62は、キャッシュデータメモリ209から出力された分岐先命令を48ビットだけ左シフトして、CPUコア4へ出力する。分岐先命令のアドレスの下位3ビット(A0〜A2)が、「111」の場合には、シフタ62は、キャッシュデータメモリ209から出力された分岐先命令を56ビットだけ左シフトして、CPUコア4へ出力する。
For example, when the lower 3 bits (A0 to A2) of the address of the branch destination instruction are “000”, the
以上のように、本実施の形態によれば、データの入出力時に命令をシフトさせて格納することによって、第1〜第4の実施形態よりも分岐先命令を格納するキャッシュメモリの領域を削減することができる。 As described above, according to the present embodiment, the area of the cache memory for storing the branch destination instruction is reduced as compared with the first to fourth embodiments by shifting and storing the instruction at the time of data input / output. can do.
以上、本発明者によってなされた発明を実施の形態に基づき具体的に説明したが、本発明は実施の形態に限定されるものではなく、その要旨を逸脱しない範囲で種々変更可能であることはいうまでもない。 As mentioned above, the invention made by the present inventor has been specifically described based on the embodiment. However, the present invention is not limited to the embodiment, and various modifications can be made without departing from the scope of the invention. Needless to say.
その他、実施の形態に記載された内容の一部を以下に記載する。
(1)半導体装置は、ビット幅がNビットであるメインメモリと、ビット幅がNビットのキャッシュラインを有するキャッシュメモリとを備える。さらに、半導体装置は、前記メインメモリに記憶されているMビット(M≦N)の命令を前記キャッシュメモリに登録する場合に、前記命令の先頭が含まれるNビットの読出し単位データと後続のNビットの読出し単位データとを読み出して、命令の先頭がキャッシュラインの先頭になるように、読出した2Nビットのデータをシフトして登録するキャッシュ制御部とを備える。
In addition, a part of the contents described in the embodiment will be described below.
(1) The semiconductor device includes a main memory having a bit width of N bits and a cache memory having a cache line having a bit width of N bits. Further, when registering an M-bit (M ≦ N) instruction stored in the main memory in the cache memory, the semiconductor device includes N-bit read unit data including the head of the instruction and the subsequent N A cache control unit that reads out the read unit data of bits and shifts and registers the read 2N-bit data so that the head of the instruction becomes the head of the cache line.
1,101,201 半導体装置、2 CPU、3 キャッシュメモリ、4 CPUコア、5 ROM、6 CIF、7 RAM、8,108 命令メモリ、9,209 キャッシュデータメモリ、10,110,210 入出力制御部、11,111 タグメモリ、12,212,512 アドレス比較器、13,113,213 Vビットメモリ、14,114,214 Vビット制御部、15 LRU、16 LRU制御部、17 第1キュー、18 第2キュー、19,119 シーケンサ、81 キャッシュ制御部、21_1〜21_N,25_1〜25_N 比較器、24_1〜24_N 加算器、22_1〜22_N,26_1〜26_N 論理積回路、61,62 シフタ、70,90 セレクタ、23,27,28 論理和回路、211 分岐先命令アドレスメモリ。
1, 101, 201 Semiconductor device, 2 CPU, 3 cache memory, 4 CPU core, 5 ROM, 6 CIF, 7 RAM, 8, 108 Instruction memory, 9,209 Cache data memory, 10, 110, 210 Input /
Claims (9)
L(N×X:Xは2以上の自然数)ビット幅のキャッシュラインを有するキャッシュメモリと、
前記メインメモリに記憶されているMビット(2×M≦L)の命令を前記キャッシュメモリに登録する場合に、前記命令の先頭が含まれるNビットの読出し単位データと、後続する(X−1)個のNビットの読出し単位データを1つのキャッシュラインに登録するキャッシュ制御部とを備え、
前記メインメモリの各読出し単位データ内の命令の位置がsビットで指定される場合に、
前記キャッシュ制御部は、前記命令を指定するアドレスの下位のs個のビットを0とした第1のアドレスで指定されるNビットの読出し単位データと、次の(X−1)個のNビットの読出し単位データを前記キャッシュラインに登録する、半導体装置。 A main memory having a bit width of N bits;
A cache memory having a cache line of L (N × X: X is a natural number of 2 or more) bit width;
When registering an M-bit (2 × M ≦ L) instruction stored in the main memory in the cache memory, N-bit read unit data including the head of the instruction and subsequent (X−1) ) pieces of Bei example a cache control unit for registering a reading unit data of N bits into a single cache line,
When the position of the instruction in each read unit data of the main memory is designated by s bits,
The cache control unit includes N-bit read unit data specified by a first address in which the lower s bits of an address specifying the instruction are set to 0, and the next (X-1) N bits The read unit data is registered in the cache line .
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012141718A JP5968693B2 (en) | 2012-06-25 | 2012-06-25 | Semiconductor device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012141718A JP5968693B2 (en) | 2012-06-25 | 2012-06-25 | Semiconductor device |
Publications (3)
Publication Number | Publication Date |
---|---|
JP2014006685A JP2014006685A (en) | 2014-01-16 |
JP2014006685A5 JP2014006685A5 (en) | 2015-04-09 |
JP5968693B2 true JP5968693B2 (en) | 2016-08-10 |
Family
ID=50104348
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2012141718A Expired - Fee Related JP5968693B2 (en) | 2012-06-25 | 2012-06-25 | Semiconductor device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5968693B2 (en) |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH11312085A (en) * | 1998-04-28 | 1999-11-09 | Hitachi Ltd | Processor |
US7568070B2 (en) * | 2005-07-29 | 2009-07-28 | Qualcomm Incorporated | Instruction cache having fixed number of variable length instructions |
-
2012
- 2012-06-25 JP JP2012141718A patent/JP5968693B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2014006685A (en) | 2014-01-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10394718B2 (en) | Slot/sub-slot prefetch architecture for multiple memory requestors | |
US6496902B1 (en) | Vector and scalar data cache for a vector multiprocessor | |
JP6011194B2 (en) | Arithmetic processing device and control method of arithmetic processing device | |
US7640420B2 (en) | Pre-fetch apparatus | |
JPS61107434A (en) | Data processor | |
US11301250B2 (en) | Data prefetching auxiliary circuit, data prefetching method, and microprocessor | |
JPH10228376A (en) | Method and program for processing multiple-register instruction | |
JP3498673B2 (en) | Storage device | |
JP5583893B2 (en) | Arithmetic processing device and control method of arithmetic processing device | |
US8578135B2 (en) | Apparatus for calculating and prefetching a branch target address | |
JP2008165589A (en) | Information processor | |
JP3935871B2 (en) | MEMORY SYSTEM FOR COMPUTER CIRCUIT HAVING PIPELINE AND METHOD FOR PROVIDING DATA TO PIPELINE FUNCTIONAL UNIT | |
JP5968693B2 (en) | Semiconductor device | |
JP3961371B2 (en) | Information processing device | |
US8255632B2 (en) | Pre-fetch control apparatus | |
JP2008257508A (en) | Cache control method, cache device, and microcomputer | |
JP2009217714A (en) | Data processing circuit, cache system and data transfer device | |
JP5206385B2 (en) | Boundary execution control system, boundary execution control method, and boundary execution control program | |
JPH10116229A (en) | Data processor | |
US6904500B2 (en) | Cache controller | |
JP6451475B2 (en) | Arithmetic processing device, information processing device, and control method of arithmetic processing device | |
US6922767B2 (en) | System for allowing only a partial value prediction field/cache size | |
JP5480793B2 (en) | Programmable controller | |
JP4918535B2 (en) | Cache memory, cache memory device and allocation method | |
JPS6027967A (en) | Block transfer control system of buffer storage device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20150223 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20150223 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20160118 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20160126 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20160405 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20160419 |
|
A911 | Transfer of reconsideration by examiner before appeal (zenchi) |
Free format text: JAPANESE INTERMEDIATE CODE: A911 Effective date: 20160606 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20160705 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20160706 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5968693 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |