JP2008052518A - Cpu system - Google Patents
Cpu system Download PDFInfo
- Publication number
- JP2008052518A JP2008052518A JP2006228362A JP2006228362A JP2008052518A JP 2008052518 A JP2008052518 A JP 2008052518A JP 2006228362 A JP2006228362 A JP 2006228362A JP 2006228362 A JP2006228362 A JP 2006228362A JP 2008052518 A JP2008052518 A JP 2008052518A
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- cpu
- cache memory
- branch
- read
- 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
Links
Images
Abstract
Description
本発明は、DRAMに格納されたプログラムの命令を一旦キャッシュに読み込んでCPUに供給するCPUシステムに関するものである。 The present invention relates to a CPU system that once reads instructions of a program stored in a DRAM into a cache and supplies them to a CPU.
CPU(Central Processing Unit)を中心として構成されるマイクロコンピュータなどのCPUシステムにおいては、メモリから読み出したプログラムを順次実行していく。近年、このようなCPUシステムの動作速度を向上させるため、CPUの動作周波数が年々高められている。 In a CPU system such as a microcomputer mainly composed of a CPU (Central Processing Unit), programs read from the memory are sequentially executed. In recent years, the operating frequency of CPUs has been increased year by year in order to improve the operating speed of such CPU systems.
また、低コスト化を図るため、メモリとして比較的低速なDRAM(Dynamic Random Access Memory)を用いた場合、CPUの動作に対してDRAMのアクセスが遅いため、CPUシステムの高速動作を実現できない。このため、従来、CPUと低速な外部メモリとの間にキャッシュ(Cashe)を設けることにより、CPUシステムの高速化を達成している(例えば特許文献1参照)。キャッシュは容量の少ない高速なメモリであるため、CPUが必要とするプログラムやデータをキャッシュに一旦読み込んでおき、CPUがキャッシュから必要な部分を読み出す。特に、プログラムの命令を保存するキャッシュは命令キャッシュ(I-Cashe)と呼ばれる。 Further, when a relatively low-speed DRAM (Dynamic Random Access Memory) is used as a memory in order to reduce the cost, the access of the DRAM is slow relative to the operation of the CPU, and thus the high-speed operation of the CPU system cannot be realized. For this reason, conventionally, a high-speed CPU system has been achieved by providing a cache between the CPU and a low-speed external memory (see, for example, Patent Document 1). Since the cache is a high-speed memory with a small capacity, the program and data required by the CPU are once read into the cache, and the CPU reads out necessary portions from the cache. In particular, a cache that stores program instructions is called an instruction cache (I-Cashe).
必要な命令が命令キャッシュになければ(ヒットしなければ)、当該命令がDRAMより命令キャッシュに読み込まれるまでCPUが待機(ウエイト)状態となって高速動作性が損なわれる。このため、命令の連続性や反復性などを利用して頻繁に必要とされる命令を予めDRAMから読み出して命令キャッシュに読み込んでおくプリフェッチ(Pre-fetch)という手法が用いられている。これにより、CPUが命令キャッシュに必要な命令を読み出すときにミスヒットすれば、必要な命令がDRAMからプリフェッチバッファに読み込まれるとともに、当該命令がプリフェッチバッファから命令キャッシュおよびCPUへ読み込まれる。したがって、このような動作によって、CPUのウエイトを短くすることができる。 If the necessary instruction is not in the instruction cache (if it is not hit), the CPU is in a wait (wait) state until the instruction is read from the DRAM into the instruction cache, and high-speed operation is impaired. For this reason, a method called prefetch (Pre-fetch) in which frequently required instructions are read from the DRAM in advance and read into the instruction cache using the continuity and repeatability of the instructions is used. As a result, if the CPU misses when reading a necessary instruction in the instruction cache, the necessary instruction is read from the DRAM into the prefetch buffer and the instruction is read from the prefetch buffer into the instruction cache and the CPU. Therefore, the weight of the CPU can be shortened by such an operation.
従来の命令キャッシュに対するアクセス方法では、上記のような動作が、命令が分岐(jump,branch,call,return)命令であるか否かに関わらず、CPUがアクセスする毎に行われる。
ところで、近年、DRAMの高速化が進んでおり、SDRAM(Synchronous DRAM)、DDR−SDRAM(Double Data Rate DRAM)、RDRAM(Rumbus DRAM)、XDRDRAM(eXtreme Data Rate DRAM )などの高速DRAMが普及してきている。したがって、このような高速DRAMのCPUシステムへの利用も進められている。 By the way, in recent years, DRAMs have been accelerated, and high-speed DRAMs such as SDRAM (Synchronous DRAM), DDR-SDRAM (Double Data Rate DRAM), RDRAM (Rumbus DRAM), and XDRDRAM (eXtreme Data Rate DRAM) have become widespread. Yes. Therefore, the use of such a high-speed DRAM in a CPU system is also being promoted.
また、上記のCPUシステムをASIC(Application Specific Integrated Circuit)で作製する場合、フルカスタムASICまたはセミカスタムASICのいずれかを選択することになる。フルカスタムASICで作製する場合は、高集積化が可能であるので、CPUの動作周波数を1GHzのように高くすることができる反面、設計コストが嵩む。一方、ゲートアレイやセルベースといったセミカスタムASICで作製する場合は、予め用意されている標準ゲートや機能ブロックを用いることにより、設計コストを抑えることができる反面、集積度がフルカスタムASICより劣るため、CPUの動作周波数が100MHzのように低い。 Further, when the CPU system is manufactured by an application specific integrated circuit (ASIC), either a full custom ASIC or a semi-custom ASIC is selected. In the case of manufacturing with a full custom ASIC, since high integration is possible, the operating frequency of the CPU can be increased to 1 GHz, but the design cost increases. On the other hand, when a semi-custom ASIC such as a gate array or a cell base is used, the design cost can be reduced by using standard gates and function blocks prepared in advance, but the degree of integration is inferior to that of a full custom ASIC. The operating frequency of the CPU is as low as 100 MHz.
このようなセミカスタムASICで作製されたCPUシステムにおいて高速DRAMが組み込まれる場合、高速DRAMをバーストリード動作させることによってCPUの動作速度がバーストリード動作の速度以下となることがある。この条件下では、プログラムの命令がDRAMから連続的に順次読み出されるときには、DRAMのバーストリード動作によって命令が読み出されて、プリフェッチバッファを介してCPUに読み込まれるので、ウエイトなしでCPUが命令を読み込むことができる。したがって、この場合は、命令キャッシュを必要としない。これに対し、命令が分岐命令である場合、DRAMにおいては、不連続なアドレスがアクセスされて命令が読み出されるため、CPU内の処理(パイプライン処理)も含めた処理の連続性が崩れる。このとき、DRAMに対しては、RAS(Row Address Strobe)やCAS(Column Address Strobe)の処理を行う必要があるので、この間はCPU動作にウエイトが生じる。 When a high-speed DRAM is incorporated in a CPU system manufactured with such a semi-custom ASIC, the operation speed of the CPU may be lower than the burst read operation speed by performing the burst read operation of the high-speed DRAM. Under these conditions, when program instructions are read sequentially and sequentially from the DRAM, the instructions are read by the burst read operation of the DRAM and read into the CPU via the prefetch buffer. Can be read. Therefore, in this case, no instruction cache is required. On the other hand, when the instruction is a branch instruction, in the DRAM, the discontinuous address is accessed and the instruction is read, so that the continuity of processing including processing in the CPU (pipeline processing) is lost. At this time, since it is necessary to perform RAS (Row Address Strobe) or CAS (Column Address Strobe) processing for the DRAM, the CPU operation waits during this time.
本発明は、上記の問題点に鑑みてなされたものであり、高速DRAMを用いたCPUシステムにおいて、分岐命令の処理時におけるCPUのウエイト時間を短縮することを目的としている。 The present invention has been made in view of the above-described problems, and an object of the present invention is to shorten the wait time of a CPU when processing a branch instruction in a CPU system using a high-speed DRAM.
本発明に係るCPUシステムは、プログラムを格納し、バーストリード動作の可能な高速DRAMと、前記プログラムにおける分岐命令が指定する分岐先の分岐先命令を少なくとも格納するとともに、当該命令を前記高速DRAMにおいて指定するアドレスを格納する命令キャッシュメモリと、当該命令キャッシュメモリから読み出された前記プログラムの命令を処理し、バーストリード動作時の前記高速DRAMの動作速度以下の動作速度で動作するCPUと、当該CPUが前記高速DRAMから読み出された前記分岐命令を処理したときに、当該分岐命令が指定する前記分岐先命令が前記命令キャッシュメモリに格納されているか否かを判定する判定手段と、前記分岐先命令が前記命令キャッシュメモリに格納されていると判定されると、前記命令キャッシュメモリから読み出された分岐先命令を前記CPUに出力する命令出力手段とを備えていることを特徴としている。 The CPU system according to the present invention stores at least a high-speed DRAM capable of storing a program and capable of a burst read operation and a branch destination instruction specified by a branch instruction in the program, and the instruction is stored in the high-speed DRAM. An instruction cache memory that stores an address to be designated, a CPU that processes an instruction of the program read from the instruction cache memory, and that operates at an operation speed lower than the operation speed of the high-speed DRAM during a burst read operation; Determining means for determining whether or not the branch destination instruction specified by the branch instruction is stored in the instruction cache memory when the CPU processes the branch instruction read from the high-speed DRAM; When it is determined that the previous instruction is stored in the instruction cache memory It is characterized by comprising an instruction output means for outputting the branch target instruction read from the instruction cache memory to the CPU.
上記の構成では、CPUがバーストリード動作時の前記高速DRAMの動作速度以下の動作速度で動作する。この動作条件において、高速DRAMから読み出された命令(非分岐命令)がCPUにおいて連続的に順次処理されるときには、当該命令がDRAMのバーストリード動作によって連続的に読み出されてCPU2に読み込まれる。これにより、ウエイトなしでCPUが命令を読み込むことができる。したがって、この場合は、命令キャッシュメモリから命令を読み出す必要がない。
In the above configuration, the CPU operates at an operation speed lower than the operation speed of the high-speed DRAM during the burst read operation. Under these operating conditions, when instructions (non-branch instructions) read from the high-speed DRAM are successively processed sequentially by the CPU, the instructions are continuously read by the DRAM burst read operation and read into the
一方、CPUが分岐命令を処理したとき、判定手段によって、当該分岐命令が指定する前記分岐先命令が前記命令キャッシュメモリに格納されているか否かが判定される。そして、分岐先命令が命令キャッシュメモリに格納されていると判定された場合、命令出力手段によって、命令キャッシュメモリから読み出された分岐先命令がCPUに出力される。これにより、分岐先命令が命令キャッシュメモリに格納されていれば、その分岐先命令をCPUに読み込むことにより、分岐命令を処理するときでも、CPUの動作にウエイトが生じることはない。 On the other hand, when the CPU processes the branch instruction, the determination unit determines whether or not the branch destination instruction specified by the branch instruction is stored in the instruction cache memory. If it is determined that the branch destination instruction is stored in the instruction cache memory, the instruction output unit outputs the branch destination instruction read from the instruction cache memory to the CPU. As a result, if the branch destination instruction is stored in the instruction cache memory, the CPU does not wait for the operation of the CPU even when the branch instruction is processed by reading the branch destination instruction into the CPU.
前記CPUシステムにおいて、前記CPUは前記分岐命令を指定するアドレスを出力し、CPUシステムは、前記分岐先命令が前記命令キャッシュメモリに格納されていないと判定されると、前記高速DRAMから前記アドレスに基づいて前記分岐先命令を読み出す読出制御手段を備え、前記命令キャッシュメモリは、前記高速DRAMから読み出された前記分岐先命令を格納することが好ましい。 In the CPU system, the CPU outputs an address designating the branch instruction, and when the CPU system determines that the branch destination instruction is not stored in the instruction cache memory, the CPU reads the address from the high-speed DRAM to the address. It is preferable that a read control unit is provided for reading the branch destination instruction based on the instruction cache memory, and the instruction cache memory stores the branch destination instruction read from the high-speed DRAM.
上記の構成においては、判定手段による判定結果が否である場合、読出制御手段によって、CPUから出力されるアドレスに基づいて、高速DRAMから分岐先命令が読み出され、この分岐先命令が命令キャッシュメモリに格納される。この場合は、CPUが分岐命令を処理したときに、命令キャッシュメモリから分岐先命令を読み出すことができないので、分岐先命令が高速DRAMから命令キャッシュメモリに格納されるまでCPUの動作にウエイトが生じてしまう。しかしながら、比較的繰り返して読み込まれることの多い分岐先命令を一旦命令キャッシュメモリに格納しておけば、以降の分岐命令が当該分岐先命令を指定する場合に、当該分岐先命令を命令キャッシュメモリから直ちに読み出すことができる。 In the above configuration, when the determination result by the determination unit is negative, the read control unit reads the branch destination instruction from the high-speed DRAM based on the address output from the CPU, and the branch destination instruction is read from the instruction cache. Stored in memory. In this case, since the branch destination instruction cannot be read from the instruction cache memory when the CPU processes the branch instruction, the CPU operation waits until the branch destination instruction is stored in the instruction cache memory from the high-speed DRAM. End up. However, once a branch destination instruction that is read relatively repeatedly is stored in the instruction cache memory, when the subsequent branch instruction designates the branch destination instruction, the branch destination instruction is read from the instruction cache memory. It can be read immediately.
本発明に係るCPUシステムは、以上のように、前述の高速DRAMと、命令キャッシュメモリと、CPUと、判定手段と、命令出力手段とを備えているので、CPUが分岐命令を処理するときに、高速DRAMにおいて、不連続なアドレスをアクセスして命令を読み出す動作が不要となる。したがって、CPU内の処理も含めたCPUシステム全体の処理の連続性を維持することができるという効果を奏する。 As described above, the CPU system according to the present invention includes the above-described high-speed DRAM, instruction cache memory, CPU, determination means, and instruction output means, so that when the CPU processes a branch instruction, In a high-speed DRAM, an operation of accessing a discontinuous address and reading an instruction becomes unnecessary. Therefore, it is possible to maintain the continuity of the processing of the entire CPU system including the processing in the CPU.
本発明の実施形態について図1ないし図3に基づいて説明すると、以下の通りである。 An embodiment of the present invention will be described with reference to FIGS. 1 to 3 as follows.
図1に示すように、CPUシステム1は、CPU2と、SDRAM3と、命令キャッシュメモリ5と、プリフェッチバッファ6と、コンパレータ7と、セレクタ8と、8進カウンタ9と、RSフリップフロップ10と、ANDゲート11,12と、加算器13とを備えている。このCPUシステム1は、例えばセミカスタムASICによって作製されている。
As shown in FIG. 1, the CPU system 1 includes a
なお、図1において各回路間の接続線は、太い実線が複数ビットの信号線を表し、細い実線が1ビットの信号線を表している。 Note that in FIG. 1, among the connection lines between the circuits, a thick solid line represents a multi-bit signal line, and a thin solid line represents a 1-bit signal line.
CPU2は、入力されるプログラムの命令(プログラムコード)をパイプライン処理によって並列的に処理していくCPUコア2aを有している。このCPU2の動作速度(動作周波数)は、後述するSDRAM3のバーストリード動作時の動作速度(動作周波数)以下である。CPUコア2aは、飛び先アドレスJumpAddおよび分岐命令識別信号BranchSigを出力する。飛び先アドレスJumpAddは、分岐命令によって指定された分岐先の命令であり、当該命令がSDRAM3に格納されている領域のアドレスである。また、分岐命令識別信号BranchSigは、CPUコア2によって処理される命令が分岐命令であるか否かを識別するための信号である。CPUコア2aは、その分岐命令を実行したときに飛び先アドレスJumpAddおよび分岐命令識別信号BranchSigを出力する。つまり、この分岐命令識別信号BranchSigは、命令が分岐命令であるときに“1”であり、命令が分岐命令でないときに“0”である。
The
SDRAM3は、プログラムおよびデータを格納しており、DRAMコントローラ4の制御によって、プログラムおよびデータの読み書きが制御される。SDRAM3は、高速DRAMとしてCPUシステム1に設けられているが、高速DRAMとしては、SDRAM3の代わりに、前述のDDR−SDRAM、RDRAM、XDRDRAMなどが設けられていてもよい。 The SDRAM 3 stores programs and data, and reading and writing of the programs and data are controlled by the control of the DRAM controller 4. The SDRAM 3 is provided in the CPU system 1 as a high-speed DRAM. However, as the high-speed DRAM, the above-described DDR-SDRAM, RDRAM, XDRDRAM, or the like may be provided instead of the SDRAM 3.
DRAMコントローラ4は、SDRAM3によるプログラムおよびデータの読み書きを制御する制御回路である。ここでは、DRAMコントローラ4のプログラムの読み書きについて説明する。 The DRAM controller 4 is a control circuit that controls reading and writing of programs and data by the SDRAM 3. Here, reading and writing of the program of the DRAM controller 4 will be described.
DRAMコントローラ4は、飛び先アドレスJumpAddおよび分岐命令識別信号BranchSigが制御信号として入力される。DRAMコントローラ4は、分岐命令識別信号BranchSigが“1”であるときに加算器13からの飛び先アドレスJumpAddが入力されると、SDRAM3に対してプログラム(プログラムコード)の読み出しの準備動作を行い、当該飛び先アドレスJumpAddの命令を読み出す。上記の準備動作は、具体的には、アクセス先のメモリセルの行アドレスを指定するためのRAS信号の出力や、当該メモリセルの列アドレスを指定するためのCAS信号の出力などである。
The DRAM controller 4 receives the jump address JumpAdd and the branch instruction identification signal BranchSig as control signals. When the jump destination address JumpAdd is input from the
命令キャッシュメモリ5は、SDRAM3よりも高速動作が可能な小容量のキャッシュメモリである。この命令キャッシュメモリ5は、SDRAM3から読み出された8ステップ分の命令(プログラムコード)と、当該命令のSDRAM3における格納領域のアドレスと、valid/writeビットとを格納する領域をそれぞれ有している。valid/writeビットは、命令キャッシュメモリ5に有効な命令が格納されているときに“1”となり、命令キャッシュメモリ5に有効な命令が格納されていないとき(命令の書き込み可能な状態であるとき)に“0”となる。また、命令キャッシュメモリ5は、分岐命令識別信号BranchSigが“1”であり、かつヒットしなかったときに、SDRAM3から読み出されてプリフェッチバッファ6に書き込まれた命令と同じ命令が書き込まれる。
The instruction cache memory 5 is a small-capacity cache memory that can operate at a higher speed than the SDRAM 3. The instruction cache memory 5 has an area for storing an instruction (program code) for 8 steps read from the SDRAM 3, an address of a storage area of the instruction in the SDRAM 3, and a valid / write bit. . The valid / write bit is “1” when a valid instruction is stored in the instruction cache memory 5, and when a valid instruction is not stored in the instruction cache memory 5 (when the instruction is writable). ) Becomes “0”. The instruction cache memory 5 is written with the same instruction as the instruction read from the SDRAM 3 and written to the
プリフェッチバッファ6は、命令キャッシュメモリ5にプリフェッチするためのバッファメモリであり、例えばFIFO(First In First Out)メモリによって構成されている。このプリフェッチバッファ6は、分岐命令識別信号BranchSigが“1”であり、かつ命令キャッシュメモリ5がヒットしたときに、SDRAM3から読み出された命令が書き込まれる。
The
セレクタ8は、ヒット判別信号Hitが“0”であるときに、入力端子Aから入力されるプリフェッチバッファ6から読み出された命令を出力端子YからCPU2へ出力する。また、セレクタ8は、ヒット判別信号Hitが“1”であるときに、入力端子Bから入力される命令キャッシュメモリ5から読み出された命令を出力端子YからCPU2へ出力する。ヒット判別信号Hitは、命令キャッシュメモリ5がヒットしたか否かを示す信号であり、ヒットしたときに“1”となり、ヒットしなかったときに“0”となる。
The
コンパレータ7は、CPUコア2aから出力される前述の飛び先アドレスJumpAddを命令キャッシュメモリ5に格納されている全てのアドレスと比較するとともに、CPUコア2aから出力される前述の分岐命令識別信号BranchSigを命令キャッシュメモリ5に格納されているvalid/writeビットと比較する。コンパレータ7は、その比較の結果として、両アドレスが一致し、かつ分岐命令識別信号BranchSigとvalid/writeビットとがともに“1”であるときに、“1”のヒット判別信号Hitを出力し、それ以外の場合は“0”のヒット判別信号Hitを出力する。
The
8進カウンタ9は、命令キャッシュメモリ5に命令が8ステップ分書き込まれたことを検知するために設けられている。この8進カウンタ9は、命令キャッシュメモリ5から命令が1ステップ書き込まれる毎に出力されるパルスをカウントし、パルスを8個カウントすると、カウントアップ信号(“1”)を出力するとともに自身をリセットする。 The octal counter 9 is provided to detect that instructions are written in the instruction cache memory 5 for 8 steps. The octal counter 9 counts a pulse output every time an instruction is written from the instruction cache memory 5 and outputs a count-up signal ("1") and resets itself when counting eight pulses. To do.
RSフリップフロップ10は、CPUコア2aから出力される分岐命令識別信号BranchSigが“0”から“1”に変化するときにセットして、出力端子Qの値を“0”から“1”に変化させる。また、RSフリップフロップ10は、8進カウンタ9から出力されるカウントアップ信号が“0”から“1”に変化するときにリセットして、出力端子Qの値を“1”から“0”に変化させる。これにより、命令キャッシュメモリ5がヒットしたときに、命令が読み出されて命令キャッシュメモリ5における8ステップ分の命令が全て書き替えられるまでに分岐命令識別信号BranchSigの値を保持するとともに、命令の書き替えが終わると、次の新たな分岐命令識別信号BranchSigが出力されるまで、コンパレータ7への入力を“0”にする。
The RS flip-
ANDゲート11は、ヒット判別信号Hitの反転信号と、RSフリップフロップ10からの出力との論理積を出力する。この論理積は、CPUコア2aにウエイト信号waitとして入力される。CPUコア2aは、“1”のウエイト信号waitが入力されると、待機(ウエイト)状態となり、パイプライン処理を停止する一方、“0”のウエイト信号waitが入力されると、動作してパイプライン処理を行う。
The AND
ANDゲート12は、コンパレータ7からのヒット判別信号Hitと「8」を示すデータとの論理積を出力する。これにより、ヒット判別信号Hitが“1”であるとき(ヒットしたとき)、入力データがそのまま出力される一方、ヒット判別信号Hitが“0”であるとき(ヒットしなかったとき)、入力データが出力されない。
The AND
加算器13は、飛び先アドレスJumpAddとANDゲート12からの出力データとを加算してDRAMコントローラ4に出力する。
The
続いて、上記のように構成されるCPUシステム1の動作について説明する。 Next, the operation of the CPU system 1 configured as described above will be described.
まず、CPUコア2aが分岐命令以外の演算命令を処理するとき、バーストリード動作によってSDRAM3より読み出された命令は、一旦、プリフェッチバッファ6に蓄えられてから、セレクタ8を介してCPU2に与えられる。
First, when the
SDRAM3から読み出された命令(非分岐命令)がCPU2において連続的に順次処理されるときには、当該命令がSDRAM3のバーストリード動作によって連続的に読み出されて、プリフェッチバッファ6を介してCPU2に読み込まれる。これにより、ウエイトなしでCPU2が命令を読み込むことができる。したがって、この場合は、命令キャッシュメモリ5から命令を読み出す必要がない。
When instructions (non-branch instructions) read from the SDRAM 3 are sequentially processed sequentially by the
このとき、RSフリップフロップ10がリセットされている状態であるので、コンパレータ7においては、RSフリップフロップ10の出力“0”とのvalid/writeビット(“1”)とが一致しないと判断され、また、CPUコア2aから飛び先アドレスJumpAddも出力されないことから、コンパレータ7から出力されるヒット判別信号Hitは“0”となる。
At this time, since the RS flip-
これにより、セレクタ8は、プリフェッチバッファ6とCPU2とを接続する。また、Sフリップフロップ10の出力が“0”であるので、ウエイト信号waitも“0”となる。また、このとき、CPUコア2aから出力される分岐命令識別信号BranchSigは“0”である。
Thereby, the
図2に示すように、CPUコア2aが、プリフェッチバッファ6から得た分岐命令BR50を処理するとき、分岐命令識別信号BranchSigが“1”となるので、RSフリップフロップ10がセットされることにより“1”を出力する。また、飛び先アドレスJumpAddがCPUコア2aから出力される。また、このとき、CPUコア2aは、分岐命令BR50に続く命令の処理を中断して、パイプライン処理を停止する。
As shown in FIG. 2, when the
パイプライン停止までに至る動作は、具体的には図3に示すように進行する。まず、ステージ1において時間T1で分岐命令BR50が読み込まれ(フェッチされ)、続くステージ2では、時間T1でアドレス計算命令Addが読み込まれ、時間T2で分岐命令BR50がデコードされる。さらに、ステージ3では、時間T1でロード命令LDが読み込まれ、時間T2でアドレス計算命令Addがデコードされ、時間T3で分岐命令BR50が実行される。これにより、CPUコア2aは、パイプライン処理を停止するとともに、分岐命令識別信号BranchSigを“0”から“1”に変化させる。
Specifically, the operation up to the pipeline stop proceeds as shown in FIG. First, in stage 1, branch instruction BR50 is read (fetched) at time T1, and in
このように、パイプライン処理により、分岐命令BR50がCPUコア2aに読み込まれてから、分岐命令識別信号BranchSigの値が上記のように変わるまで時間のずれが生じる。また、条件付きの分岐命令もあり、このような分岐命令では条件によってはジャンプしない場合もある。
As described above, a time lag occurs after the branch instruction BR50 is read into the
一方、コンパレータ7は、飛び先アドレスJumpAddと命令キャッシュメモリ5に登録されているアドレスとを比較するとともに、RSフリップフロップ10の出力とvalid/writeビットとを比較する。RSフリップフロップ10の出力とvalid/writeビットとがともに“1”であるとき、飛び先アドレスJumpAddと同じアドレスが命令キャッシュメモリ5に登録されていれば、図2に示すように、コンパレータ7から出力されるヒット判別信号Hitは“1”となり、ヒットする。
On the other hand, the
これにより、セレクタ8が命令キャッシュメモリ5とCPU2とを接続する。したがって、命令キャッシュメモリ5から読み出された飛び先アドレスJumpAddにより指定される分岐先の命令SUBとそれに続く7ステップ分の命令が順次読み出され、CPU2に与えられる。
Thereby, the
命令キャッシュメモリ5から8ステップ分の命令が読み出されると、それに続く新たな命令が必要となる。このため、上記のように命令が命令キャッシュメモリ5から読み出されているときに、加算器13によって、飛び先アドレスJumpAddと、ANDゲート12を介して出力された「8」のデータとが加算され、その結果のアドレス(飛び先アドレスJumpAddから8個後のアドレス)がDRAMコントローラ4に与えられる。DRAMコントローラ4は、そのアドレスに基づいて、SDRAM3から命令を順次読み出していく。読み出された命令は、プリフェッチバッファ6に一旦蓄えられて、CPU2への読み出しのために待機する。
When an instruction for 8 steps is read from the instruction cache memory 5, a new instruction following it is required. For this reason, when the instruction is read from the instruction cache memory 5 as described above, the
このとき、すなわちヒット判別信号Hitが“1”であるとき(ヒットしたとき)は、後述するヒットしなかったときのようにヒットさせるための分岐先の命令を命令キャッシュメモリ5に読み込む必要がない。したがって、命令キャッシュメモリ5には、SDRAM3から読み出された命令が書き込まれない。 At this time, that is, when the hit determination signal Hit is “1” (when hit), it is not necessary to read into the instruction cache memory 5 a branch destination instruction for hitting, as in the case of no hit as will be described later. . Therefore, the instruction read from the SDRAM 3 is not written in the instruction cache memory 5.
前述のコンパレータ7の比較において、飛び先アドレスJumpAddと同じアドレスが命令キャッシュメモリ5に登録されていなければ、コンパレータ7から出力されるヒット判別信号Hitは“0”となり、ヒットしない。このとき、ANDゲート11から出力されるウエイト信号waitが“1”となるので、CPU2がウエイト状態となる。また、飛び先アドレスJumpAddは、命令キャッシュメモリ5に格納されて登録されるとともに、そのまま加算器13を介してDRAMコントローラ4に出力される。
In the comparison of the
DRAMコントローラ4は、その飛び先アドレスJumpAddに基づいて、SDRAM3から分岐先の命令とそれに続く命令とを順次読み出していく。読み出された命令は、プリフェッチバッファ6に一旦蓄えられて、CPU2への読み出しのために待機する。また、このとき、ヒット判別信号Hitが“0”であるので、ヒットさせるための分岐先の命令を命令キャッシュメモリ5に読み込む必要がある。したがって、命令キャッシュメモリ5にも、SDRAM3から読み出された命令が書き込まれる。
Based on the jump destination address JumpAdd, the DRAM controller 4 sequentially reads the branch destination instruction and the subsequent instruction from the SDRAM 3. The read instruction is temporarily stored in the
この結果、コンパレータ7による比較で、飛び先アドレスJumpAddと命令キャッシュメモリ5に登録されているアドレスとが一致するので、ヒット判別信号Hitが“1”となる。したがって、この場合は、命令キャッシュメモリ5から、新たに書き込まれた分岐先の命令とそれに続く命令が読み出され、セレクタ8を介してCPU2に与えられる。このとき、ウエイト信号waitが“1”となっていることから、CPU2は、入力された命令を処理していく。
As a result, in the comparison by the
このように、本実施の形態のCPUシステム1は、CPU2の動作速度がSDRAM3のバーストリード時の動作速度以下という条件で動作し、CPU2が分岐命令を処理するときに、命令キャッシュメモリ5に分岐先の命令が格納されていれば、当該命令を命令キャッシュメモリ5から読み出す。これにより、CPU2が分岐命令を処理するときに、SDRAM3において、不連続なアドレスをアクセスして命令を読み出す動作が不要となるので、CPU2内の処理(パイプライン処理)も含めた処理の連続性を維持することができる。また、上記のように命令キャッシュメモリ5がヒットしているとき、SDRAM3に対しては、RASやCASの処理を行う必要がなく、CPU2の動作にウエイトが生じない。
As described above, the CPU system 1 according to the present embodiment operates under the condition that the operation speed of the
また、CPUシステム1においては、命令キャッシュメモリ5が分岐先の命令とそれに続く命令の8ステップ分の命令を格納するので、程度まとまったメモリブロック(128バイト単位)を格納する一般の命令キャッシュメモリのように大きい容量を必要としない。 Further, in the CPU system 1, since the instruction cache memory 5 stores instructions for 8 steps of the branch destination instruction and the subsequent instruction, a general instruction cache memory for storing a memory block (128-byte unit) in a certain degree. Does not require a large capacity.
本発明は、上述した実施形態に限定されるものではなく、請求項に示した範囲で種々の変更が可能である。すなわち、請求項に示した範囲で適宜変更した技術的手段を組み合わせて得られる実施形態についても本発明の技術的範囲に含まれる。 The present invention is not limited to the above-described embodiments, and various modifications can be made within the scope shown in the claims. That is, embodiments obtained by combining technical means appropriately modified within the scope of the claims are also included in the technical scope of the present invention.
本発明のCPUシステムは、CPUが分岐命令を処理するときに、命令キャッシュメモリに分岐先の命令が格納されていれば、当該命令を命令キャッシュメモリから読み出すことにより、処理の連続性をより高めることができるので、セミカスタムASICによって作製されるマイクロコンピュータなどのシステムに好適に利用できる。 In the CPU system of the present invention, when the CPU processes a branch instruction, if the instruction at the branch destination is stored in the instruction cache memory, the instruction is read from the instruction cache memory, thereby further improving the continuity of processing. Therefore, it can be suitably used for a system such as a microcomputer manufactured by a semi-custom ASIC.
1 CPUシステム
2 CPU
2a CPUコア
3 SDRAM(高速DRAM)
4 DRAMコントローラ
5 命令キャッシュメモリ
6 プリフェッチバッファ
7 コンパレータ
8 セレクタ
9 8進カウンタ
10 RSフリップフロップ
11,12 ANDゲート
13 加算器
1
2a CPU core 3 SDRAM (high-speed DRAM)
4 DRAM controller 5
Claims (2)
前記プログラムにおける分岐命令が指定する分岐先の分岐先命令を少なくとも格納するとともに、当該命令を前記高速DRAMにおいて指定するアドレスを格納する命令キャッシュメモリと、
当該命令キャッシュメモリから読み出された前記プログラムの命令を処理し、バーストリード動作時の前記高速DRAMの動作速度以下の動作速度で動作するCPUと、
当該CPUが前記高速DRAMから読み出された前記分岐命令を処理したときに、当該分岐命令が指定する前記分岐先命令が前記命令キャッシュメモリに格納されているか否かを判定する判定手段と、
前記分岐先命令が前記命令キャッシュメモリに格納されていると判定されると、前記命令キャッシュメモリから読み出された分岐先命令を前記CPUに出力する命令出力手段とを備えていることを特徴とするCPUシステム。 A high-speed DRAM that stores a program and is capable of burst read operation;
An instruction cache memory that stores at least a branch destination instruction specified by a branch instruction in the program and stores an address that specifies the instruction in the high-speed DRAM;
A CPU that processes an instruction of the program read from the instruction cache memory and operates at an operation speed equal to or lower than an operation speed of the high-speed DRAM during a burst read operation;
Determining means for determining whether or not the branch destination instruction designated by the branch instruction is stored in the instruction cache memory when the CPU processes the branch instruction read from the high-speed DRAM;
When it is determined that the branch destination instruction is stored in the instruction cache memory, an instruction output unit that outputs the branch destination instruction read from the instruction cache memory to the CPU is provided. CPU system.
CPUシステムは、前記分岐先命令が前記命令キャッシュメモリに格納されていないと判定されると、前記高速DRAMから前記アドレスに基づいて前記分岐先命令を読み出す読出制御手段を備え、
前記命令キャッシュメモリは、前記高速DRAMから読み出された前記分岐先命令を格納することを特徴とする請求項1に記載のCPUシステム。 The CPU outputs an address designating the branch instruction;
The CPU system includes a read control unit that reads the branch destination instruction from the high-speed DRAM based on the address when it is determined that the branch destination instruction is not stored in the instruction cache memory.
The CPU system according to claim 1, wherein the instruction cache memory stores the branch destination instruction read from the high-speed DRAM.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006228362A JP2008052518A (en) | 2006-08-24 | 2006-08-24 | Cpu system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006228362A JP2008052518A (en) | 2006-08-24 | 2006-08-24 | Cpu system |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2008052518A true JP2008052518A (en) | 2008-03-06 |
Family
ID=39236518
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2006228362A Pending JP2008052518A (en) | 2006-08-24 | 2006-08-24 | Cpu system |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2008052518A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7774535B2 (en) | 2008-06-19 | 2010-08-10 | Kabushiki Kaisha Toshiba | Memory system and memory device |
WO2013121516A1 (en) | 2012-02-14 | 2013-08-22 | ルネサスエレクトロニクス株式会社 | Data processing device |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001142698A (en) * | 1999-11-12 | 2001-05-25 | Mitsubishi Electric Corp | Memory access system |
JP2005018553A (en) * | 2003-06-27 | 2005-01-20 | Fujitsu Ltd | Memory interface circuit |
-
2006
- 2006-08-24 JP JP2006228362A patent/JP2008052518A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001142698A (en) * | 1999-11-12 | 2001-05-25 | Mitsubishi Electric Corp | Memory access system |
JP2005018553A (en) * | 2003-06-27 | 2005-01-20 | Fujitsu Ltd | Memory interface circuit |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7774535B2 (en) | 2008-06-19 | 2010-08-10 | Kabushiki Kaisha Toshiba | Memory system and memory device |
WO2013121516A1 (en) | 2012-02-14 | 2013-08-22 | ルネサスエレクトロニクス株式会社 | Data processing device |
US9542190B2 (en) | 2012-02-14 | 2017-01-10 | Renesas Electronics Corporation | Processor with fetch control for stoppage |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8954681B1 (en) | Multi-stage command processing pipeline and method for shared cache access | |
US9146867B2 (en) | Methods and apparatus to access memory using runtime characteristics | |
JPWO2007013491A1 (en) | Memory control method and memory system | |
US20080098176A1 (en) | Method and Apparatus for Implementing Memory Accesses Using Open Page Mode for Data Prefetching | |
JP2011060162A (en) | Memory control device | |
JP4085983B2 (en) | Information processing apparatus and memory access method | |
JP2010146084A (en) | Data processor including cache memory control section | |
US5761718A (en) | Conditional data pre-fetching in a device controller | |
CN106649143B (en) | Cache access method and device and electronic equipment | |
JP2008052518A (en) | Cpu system | |
US20050182868A1 (en) | Apparatus and method for controlling memory | |
US7007137B2 (en) | Method and architecture capable of accessing data and instructions using store and forward | |
JPH0695875A (en) | Memory access method for microcomputer | |
TWI657450B (en) | Read method applied to nand flash | |
US20080082806A1 (en) | Cache controller, microprocessor system, and storage device | |
US9037806B2 (en) | Reducing store operation busy times | |
US9047199B2 (en) | Reducing penalties for cache accessing operations | |
JP2851777B2 (en) | Bus control method and information processing device | |
JP2008299790A (en) | Microprocessor | |
CN116700794A (en) | Method and system for acquiring instruction to be executed | |
JP2008090411A (en) | Information processor, instruction control mechanism and instruction control method | |
JP3729832B2 (en) | Cache memory device | |
JP3956698B2 (en) | Memory control device | |
US20040103267A1 (en) | Data processor having cache memory | |
KR100300875B1 (en) | How to deal with cache misses |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20081111 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20110104 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20110118 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20110712 |