JPH09305490A - Microprocessor system - Google Patents

Microprocessor system

Info

Publication number
JPH09305490A
JPH09305490A JP8148357A JP14835796A JPH09305490A JP H09305490 A JPH09305490 A JP H09305490A JP 8148357 A JP8148357 A JP 8148357A JP 14835796 A JP14835796 A JP 14835796A JP H09305490 A JPH09305490 A JP H09305490A
Authority
JP
Japan
Prior art keywords
instruction cache
cache
cpu
counting means
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
JP8148357A
Other languages
Japanese (ja)
Inventor
Shingo Kojima
伸吾 小嶋
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 JP8148357A priority Critical patent/JPH09305490A/en
Publication of JPH09305490A publication Critical patent/JPH09305490A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To improve the performance of an instruction cache by preventing a capacity conflict of a microprocessor system which has the instruction cache. SOLUTION: A counter 5 is provided between a CPU 1 and the instruction cache 2. The CPU 1 generates a cache address information signal S1 each time it accesses the instruction cache 2, and consequently the value of the counter 5 is increased by one. Further, the CPU 1 generates a branch generation information signal S2 each time a subroutine call is generated or branching in a minus direction is established, and consequently the counter 5 is initialized to the number of entries, e.g. 4. Further, when the value of the counter 5 is 0, the counter 5 generates a caching function stop signal S3 to the instruction cache 2 to stop the function of the instruction cache 2.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は命令キャッシュを有
するマイクロプロセッサシステムに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microprocessor system having an instruction cache.

【0002】[0002]

【従来の技術】近年、マイクロプロセッサシステムにお
いては、性能向上を図るために、キャッシュメモリを用
いる。このキャッシュメモリは、チップ面積の増大に伴
なう製造コストと性能とのトレードオフから、1Kバイ
トないし4Kバイトの小容量となることが多い。図3は
従来の小容量の命令キャッシュを有するマイクロプロセ
ッサを示すブロック回路図である。図3においては、1
はCPU、2はエントリ数4のダイレクトマップ命令キ
ャッシュである。CPU1及び命令キャッシュ2はアド
レスバス3及びデータバス4によって接続されている。
2. Description of the Related Art In recent years, in a microprocessor system, a cache memory is used in order to improve the performance. This cache memory often has a small capacity of 1 Kbyte to 4 Kbyte due to the trade-off between manufacturing cost and performance accompanying the increase in chip area. FIG. 3 is a block circuit diagram showing a conventional microprocessor having a small capacity instruction cache. In FIG. 3, 1
Is a CPU, and 2 is a direct map instruction cache with four entries. The CPU 1 and the instruction cache 2 are connected by the address bus 3 and the data bus 4.

【0003】図4、図5を参照して図3のマイクロプロ
セッサシステムの動作を説明する。なお、図4はループ
を有するプログラムの一例、図5は命令キャッシュ2の
内容の遷移を示す図である。CPU1の動作が図4のプ
ログラムのループ部分に入ると、メインメモリ(図示せ
ず)から命令A、B、C、Dを順次フェッチして命令キ
ャッシュ2にロードすると共に実行する(ステップ50
1、502、503、504)。ここで、命令キャッシ
ュ2はダイレクトマップであるので、フェッチする命令
のアドレスによりその命令をおくエントリは確定する。
ステップ504の状態で、命令キャッシュ2のエントリ
のすべてが埋まることになる。
The operation of the microprocessor system shown in FIG. 3 will be described with reference to FIGS. Note that FIG. 4 is an example of a program having a loop, and FIG. 5 is a diagram showing the transition of the contents of the instruction cache 2. When the operation of the CPU 1 enters the loop portion of the program of FIG. 4, instructions A, B, C and D are sequentially fetched from the main memory (not shown), loaded into the instruction cache 2 and executed (step 50).
1, 502, 503, 504). Here, since the instruction cache 2 is a direct map, the entry in which the instruction is placed is determined by the address of the instruction to be fetched.
In the state of step 504, all the entries in the instruction cache 2 will be filled.

【0004】次に、続けてメインメモリから命令E、
F、G、Hを順次フェッチして実行する(ステップ50
5、506、507、508)。この場合、命令キャッ
シュ2のエントリはすべて埋められているので、命令キ
ャッシュ2のリプレースが発生し、命令A、B、C、D
は順次命令キャッシュ2のエントリから消去される。
Next, the instruction E from the main memory,
F, G and H are sequentially fetched and executed (step 50).
5, 506, 507, 508). In this case, since all the entries in the instruction cache 2 are filled, the instruction cache 2 is replaced, and the instructions A, B, C and D are replaced.
Are sequentially erased from the entries in the instruction cache 2.

