JPH02307123A - Computer - Google Patents

Computer

Info

Publication number
JPH02307123A
JPH02307123A JP1129141A JP12914189A JPH02307123A JP H02307123 A JPH02307123 A JP H02307123A JP 1129141 A JP1129141 A JP 1129141A JP 12914189 A JP12914189 A JP 12914189A JP H02307123 A JPH02307123 A JP H02307123A
Authority
JP
Japan
Prior art keywords
external
memory
access
bus
instruction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP1129141A
Other languages
Japanese (ja)
Inventor
Hiroshi Narimatsu
成松 宏
Katsuhiko Negi
根木 勝彦
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 JP1129141A priority Critical patent/JPH02307123A/en
Publication of JPH02307123A publication Critical patent/JPH02307123A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To eliminate the useless time required for the access to an external memory and at the same time to decrease the useless external access frequency by selecting a simultaneous state with the access to an instruction cache or a mishit state of this cache when an access is given to the external memory. CONSTITUTION:When the hit is estimated for the access of this time, an access is first given to an instruction cache memory 1 only. Then an external bus using request signal is outputted to a bus arbitrating circuit 7 only when the access has a mishit to the memory 1. Then an address is outputted to an external address bus 3 and an access is given to an external memory 2. When the mishit of the access is estimated, an access is given to the memory 1 and at the same time an address is outputted to the bus 3 to have an access to the memory 2. Thus it is possible to reduce the useless time required for reading the data on the memory 2 and at the same time to decrease the useless application frequency of the bus 3.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は計算機に関し、特に命令用キャッシュメモリを
有する計算機に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a computer, and particularly to a computer having an instruction cache memory.

〔従来の技術〕[Conventional technology]

従来の、命令用キャッシュメモリを有する計算機では、
読み込むべき命令のある有効なアドレスを得た後、次の
いずれかの方式で命令を読み込んでいた。
In conventional computers with instruction cache memory,
After obtaining a valid address containing the instruction to be read, the instruction was read in one of the following ways:

すなわち、第1の方式は、まず命令用キャッシュメモリ
をアクセスし、ヒツトすればそのデータを読み込み、ヒ
ツトしなければ外部バスを経由して外部のメモリを読み
込む。第3図は、この動作のミスヒツトした場合のタイ
ミングチャート、第5図は従来の技術による命令用キャ
ッシュメモリの構成を示すブロック図である。
That is, in the first method, the instruction cache memory is first accessed, and if there is a hit, the data is read, and if there is no hit, the external memory is read via the external bus. FIG. 3 is a timing chart when this operation misses, and FIG. 5 is a block diagram showing the configuration of a conventional instruction cache memory.

CPU有効な命令読み込みアドレス9が出力されると、
命令用キャッシュメモリ1はそのメモリアクセスがヒツ
トすればヒツト信号10が出力される。これがミスヒツ
トであった場合、制御回路6は外部メモリをアクセスす
るために外部バス要求信号11を出力する。すると、バ
ス調停回路7が外部バス使用許可信号12を出力すると
、制御回路6はバッファ駆動信号13を出力し、アドレ
スを外部アドレスバス3に出力し、外部メモリ2の内容
が外部データバス14として読み出される。
When CPU valid instruction read address 9 is output,
The instruction cache memory 1 outputs a hit signal 10 when the memory access is hit. If this is a miss, control circuit 6 outputs external bus request signal 11 to access external memory. Then, when the bus arbitration circuit 7 outputs the external bus use permission signal 12, the control circuit 6 outputs the buffer drive signal 13, outputs the address to the external address bus 3, and the contents of the external memory 2 are transferred to the external data bus 14. Read out.

このとき、制御回路6から配線15を経由して供給され
るマルチプレクサ切換のための信号により、外部データ
バス14の信号は配線19を経由してCPUへ出力され
る。
At this time, the signal on the external data bus 14 is outputted to the CPU via the wiring 19 in response to a signal for multiplexer switching supplied from the control circuit 6 via the wiring 15.