【0005】次に、分岐命令である命令Hを実行後、再
び命令Aを実行するものとする。この場合、ステップ5
01にて命令Aは既に命令キャッシュ2にロードされて
いたが、ステップ505にて命令Eにリプレースされて
いる。従って、再びメインメモリから命令Aをフェッチ
して命令キャッシュ2にロードする(ステップ50
9)。引き続いて、命令B、C、…を実行する場合、同
様に、再びメインメモリから命令B、C、…をフェッチ
して命令キャッシュ2にロードする(ステップ510以
降)。
Next, after executing the instruction H which is a branch instruction, the instruction A is executed again. In this case, step 5
The instruction A has already been loaded into the instruction cache 2 at 01, but has been replaced by the instruction E at step 505. Therefore, the instruction A is fetched again from the main memory and loaded into the instruction cache 2 (step 50).
9). When the instructions B, C, ... Are subsequently executed, similarly, the instructions B, C, ... Are fetched again from the main memory and loaded into the instruction cache 2 (step 510 and after).

【0006】[0006]

【発明が解決しようとする課題】上述のごとく、小容量
命令キャッシュを有するマイクロプロセッサシステムで
ループを有するプログラムを実行すると、命令キャッシ
ュを用いているにもかかわらず、すべての命令をメイン
メモリからフェッチしなければならず、つまり、容量性
の競合が発生し、命令キャッシュの性能が打消されてし
まうという課題がある。なお、命令キャッシュがセット
アソシアティブ構成の場合も、そのセット分を使い果し
た後はループ前半で書きつぶすことに変わりがないの
で、同様の課題がある。従って、本発明の目的は、命令
キャッシュを有するマイクロプロセッサシステムの容量
性競合を防止して命令キャッシュの性能向上を図ること
にある。
As described above, when a program having a loop is executed in a microprocessor system having a small capacity instruction cache, all instructions are fetched from the main memory even though the instruction cache is used. That is, there is a problem that capacity competition occurs and the performance of the instruction cache is canceled. Even when the instruction cache has a set associative structure, there is no change in writing in the first half of the loop after the set is used up, so there is a similar problem. Therefore, it is an object of the present invention to improve the performance of the instruction cache by preventing the capacitive contention of the microprocessor system having the instruction cache.

【0007】[0007]

【課題を解決するための手段】上述の課題を解決するた
めに本発明は、CPUと、命令キャッシュと、命令キャ
ッシュとCPUとの間に命令キャッシュのリフィル可能
なエントリ数を記憶する計数手段とを設ける。CPUは
命令キャッシュをアクセス毎にキャッシュアクセス通知
信号を計数手段に送出して計数手段の値をディクリメン
トさせる。また、CPUはサブルーチンコールまたはマ
イナス方向への分岐が成立したときに分岐発生通知信号
を計数手段に送出して計数手段を初期化する。さらに,
計数手段の値が0のときに計数手段はキャッシュ機能停
止信号を命令キャッシュに送出して命令キャッシュの機
能を停止させる。なお、計数手段をインクリメント形と
することもできる。つまり、キャッシュリフィル回数を
制限することにより、ループを有するプログラムを実行
した場合、命令キャッシュが一杯となった時点でキャッ
シュ機能を無効化し、性能向上を図る。
In order to solve the above problems, the present invention provides a CPU, an instruction cache, and a counting means for storing the number of refillable entries in the instruction cache between the instruction cache and the CPU. To provide. The CPU sends a cache access notification signal to the counting means for each access of the instruction cache to decrement the value of the counting means. Further, the CPU sends a branch occurrence notification signal to the counting means to initialize the counting means when a subroutine call or a branch in the negative direction is established. further,
When the value of the counting means is 0, the counting means sends a cache function stop signal to the instruction cache to stop the function of the instruction cache. The counting means may be of an increment type. That is, by limiting the number of times of cache refilling, when a program having a loop is executed, the cache function is invalidated when the instruction cache becomes full to improve the performance.

【0008】[0008]