第二の方式は、命令用キャッシュメモリをアクセスする
のと同時に、外部バスを経由して外部メモリもアクセス
し、キャッシュメモリがヒツトした時にはキャッシュメ
モリのデータを読み込み、ミスヒツトした時には外部メ
モリのデータを読み込む、第4図は、この動作のタイミ
ングチャートである。以下第5図と併せて説明する。
The second method is to access external memory via the external bus at the same time as accessing the instruction cache memory, and when the cache memory has a hit, the data in the cache memory is read, and when there is a miss, the data in the external memory is read. FIG. 4 is a timing chart of this operation. This will be explained below in conjunction with FIG.

CPU有効な命令読み込みアドレスが配線9に出力され
ると、これが命令用キャッシュメモリ1にヒツトするか
どうかに関係なく(すなわちヒツト信号10の状態に関
係なく)、制御回路6は外部バス要求信号11を出力す
る。すると、バス調停回路7が外部バス使用許可信号1
2を出力すると、制御回路6はバッファ駆動信号13を
出力し、アドレスを外部アドレスバス3に出力し、外部
メモリ2の内容が外部データバス14として読み出され
る。この場合も、制御回路6から配線15を経由して供
給されるマルチプレクサ切換のための信号により、外部
データバス14の信号は配線19を経由してCPUへ出
力する。
When a valid CPU instruction read address is output to the wiring 9, the control circuit 6 outputs the external bus request signal 11, regardless of whether it hits the instruction cache memory 1 (that is, regardless of the state of the hit signal 10). Output. Then, the bus arbitration circuit 7 issues the external bus use permission signal 1.
2, the control circuit 6 outputs the buffer drive signal 13, outputs the address to the external address bus 3, and the contents of the external memory 2 are read out as the external data bus 14. In this case as well, the signal on the external data bus 14 is output to the CPU via the wiring 19 in response to a signal for multiplexer switching supplied from the control circuit 6 via the wiring 15.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

上述した、命令用キャッシュを有する計算機では、第一
の方式のものではキャッシュにヒツトした場合外部バス
を使用しないと言う利点を有するが、ミスヒツトした場
合には、命令用キャッシュをアスセスした後に外部メモ
リをアクセスするのでデータを得るまでに時間がかかる
と言う欠点を有する。また、第二の方式のものでは、最
初から外部メモリをアクセスにいくので、ミスヒツトし
た場合でも外部メモリのアクセスに余計な時間を必要と
しないと言う利点を有するが、常に外部バスを使用する
と言う欠点を有する。外部バスは命令の読み込み以外に
も使用するので、無駄な外部アクセスの使用は性能の低
下を招くようになる。
In the above-mentioned computer with an instruction cache, the first method has the advantage of not using the external bus if the cache is hit, but if there is a miss, the instruction cache is accessed and then the external memory is accessed. The disadvantage is that it takes time to access the data. In addition, in the second method, since the external memory is accessed from the beginning, it has the advantage that no extra time is required to access the external memory even if there is a mishit, but it always uses the external bus. It has its drawbacks. Since the external bus is used for purposes other than reading instructions, unnecessary use of external access leads to a decrease in performance.

上述した従来の命令用キャッシュを有する計算機に対し
て、本発明の計算機では第一の方式と第二の方式との両
方の方式が利用可能で、場合に応じてそれらを使い分け
るという相違点を有する。
Compared to the above-mentioned conventional computer having an instruction cache, the computer of the present invention has the difference that both the first method and the second method can be used, and they can be used depending on the situation. .

〔課題を解決するための手段〕[Means to solve the problem]