【発明の実施の形態】図1は本発明に係るマイクロプロ
セッサシステムの実施の形態を示すブロック図であっ
て、図4の構成要素に対してカウンタ5を付加してあ
る。カウンタ5は、CPU1からのキャッシュアクセス
通知信号S1及び分岐発生通知信号S2を受信し、ま
た、命令キャッシュ2へキャッシュ機能停止信号S3を
発生する。ここで、CPU1は命令キャッシュ2をアク
セスする毎にキャッシュアクセス通知信号S1を発生
し、この結果、カウンタ5の値は1ディクリメントされ
る。また、CPU1はサブルーチンコールまたはマイナ
ス方向への分岐が成立する毎に分岐発生通知信号S2を
発生し、この結果、カウンタ5は初期化され、カウンタ
5の値がエントリ数、ここでは、4とされる。さらに、
カウンタ5の値が0のときには、カウンタ5はキャッシ
ュ機能停止信号S3を命令キャッシュ2に発生して命令
キャッシュ2の機能を停止させる。
1 is a block diagram showing an embodiment of a microprocessor system according to the present invention, in which a counter 5 is added to the constituent elements of FIG. The counter 5 receives the cache access notification signal S1 and the branch occurrence notification signal S2 from the CPU 1, and also generates a cache function stop signal S3 to the instruction cache 2. Here, the CPU 1 generates the cache access notification signal S1 each time the instruction cache 2 is accessed, and as a result, the value of the counter 5 is decremented by 1. Further, the CPU 1 generates a branch occurrence notification signal S2 each time a subroutine call or a branch in the negative direction is established, and as a result, the counter 5 is initialized and the value of the counter 5 is set to the number of entries, here, 4 It further,
When the value of the counter 5 is 0, the counter 5 issues a cache function stop signal S3 to the instruction cache 2 to stop the function of the instruction cache 2.

【0009】図4、図2を参照して図1のマイクロプロ
セッサシステムの動作を説明する。なお、図2は命令キ
ャッシュ2の内容の遷移を示す図である。また、カウン
タ5の値は初期値4とする。CPU1の動作が図4のプ
ログラムのループ部分に入ると、メインメモリ(図示せ
ず)から命令A、B、C、Dを順次フェッチして命令キ
ャッシュ2にロードすると共に実行する(ステップ20
1、202、203、204)。ここで、命令キャッシ
ュ2はダイレクトマップであるので、フェッチする命令
のアドレスによりその命令をおくエントリは確定する。
各ステップ201、202、203、204におてい
は、CPU1がキャッシュアクセス通知信号S1を発生
するので、カウンタ5の値は、3、2、1、0と減少す
る。この結果、ステップ204の状態で、命令キャッシ
ュ2のエントリのすべてが埋まることになり、以後は、
カウンタ5のキャッシュ機能停止信号S3の発生により
命令キャッシュ2のリプレースは発生しない。
The operation of the microprocessor system shown in FIG. 1 will be described with reference to FIGS. 2 is a diagram showing the transition of the contents of the instruction cache 2. The value of the counter 5 is set to the initial value 4. When the operation of the CPU 1 enters the loop portion of the program shown in FIG. 4, instructions A, B, C and D are sequentially fetched from a main memory (not shown), loaded into the instruction cache 2 and executed (step 20).
1, 202, 203, 204). Here, since the instruction cache 2 is a direct map, the entry in which the instruction is placed is determined by the address of the instruction to be fetched.
In each of steps 201, 202, 203, and 204, since the CPU 1 generates the cache access notification signal S1, the value of the counter 5 decreases to 3, 2, 1, 0. As a result, in the state of step 204, all the entries of the instruction cache 2 are filled, and thereafter,
The replacement of the instruction cache 2 does not occur due to the generation of the cache function stop signal S3 of the counter 5.

【0010】次に、続けてメインメモリから命令E、
F、G、Hを順次フェッチして実行する(ステップ20
5、206、207、208)。この場合、キャッシュ
2のリプレースは発生しないので、命令A、B、C、D
は命令キャッシュ2内に残る。
Next, the instruction E is sent from the main memory.
F, G, H are sequentially fetched and executed (step 20)
5, 206, 207, 208). In this case, the replacement of the cache 2 does not occur, so the instructions A, B, C, D
Remains in the instruction cache 2.

【0011】次に、分岐命令である命令Hを実行後、再
び命令Aを実行するものとする。この場合、ステップ2
01して命令Aは既に命令キャッシュ2にロードされて
いる。従って、いわゆるキャッシュヒットとなる(ステ
ップ509)。引き続いて、命令B、C、Dを実行する
場合も、命令B、C、Dはステップ202、203、2
04にて命令キャッシュ2にロードされているのでキャ
ッシュヒットとなる(ステップ510以降)。その後、
命令D、E、F、G、Hを実行する場合、メインメモリ
から命令D、E、F、G、Hをフェッチして命令キャッ
シュ2にロードしなければならないが、これは従来例と
変わらない。
Next, after executing the instruction H which is a branch instruction, the instruction A is executed again. In this case, step 2
Then, the instruction A is already loaded in the instruction cache 2. Therefore, a so-called cache hit occurs (step 509). When the instructions B, C and D are subsequently executed, the instructions B, C and D are executed in steps 202, 203 and 2 respectively.
Since it is loaded in the instruction cache 2 at 04, a cache hit occurs (step 510 and after). afterwards,
When executing the instructions D, E, F, G, H, the instructions D, E, F, G, H must be fetched from the main memory and loaded into the instruction cache 2, but this is the same as the conventional example. .

【0012】なお、上述の発明の実施の形態において
は、カウンタ5をディクリメントカウンタとして構成し
ているが、インクリメントカウンタとして構成すること
もできる。この場合には、キャッシュアクセス通知信号
S1の受信毎にカウンタ5の値は1インクリメントさ
れ、また、分岐発生通知信号S2の受信毎にカウンタ5
はクリアされ、さらに、カウンタ5の値が所定値たとえ
ば4のときには、カウンタ5はキャッシュ機能停止信号
S3を命令キャッシュ2に発生して命令キャッシュ2の
機能を停止させる。
Although the counter 5 is configured as a decrement counter in the embodiment of the invention described above, it may be configured as an increment counter. In this case, the value of the counter 5 is incremented by 1 each time the cache access notification signal S1 is received, and the counter 5 is received each time the branch occurrence notification signal S2 is received.
Is cleared, and when the value of the counter 5 is a predetermined value, for example, 4, the counter 5 issues a cache function stop signal S3 to the instruction cache 2 to stop the function of the instruction cache 2.

【0013】[0013]

【発明の効果】以上説明したように本発明によれば、プ
ログラムのループあるいはサブルーチンコールで発生す
る容量性競合を防止でき、従って、命令キャッシュの性
能を向上できる。
As described above, according to the present invention, it is possible to prevent capacitive contention that occurs in a program loop or subroutine call, and thus improve the performance of the instruction cache.

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

【図1】本発明に係るマイクロプロセッサシステムの実
施の形態を示すブロック回路図である。
FIG. 1 is a block circuit diagram showing an embodiment of a microprocessor system according to the present invention.

【図2】図1のマイクロプロセッサシステムの動作を説
明するための命令キャッシュの内容を示す図である。
FIG. 2 is a diagram showing the contents of an instruction cache for explaining the operation of the microprocessor system of FIG.

【図3】従来のマイクロプロセッサシステムを示すブロ
ック回路図である。
FIG. 3 is a block circuit diagram showing a conventional microprocessor system.

【図4】ループを有するプログラムの一例を示すフロー
トチャートである。
FIG. 4 is a float chart showing an example of a program having a loop.

【図5】図3のマイクロプロセッサシステムの動作を説
明するための命令キャッシュの内容を示す図である。
5 is a diagram showing the contents of an instruction cache for explaining the operation of the microprocessor system of FIG.

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