本発明の計算機は、外部のバスを経由してアクセス可能
な外部メモリと、外部のバスを使用せずにアクセスでき
る命令用キャッシュメモリとを有する計算機において、 命令用キャッシュメモリをアクセスし、ミスヒツトした
時のみ外部バスを経由して外部メモリをアクセスする第
1の命令読み込み機能と、命令用キャッシュメモリと外
部メモリとを同時にアクセスし、命令用キャッシュメモ
リがヒツトした時はキャッシュメモリの値を、ヒツトし
なかった時には外部メモリの値を使用する第2の命令読
み込み機能と、 命令用キャッシュメモリの過去のヒツトの履歴から命令
用キャッシュメモリのヒツト/ミスヒツトを予測する予
測機能と、 ヒツトと予測した時には上記第1の命令読み込み機能を
使用して命令を読み込み、ミスヒツトと予測した時には
上記第2の命令読み込み機能を使用して命令を読み込む
第3の命令読み込み機能を有して構成される。
The computer of the present invention has an external memory that can be accessed via an external bus and an instruction cache memory that can be accessed without using an external bus. The first instruction reading function accesses the external memory via the external bus only when the instruction cache memory and the external memory are accessed at the same time, and when the instruction cache memory is hit, the cache memory value is a second instruction reading function that uses the value in external memory when the instruction cache memory has not been hit; a prediction function that predicts a hit/miss in the instruction cache memory from the history of past hits in the instruction cache memory; It is configured to have a third instruction reading function that reads an instruction using the first instruction reading function, and reads the instruction using the second instruction reading function when a miss is predicted.

〔実施例〕 第1図は本発明の第1の実施例の命令用キャッシュメモ
リの構成を説明する図である。この実施例では、説明を
簡単にするためにキャッシュメモリに対する書込み動作
に関する部分は省いである。
[Embodiment] FIG. 1 is a diagram illustrating the configuration of an instruction cache memory according to a first embodiment of the present invention. In this embodiment, the portion related to the write operation to the cache memory is omitted to simplify the explanation.

命令用キャッシュメモリ1は命令読み込み用アドレス信
号9を入力しヒツトすれば、データを配線16に出力し
、ヒツト信号10を出力する。トライステートバッファ
5は、バッファ駆動信号13がアクティブである時に命
令読み込みアドレス信号を外部アドレスバス3に出力す
る。外部バスは外部アドレスバス3と外部データバス1
4とからなる。外部バスは、トライステートバッファ5
以外の物ともつながれているかもしれないので、使用す
る前に外部バスの確保を行なわなければならないやそれ
を行なうのがバス調停回路7である。
The instruction cache memory 1 inputs an address signal 9 for reading an instruction, and when a hit occurs, it outputs data to a wiring 16 and outputs a hit signal 10. Tri-state buffer 5 outputs an instruction read address signal to external address bus 3 when buffer drive signal 13 is active. The external buses are external address bus 3 and external data bus 1.
It consists of 4. The external bus is a tri-state buffer 5
Since the external bus may be connected to other devices, it is necessary to secure an external bus before use, and the bus arbitration circuit 7 does this.

制御回路6が外部バスの使用を要求するなめに外部バス
要求信号11をアクティブにすると、バス調停回路7は
他からの要求や使用状況とあらかじめ決められている優
先順位に基づいて、外部バス使用許可信号12が出力さ
れる6図を分りやすくするために、バス調停回路7が他
からの要求や使用状況を知るための構成は、第1図には
かかれていない。
When the control circuit 6 activates the external bus request signal 11 to request the use of an external bus, the bus arbitration circuit 7 determines whether to use the external bus based on requests from others, the usage status, and a predetermined priority. In order to make it easier to understand FIG. 6 in which the permission signal 12 is output, the configuration for the bus arbitration circuit 7 to know requests from others and the usage status is not shown in FIG.

そして、外部メモリ2は外部アドレスバス3で指定され
るアドレスにデータの書込み、あるいは読みだしを行な
う、読みだされたデータは外部データバス14を経由し
てマルチプレクサ8に入力される。マルチプレクサ8は
、制御回路6が配線15を経由して出力するマルチプレ
クサ切換のための信号によって配線16か外部データバ
ス14のいづれかを配線19を経由してCPUへ出力す
る。キャツシュヒツト予測回路20は命令読み込みアド
レスとヒツト信号との履歴から、命令キャッシュがヒツ
トするかどうかを予測しこの結果を制御回路6に出力す
る。
The external memory 2 then writes or reads data to or from the address designated by the external address bus 3. The read data is input to the multiplexer 8 via the external data bus 14. The multiplexer 8 outputs either the wiring 16 or the external data bus 14 to the CPU via the wiring 19 in response to a signal for multiplexer switching outputted from the control circuit 6 via the wiring 15. The cache hit prediction circuit 20 predicts whether or not the instruction cache will be hit based on the history of the instruction read address and the hit signal, and outputs this result to the control circuit 6.

本実施例では、命令用キャッシュメモリへの書込みは、
ミスヒツトしたデータのみで先読み(キャッシュメモリ
がCPUの動作を予測し、読み込み要求が出ていないデ
ータを前もって読み込んでおくこと)は行なわないもの
とする。
In this embodiment, writing to the instruction cache memory is as follows:
Pre-reading (where the cache memory predicts the CPU operation and reads in advance data for which no read request has been issued) is not performed using only the mishit data.

このような状況で命令キャッシュがヒツトするのは、プ
ログラムがループにかかった場合が多いと考えられる。
In such a situation, the instruction cache is often hit because the program is stuck in a loop.

ここでキャッシュのヒツト予測のアルゴリズムとして次
のものを使用する。ある命令読み込みのアクセスで、命
令用キャッシュがヒツトすれば、次の命令読み込みアク
セスでキャッシュはヒツトするであろうと予測し、ミス
ヒツトすれば、次もミスヒツトするであろうと予測する
Here, the following algorithm is used for cache hit prediction. If the instruction cache hits during a certain instruction read access, it is predicted that the next instruction read access will hit the cache, and if there is a miss, it is predicted that the next one will also be a miss.

この時、本実施例の動作は次のようになる。前回のアク
セスの結果によって、今回のアクセスがヒツトするであ
ろうと予測した場合には、まず命令用キャッシュメモリ
1のみアクセスし、それがミスヒツトした時のみバス調
停回路7に外部バス使用要求信号を出力し、外部アドレ
スバス3にアドレスを出力し外部メモリをアクセスする
。すなわち、第3図に示す動作をする。ミスヒツトする
であろうと予測した時には、命令用キャッシュメモリ1
をアクセスすると同時にバス調停回路7に外部バス使用
要求信号を出力し、外部アドレスバス3にアドレスを出
力して外部メモリをアクセスする。命令用キャッシュメ
モリ1がヒツトすればキャッシュメモリのデータをCP
Uに送るとともに、外部メモリのアクセスを中断する。
At this time, the operation of this embodiment is as follows. If it is predicted that the current access will be a hit based on the result of the previous access, first, only the instruction cache memory 1 is accessed, and only when there is a miss, an external bus use request signal is output to the bus arbitration circuit 7. Then, the address is output to the external address bus 3 and the external memory is accessed. That is, the operation shown in FIG. 3 is performed. When a miss is predicted, the instruction cache memory 1
At the same time, an external bus use request signal is output to the bus arbitration circuit 7, an address is output to the external address bus 3, and the external memory is accessed. If instruction cache memory 1 hits, the data in the cache memory is transferred to the CP
At the same time, access to the external memory is interrupted.

キャッシュメモリがミスヒツトすれば外部メモリのデー
タをCPUに送る、すなわち、第4図に示す動作をする
If the cache memory misses, the data in the external memory is sent to the CPU, ie, the operation shown in FIG. 4 is performed.

第2図は、本発明の第2の実施例の命令用キャッシュメ
モリの構成を説明する図である。
FIG. 2 is a diagram illustrating the configuration of an instruction cache memory according to a second embodiment of the present invention.

第1図に示した第1の実施例との相違点のみ説明する。Only the differences from the first embodiment shown in FIG. 1 will be explained.