1…CPU 2…命令キャッシュ 3…アドレスバス 4…データバス 5…カウンタ S1…キャッシュアクセス通知信号 S2…分岐発生通知信号 S3…キャッシュ機能停止信号 1 ... CPU 2 ... Instruction cache 3 ... Address bus 4 ... Data bus 5 ... Counter S1 ... Cache access notification signal S2 ... Branch occurrence notification signal S3 ... Cache function stop signal

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 CPU(1)と、 該CPU(1)とバス(3、4)によって接続された命
令キャッシュ(2)と、 該命令キャッシュと前記CPUとの間に該命令キャッシ
ュのリフィル可能なエントリ数を記憶する計数手段
(5)とを具備し、 前記CPUは前記命令キャッシュをアクセス毎にキャッ
シュアクセス通知信号(S1)を前記計数手段に送出し
て該計数手段の値をディクリメントさせ、前記CPUは
サブルーチンコールまたはマイナス方向への分岐が成立
したときに分岐発生通知信号(S2)を前記計数手段に
送出して該計数手段を初期化し,該計数手段の値が0の
ときに該計数手段はキャッシュ機能停止信号(S3)を
前記命令キャッシュに送出して該命令キャッシュの機能
を停止させるようにしたマイクロプロセッサシステム。
1. A CPU (1), an instruction cache (2) connected to the CPU (1) by a bus (3, 4), and the instruction cache can be refilled between the instruction cache and the CPU. A counting means (5) for storing the number of different entries, and the CPU sends a cache access notification signal (S1) to the counting means for each access of the instruction cache to decrement the value of the counting means. , The CPU sends a branch occurrence notification signal (S2) to the counting means to initialize the counting means when a subroutine call or a branch in the minus direction is established, and when the value of the counting means is 0, The counting system sends a cache function stop signal (S3) to the instruction cache to stop the function of the instruction cache.
【請求項2】 CPU(1)と、 該CPU(1)とバス(3、4)によって接続された命
令キャッシュ(2)と、 該命令キャッシュと前記CPUとの間に該命令キャッシ
ュのフィルしたエントリ数を記憶する計数手段(5)と
を具備し、 前記CPUは前記命令キャッシュをアクセス毎にキャッ
シュアクセス通知信号(S1)を前記計数手段に送出し
て該計数手段の値をインクリメントさせ、前記CPUは
サブルーチンコールまたはマイナス方向への分岐が成立
したときに分岐発生通知信号(S2)を前記計数手段に
送出して該計数手段をクリアし,該計数手段の値が所定
値のときに該計数手段はキャッシュ機能停止信号(S
3)を前記命令キャッシュに送出して該命令キャッシュ
の機能を停止させるようにしたマイクロプロセッサシス
テム。
2. A CPU (1), an instruction cache (2) connected to the CPU (1) by a bus (3, 4), and an instruction cache filled between the instruction cache and the CPU. Counting means (5) for storing the number of entries, the CPU sends a cache access notification signal (S1) to the counting means for each access of the instruction cache to increment the value of the counting means, The CPU sends a branch occurrence notification signal (S2) to the counting means to clear the counting means when a subroutine call or a branch in the minus direction is established, and when the value of the counting means is a predetermined value, the counting is performed. The means is a cache function stop signal (S
3) A microprocessor system for sending out 3) to the instruction cache to stop the function of the instruction cache.
JP8148357A 1996-05-17 1996-05-17 Microprocessor system Pending JPH09305490A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8148357A JPH09305490A (en) 1996-05-17 1996-05-17 Microprocessor system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8148357A JPH09305490A (en) 1996-05-17 1996-05-17 Microprocessor system

Publications (1)

Publication Number Publication Date
JPH09305490A true JPH09305490A (en) 1997-11-28

Family

ID=15450955

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8148357A Pending JPH09305490A (en) 1996-05-17 1996-05-17 Microprocessor system

Country Status (1)

Country Link
JP (1) JPH09305490A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7793085B2 (en) 2004-09-06 2010-09-07 Fujitsu Semiconductor Limited Memory control circuit and microprocessory system for pre-fetching instructions
EP2590082A1 (en) 2011-11-02 2013-05-08 Renesas Electronics Corporation Cache memory apparatus, cache control method, and microprocessor system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7793085B2 (en) 2004-09-06 2010-09-07 Fujitsu Semiconductor Limited Memory control circuit and microprocessory system for pre-fetching instructions
EP2590082A1 (en) 2011-11-02 2013-05-08 Renesas Electronics Corporation Cache memory apparatus, cache control method, and microprocessor system
US9317438B2 (en) 2011-11-02 2016-04-19 Renesas Electronics Corporation Cache memory apparatus, cache control method, and microprocessor system

Similar Documents

Publication Publication Date Title
US7185148B2 (en) Read access and storage circuitry read allocation applicable to a cache
US20030070051A1 (en) Methods and apparatus for utilizing flash burst mode to improve processor performance
US7065613B1 (en) Method for reducing access to main memory using a stack cache
KR20030004419A (en) Using volatile memory to buffer non-volatile memory
US6785770B2 (en) Data processing apparatus with a cache memory and method of using such an apparatus
US6000017A (en) Hybrid tag architecture for a cache memory
JP2001075866A (en) Method for operating storage device, and storage device
US5781922A (en) Page boundary caches
KR100731527B1 (en) Method and apparatus for overlaying memory in a data processing system
JPH09305490A (en) Microprocessor system
JP2003131945A (en) Cache memory device
KR20040067063A (en) The low power consumption cache memory device of a digital signal processor and the control method of the cache memory device
US6279082B1 (en) System and method for efficient use of cache to improve access to memory of page type
JP2976909B2 (en) Cache data flush control method
JPH05257807A (en) Cache memory controller
JP3001464B2 (en) Microprocessor device
JPH1055308A (en) Cache memory
JP2002049607A (en) Microcomputer with built-in cache
JPH06243045A (en) Cache memory
JPH0334014A (en) Management reference method for screen format data
JP2002024088A (en) Data processor
JPH1049440A (en) Cache memory system
JP2000029763A (en) Storage device control method and storing system thereof
JPH0546477A (en) Cathe memory control method
KR19980059771A (en) How to Handle Cache Memory Misses