その内容は、命令用キャッシュメモリとマルチプレクサ
をつなぐ配線18と外部データバス17が4ワードの幅
を持っており、ミスヒツト時のキャッシュメモリへの書
込みが4ワ一ド単位に行なわれる。ここで、lワードの
幅とはCPUにデータを送る配線19の幅のことである
。この構成ではミスヒツトが起きてキャッシュメモリへ
の書込みが行なわれると、その直後の同じ4ワードのブ
ロックく以下ブロックと記す)に対する読みだしはヒツ
トするので、キャツシュヒツト予測回路20のアルゴリ
ズムは次のようにする。前回のアクセスと同じブロック
をアクセスした場合にはヒツトすると予測する。異なる
ブロックのアクセスである時には、前回のブロックがキ
ャッシュにヒツトした時にはヒツトすると、ミスヒツト
であった時にはミスヒツトすると予測する。これ以外の
動作は第1の実施例と同じである。
The contents include that the wiring 18 connecting the instruction cache memory and the multiplexer and the external data bus 17 have a width of 4 words, and writing to the cache memory in the event of a miss is performed in units of 4 words. Here, the width of l word is the width of the wiring 19 that sends data to the CPU. In this configuration, when a miss occurs and a write is performed to the cache memory, the read to the same 4-word block (hereinafter referred to as a block) immediately after it will be a hit, so the algorithm of the cache hit prediction circuit 20 is as follows. do. If the same block as the previous access is accessed, a hit is predicted. When accessing a different block, if the previous block hit the cache, it is predicted to be a hit, and if it was a miss, it is predicted to be a miss. The other operations are the same as in the first embodiment.

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

以上説明したように本発明は、外部メモリのアクセスの
命令用キャッシュのアクセスと同時あるいは命令用キャ
ッシュメモリがミスヒツトした時のいずれかを選択でき
るようにし、ヒツトする確率が高い時には命令用キャッ
シュメモリのアクセス後、ミスヒツトだった時だけ外部
メモリをアクセスし、ミスヒツトする確率が高い時には
、命令用キャッシュメモリのアクセスと同時に外部メモ
リもアクセスすることによって、命令用キャッシュメモ
リがミスヒツトした時でも、外部メモリのデータを読み
込むのにかかる余計な時間が少なく、かつ不必要な外部
バスの使用が少ない計算機を構成できるという効果があ
る。
As explained above, the present invention makes it possible to select whether to access the external memory at the same time as the instruction cache access or when the instruction cache memory misses, and when the probability of a hit is high, the instruction cache memory After an access, the external memory is accessed only when there is a miss, and when there is a high probability of a miss, the external memory is accessed at the same time as the instruction cache memory, so even if the instruction cache memory misses, the external memory is This has the advantage that it is possible to configure a computer that requires less extra time to read data and uses less unnecessary external buses.

図面の簡単な説明 第1図は本発明の第1の実施例の構成を示すブロック図
、第2図は第2の実施例の構成を示すブロック図、第3
図は命令用キャッシュのミスヒツトしたのち外部メモリ
をアクセスする動作のタイミングチャート、第4図は命
令用キャッシュメモリがキャッシュメモリアクセスと同
時に外部メモリをアクセスしに行く動作のタイミングチ
ャート、第5図は従来の技術による命令用キャッシュメ
モリの構成を示すブロック図である。
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block diagram showing the configuration of the first embodiment of the present invention, FIG. 2 is a block diagram showing the configuration of the second embodiment, and FIG.
The figure is a timing chart of the operation of accessing the external memory after a miss in the instruction cache. Figure 4 is the timing chart of the operation of the instruction cache memory accessing the external memory at the same time as the cache memory access. Figure 5 is the conventional timing chart. FIG. 2 is a block diagram showing the configuration of an instruction cache memory according to the technique of FIG.

Claims (1)

【特許請求の範囲】 外部のバスを経由してアクセス可能な外部メモリと、外
部のバスを使用せずにアクセスできる命令用キャッシュ
メモリとを有する計算機において、 命令用キャッシュメモリをアクセスし、ミスヒットした
時のみ外部バスを経由して外部メモリをアクセスする第
1の命令読み込み機能と、 命令用キャッシュメモリと外部メモリとを同時にアクセ
スし、命令用キャッシュメモリがヒットした時はキャッ
シュメモリの値を、ヒットしなかった時には外部メモリ
の値を使用する第2の命令読み込み機能と、 命令用キャッシュメモリの過去のヒットの履歴から命令
用キャッシュメモリのヒット/ミスヒットを予測する予
測機能と、 ヒットと予測した時には上記第1の命令読み込み機能を
使用して命令を読み込み、ミスヒットと予測した時には
上記第2の命令読み込み機能を使用して命令を読み込む
第3の命令読み込み機能を有して成ることを特徴とする
計算機。
[Claims] In a computer having an external memory that can be accessed via an external bus and an instruction cache memory that can be accessed without using the external bus, the instruction cache memory is accessed and a miss occurs. The first instruction reading function accesses the external memory via the external bus only when the instruction cache memory is hit, and the instruction cache memory and external memory are accessed simultaneously, and when the instruction cache memory is hit, the cache memory value is A second instruction reading function that uses the value in external memory when there is no hit, a prediction function that predicts a hit/miss in the instruction cache memory from the history of past hits in the instruction cache memory, and a hit and prediction function. When a mishit is predicted, the first instruction reading function is used to read the instruction, and when a miss is predicted, the second instruction reading function is used to read the instruction. Featured calculator.
JP1129141A 1989-05-22 1989-05-22 Computer Pending JPH02307123A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1129141A JPH02307123A (en) 1989-05-22 1989-05-22 Computer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1129141A JPH02307123A (en) 1989-05-22 1989-05-22 Computer

Publications (1)

Publication Number Publication Date
JPH02307123A true JPH02307123A (en) 1990-12-20

Family

ID=15002138

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1129141A Pending JPH02307123A (en) 1989-05-22 1989-05-22 Computer

Country Status (1)

Country Link
JP (1) JPH02307123A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6880046B1 (en) 1999-12-13 2005-04-12 Fujitsu Limited Multiprocessor system and memory access method
WO2008029450A1 (en) * 2006-09-05 2008-03-13 Fujitsu Limited Information processing device having branching prediction mistake recovery mechanism

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6880046B1 (en) 1999-12-13 2005-04-12 Fujitsu Limited Multiprocessor system and memory access method
WO2008029450A1 (en) * 2006-09-05 2008-03-13 Fujitsu Limited Information processing device having branching prediction mistake recovery mechanism

Similar Documents

Publication Publication Date Title
US5426765A (en) Multiprocessor cache abitration
JP3180362B2 (en) Information processing device
US5353416A (en) CPU lock logic for corrected operation with a posted write array
EP0283891B1 (en) Cache memory with hit predictive logic
US5535363A (en) Method and apparatus for skipping a snoop phase in sequential accesses by a processor in a shared multiprocessor memory system
KR960007833B1 (en) Method and apparatus for fast page mode selection
EP0290730A2 (en) Data transfer apparatus and method for use in a data processing system
US5809534A (en) Performing a write cycle to memory in a multi-processor system
JPH02307123A (en) Computer
JP3169878B2 (en) Memory control circuit
JPH03154139A (en) Cache memory
JP2001229074A (en) Memory controller and information processor and memory control chip
JPH0756844A (en) Master-bus master used for computer system based on bus with system memory and computer system based on bus
JPH076117A (en) Data transfer method and data transfer device
JP2000066946A (en) Memory controller
JPH03116345A (en) Data processor
JPH02226447A (en) Computer system and memory access therefor
JPH04305746A (en) Cache memory control device
JPS61165172A (en) Memory access controlling system
JPH1027132A (en) Cache memory invalidating device
JPH09244957A (en) Bus connection device and method
JPH08166905A (en) Cache memory control method
JPH02187840A (en) Cache memory control system
JPH06149677A (en) Cache memory system
JPS6215644A (en) Cache memory control circuit