JP2007188137A - Microprocessor - Google Patents

Microprocessor Download PDF

Info

Publication number
JP2007188137A
JP2007188137A JP2006003438A JP2006003438A JP2007188137A JP 2007188137 A JP2007188137 A JP 2007188137A JP 2006003438 A JP2006003438 A JP 2006003438A JP 2006003438 A JP2006003438 A JP 2006003438A JP 2007188137 A JP2007188137 A JP 2007188137A
Authority
JP
Japan
Prior art keywords
wait
cpu
prefetch
upper limit
limit value
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.)
Withdrawn
Application number
JP2006003438A
Other languages
Japanese (ja)
Inventor
Susumu Jino
進 地濃
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.)
Toshiba Corp
Kioxia Systems Co Ltd
Original Assignee
Toshiba Corp
Toshiba Memory Systems Co Ltd
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 Toshiba Corp, Toshiba Memory Systems Co Ltd filed Critical Toshiba Corp
Priority to JP2006003438A priority Critical patent/JP2007188137A/en
Publication of JP2007188137A publication Critical patent/JP2007188137A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Advance Control (AREA)
  • Executing Machine-Instructions (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To achieve a microprocessor for performing prefetch control which is optimal to the configurations of a memory or input/output device unique to a system. <P>SOLUTION: This microprocessor is provided with a wait number setting register 17 and an address decoder 15 for generating a wait number 16 necessary for a CPU 11 to read data or an instruction code, a wait upper limit value setting register 19 for storing a wait upper limit value 18 showing the upper limit of the wait number 16 permitting the prefetch of the CPU 11 and a determination circuit 20 for comparing and determining the wait number 16 from the wait number setting register 17 and the wait upper limit value 18 from the wait upper limit value setting register 19, and for outputting a prefetch inhibition signal 13 for stopping the prefetch function of the CPU 11 based on the determination result. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は、命令コードもしくはデータの先読み機能を有するマイクロプロセッサに関する。   The present invention relates to a microprocessor having an instruction code or data prefetching function.

近年、マイクロプロセッサの高速化はめざましく、主記憶装置として使用される外部メモリとマイクロプロセッサとの動作周波数の差は広がる傾向にある。このため、外部メモリへのアクセスがマイクロプロセッサの性能に大きな影響を与えないようキャッシュメモリを内蔵もしくは付加する機構を備え、命令コードおよびデータをキャッシュメモリに先読み(プリフェッチ)する機能を有したマイクロプロセッサが主流になっている。しかし、こうしたマイクロプロセッサでは、キャッシュメモリにプリフェッチされていない命令またはデータへのアクセス(キャッシュミスヒット)が発生すると、キャッシュメモリの書き換え(リロード)が必要となるため、場合によっては、処理性能が大幅に低下する。このようなキャッシュミスヒットは、ジャンプ命令やサブルーチンコール命令などで発生する確率が高く、このため、これらの命令をあらかじめ検出してキャッシュメモリへのプリフェッチを制御する方法(例えば、「特許文献1」および「特許文献2」を参照。)が開発されている。   In recent years, the speed of microprocessors has been remarkably increased, and the difference in operating frequency between an external memory used as a main storage device and the microprocessor tends to widen. Therefore, a microprocessor having a mechanism for incorporating or adding a cache memory so that access to the external memory does not greatly affect the performance of the microprocessor, and having a function of prefetching instruction codes and data into the cache memory. Has become mainstream. However, in such a microprocessor, when an instruction or data that has not been prefetched to the cache memory (cache miss hit) occurs, the cache memory needs to be rewritten (reloaded). To drop. Such a cache miss hit has a high probability of occurring in a jump instruction, a subroutine call instruction, or the like. For this reason, a method of detecting these instructions in advance and controlling prefetch to the cache memory (for example, “Patent Document 1”). And “Patent Document 2”) have been developed.

一方、マイクロプロセッサは、ソフトウェアのバージョンアップにより機能追加などに柔軟に対応できるので、ゲーム機や家電製品から通信装置や情報処理装置に至るまであらゆる機器のコントローラとして採用されるようになっている。このため、このような応用では、マイクロプロセッサが実装されるシステムにおいて、主記憶装置をはじめとするメモリ構成やメモリ空間に割り付けられる入出力装置の構成をあらかじめ想定しておくことは非常に困難であるという問題があった。例えば、メモリ空間内に主記憶とは別にEEPROMなどのウェイトサイクル数が多い低速な外部メモリが割り付けられた場合に、EEPROMにアクセスする時だけプリフェッチ機能を選択的に停止するなどの制御が望ましい。しかし、このような構成は、特定のユーザ仕様に基づくシステム固有のものであり、EEPROMが割り付けられるアドレスもあらかじめ固定されているとは限らない。したがって、従来のマイクロプロセッサでこれに対応するためには外部に特別な制御機構をシステムごとに用意する必要があった。   On the other hand, since microprocessors can flexibly cope with function additions by software upgrades, they have been adopted as controllers for all devices ranging from game machines and home appliances to communication devices and information processing devices. Therefore, in such an application, it is very difficult to assume in advance a memory configuration including a main storage device and a configuration of an input / output device allocated to a memory space in a system in which a microprocessor is mounted. There was a problem that there was. For example, when a low-speed external memory having a large number of wait cycles, such as an EEPROM, is allocated in the memory space in addition to the main memory, control such as selectively stopping the prefetch function only when accessing the EEPROM is desirable. However, such a configuration is unique to the system based on a specific user specification, and the address to which the EEPROM is allocated is not always fixed in advance. Therefore, in order to cope with the conventional microprocessor, it is necessary to prepare a special control mechanism for each system.

すなわち、命令コードもしくはデータの先読み機能を有する従来のマイクロプロセッサには、それが実装されるシステム固有のメモリ構成や入出力装置の構成に最適なプリフェッチ制御を行えないという問題があった。
特開2001−273137号公報 特開平5−27972号公報
That is, the conventional microprocessor having the function of pre-reading the instruction code or data has a problem that prefetch control that is optimum for the system-specific memory configuration and input / output device configuration in which it is mounted cannot be performed.
JP 2001-273137 A JP-A-5-27972

本発明は、システム固有のメモリ構成や入出力装置の構成に最適なプリフェッチ制御を行うことができるマイクロプロセッサを提供する。   The present invention provides a microprocessor capable of performing prefetch control optimal for a system-specific memory configuration and input / output device configuration.

本発明の一態様によれば、CPUがデータまたは命令コードを読み出すために必要なウェイトサイクル数を生成するウェイト数生成手段と、前記CPUのプリフェッチを許す前記ウェイトサイクル数の上限を示すウェイト上限値を保持する保持手段と、前記ウェイト数生成手段からの前記ウェイトサイクル数および前記保持手段からの前記ウェイト上限値を比較判定し、当該判定結果に基づいて前記CPUのプリフェッチ機能を停止させるプリフェッチ禁止信号を出力する判定手段を有することを特徴とするマイクロプロセッサが提供される。   According to one aspect of the present invention, wait number generation means for generating the number of wait cycles necessary for the CPU to read data or instruction code, and a weight upper limit value indicating the upper limit of the number of wait cycles that allow the CPU to prefetch A prefetch prohibition signal for comparing and determining the number of wait cycles from the wait number generation unit and the upper limit value of the wait from the holding unit, and stopping the prefetch function of the CPU based on the determination result There is provided a microprocessor characterized by having a judging means for outputting.

本発明によれば、システム固有の多様なメモリ構成および入出力装置の構成に柔軟に対応してプリフェッチ機能を制御することができる。   According to the present invention, the prefetch function can be controlled flexibly corresponding to various memory configurations and input / output device configurations unique to the system.

以下、図面を参照しながら、本発明の実施例を説明する。   Embodiments of the present invention will be described below with reference to the drawings.

図1は、本発明の実施例1に係わるマイクロプロセッサを示す回路ブロック図である。ここでは、主に、キャッシュメモリに命令コードおよびデータを先読みする機能(以下、「プリフェッチ機能」という。)の制御にかかわる部分を示した。   FIG. 1 is a circuit block diagram showing a microprocessor according to Embodiment 1 of the present invention. Here, the part mainly related to the control of the function of prefetching the instruction code and data into the cache memory (hereinafter referred to as “prefetch function”) is shown.

本発明の実施例1に係わるマイクロプロセッサは、命令コードに基づいて処理を行う中央演算処理装置11(以下、「CPU11」という。)、次に読み出す命令コードまたはデータのアドレスがCPU11から出力されるアドレスバス12、およびアドレスバス12上のアドレスに基づいてCPU11のプリフェッチ機能を制御するためのプリフェッチ禁止信号13を生成するプリフェッチ制御部14を備えている。   The microprocessor according to the first embodiment of the present invention outputs from the CPU 11 a central processing unit 11 (hereinafter referred to as “CPU 11”) that performs processing based on an instruction code, and an instruction code or data address to be read next. An address bus 12 and a prefetch control unit 14 that generates a prefetch inhibition signal 13 for controlling the prefetch function of the CPU 11 based on the address on the address bus 12 are provided.

CPU11の入力にはプリフェッチ制御部14からのプリフェッチ禁止信号13が入力され、CPU11のアドレス出力はアドレスバス12に接続され、プリフェッチ制御部14の入力にはアドレスバス12が接続されている。   A prefetch prohibiting signal 13 from the prefetch control unit 14 is input to the input of the CPU 11, an address output of the CPU 11 is connected to the address bus 12, and an address bus 12 is connected to the input of the prefetch control unit 14.

CPU11は、外部メモリ(図示していない。)から読み込んだ命令コードを解釈し、その結果に基づいて、その命令コードの実行に必要なデータのアドレスまたは次に実行する命令コードのアドレスをアドレスバス12へ出力する。   The CPU 11 interprets the instruction code read from the external memory (not shown), and based on the result, the address of the data necessary for executing the instruction code or the address of the instruction code to be executed next is sent to the address bus. 12 is output.

これらのアドレスは、次にCPU11が読み込むべき命令コードまたはデータのアドレスであり、そのアドレスがすでにプリフェッチされているアドレス範囲からはずれる場合(一般に「キャッシュミスヒット」と呼ばれる。)には、プリフェッチ制御部14がプリフェッチ禁止信号13を出力している場合を除いて、CPU11は、プログラム実行の継続を一時中断してそのアドレスが属する一連の命令コードまたはデータをデータバス(図示していない。)を介してキャッシュメモリへプリフェッチ(先読み)するよう動作する。   These addresses are the addresses of instruction codes or data to be read next by the CPU 11, and when the addresses deviate from the prefetched address range (generally referred to as “cache miss hit”), the prefetch control unit. Except for the case where 14 outputs the prefetch prohibition signal 13, the CPU 11 suspends continuation of program execution and sends a series of instruction codes or data to which the address belongs via a data bus (not shown). And prefetch (read ahead) to the cache memory.

一方、プリフェッチ禁止信号13が出力されている場合は、CPU11は、上述したプリフェッチ動作を行わず、逐次動作を行う。すなわち、CPU11は、外部メモリからの命令コードまたはデータがデータバスを介して読み込み可能になるまで待機(ウェイト)する。   On the other hand, when the prefetch prohibition signal 13 is output, the CPU 11 performs the sequential operation without performing the above-described prefetch operation. That is, the CPU 11 waits (waits) until the instruction code or data from the external memory can be read via the data bus.

プリフェッチ制御部14は、図1に示したように、アドレスをデコードするアドレスデコーダ15、メモリ空間ごとのウェイトサイクル数16(以下、「ウェイト数16」という。)を保持するウェイト数設定レジスタ17、ウェイト数16の上限値(以下、「ウェイト上限値18」という。)を保持するウェイト上限値設定レジスタ19、およびウェイト数16とウェイト上限値18を比較判定する判定回路20を備えている。   As shown in FIG. 1, the prefetch control unit 14 includes an address decoder 15 that decodes addresses, a wait number setting register 17 that holds 16 wait cycles for each memory space (hereinafter referred to as “wait number 16”), A weight upper limit value setting register 19 that holds an upper limit value of the number of waits 16 (hereinafter referred to as “weight upper limit value 18”) and a determination circuit 20 that compares and determines the number of waits 16 and the weight upper limit value 18 are provided.

アドレスデコーダ15の入力にはアドレスバス12が接続され、アドレスデコーダ15の出力はウェイト数設定レジスタ17の入力に供給されている。ウェイト数設定レジスタ17の出力はウェイト数16として判定回路20の第1の入力に供給され、ウェイト上限値設定レジスタ19の出力はウェイト上限値18として判定回路20の第2の入力に供給され、判定回路20の出力はプリフェッチ禁止信号13としてCPU11の入力に供給されている。   The address bus 12 is connected to the input of the address decoder 15, and the output of the address decoder 15 is supplied to the input of the wait number setting register 17. The output of the wait number setting register 17 is supplied to the first input of the determination circuit 20 as the number of waits 16, and the output of the weight upper limit value setting register 19 is supplied to the second input of the determination circuit 20 as the weight upper limit value 18. The output of the determination circuit 20 is supplied to the input of the CPU 11 as a prefetch prohibiting signal 13.

アドレスデコーダ15はFPGAで構成され、アドレスバス12上のアドレスとウェイト数設定レジスタ17との対応付けを行う。すなわち、アドレスデコーダ15は、あらかじめ設定されている対応付けに従って、そのアドレスに対応する選択信号をウェイト数設定レジスタ17へ出力する。   The address decoder 15 is composed of an FPGA, and associates the address on the address bus 12 with the wait number setting register 17. That is, the address decoder 15 outputs a selection signal corresponding to the address to the wait number setting register 17 in accordance with the association set in advance.

具体的な対応付けの一例は図2を用いて後述するが、これらは、電源投入時またはシステムリセット時に、CPU11がシステムプログラムに従ってFPGAを初期化することで設定される。   An example of specific association will be described later with reference to FIG. 2. These are set when the CPU 11 initializes the FPGA according to the system program when the power is turned on or the system is reset.

ウェイト数16は、メモリ空間に実装される外部メモリまたは入出力装置の性能によって規定され、図2を用いて後述するように、分割されたメモリ空間ごとに設定される。   The number of waits 16 is defined by the performance of the external memory or input / output device mounted in the memory space, and is set for each divided memory space, as will be described later with reference to FIG.

ウェイト数設定レジスタ17は、ウェイト数16を保持する複数のレジスタで構成され、アドレスデコーダ15からの選択信号によってアドレスバス12上のアドレスに対応したウェイト数16を判定回路へ選択的に出力する。   The wait number setting register 17 is composed of a plurality of registers that hold the wait number 16, and selectively outputs the wait number 16 corresponding to the address on the address bus 12 to the determination circuit in response to a selection signal from the address decoder 15.

ウェイト数設定レジスタ17が保持するそれぞれのウェイト数16は、電源投入時またはシステムリセット時に、システムプログラムに従ってCPU11によって設定される。   Each wait number 16 held by the wait number setting register 17 is set by the CPU 11 according to the system program at power-on or system reset.

ウェイト上限値18はCPU11のプリフェッチ動作の停止を判定する基準値で、判定回路20は、この値に基づいて、外部メモリまたは入出力装置の性能に基づいたウェイト数設定レジスタ17からのウェイト数16を判定する。   The weight upper limit value 18 is a reference value for determining the stop of the prefetch operation of the CPU 11, and the determination circuit 20 determines the number of waits 16 from the wait number setting register 17 based on the performance of the external memory or the input / output device based on this value. Determine.

ウェイト上限値設定レジスタ19はウェイト上限値を保持するレジスタで、この値は、電源投入時またはシステムリセット時に、システムプログラムに従ってCPU11によって設定される。   The wait upper limit value setting register 19 is a register that holds a wait upper limit value, and this value is set by the CPU 11 according to the system program at power-on or system reset.

判定回路20は、ウェイト数設定レジスタ17からのウェイト数16とウェイト上限値設定レジスタ19からのウェイト上限値18とを比較し、ウェイト数16がウェイト上限値18を超えている場合にプリフェッチ禁止信号13を生成しCPU11へ出力する。   The determination circuit 20 compares the number of waits 16 from the wait number setting register 17 with the weight upper limit value 18 from the weight upper limit value setting register 19, and when the number of waits 16 exceeds the weight upper limit value 18, the prefetch prohibition signal 13 is generated and output to the CPU 11.

図2は、本発明の実施例1に係わるマイクロプロセッサにおける設定情報の一例を示すテーブルである。
本発明の実施例1に係わるマイクロプロセッサにおける設定情報は、分割されたメモリ空間を識別するメモリ空間番号、メモリ空間番号に対応するアドレス範囲、メモリ空間番号に対応するウェイト数16、およびウェイト上限値18を備えている。
FIG. 2 is a table showing an example of setting information in the microprocessor according to the first embodiment of the present invention.
The setting information in the microprocessor according to the first embodiment of the present invention includes a memory space number for identifying the divided memory space, an address range corresponding to the memory space number, a weight number 16 corresponding to the memory space number, and a weight upper limit value. 18 is provided.

CPU11のメモリ空間は、メモリ空間に割り付けられた外部メモリおよび入出力装置の種類や性能ごとに分割され、それぞれを識別するためにメモリ空間番号が付与されている。   The memory space of the CPU 11 is divided according to the type and performance of the external memory and input / output device allocated to the memory space, and a memory space number is assigned to identify each.

アドレス範囲は、外部メモリまたは入出力装置ごとに一連のアドレスが割り付けられる。例えば、図2に示したように、メモリ空間番号“1”にはアドレス範囲“0〜0FFFF番地”が対応し、メモリ空間番号“2”にはアドレス範囲“10000〜1FFFF番地”が対応し、メモリ空間番号“3”にはアドレス範囲“1FFFF〜2FFFF番地”が対応している。   In the address range, a series of addresses are assigned to each external memory or input / output device. For example, as illustrated in FIG. 2, the memory space number “1” corresponds to the address range “0 to 0FFFF”, the memory space number “2” corresponds to the address range “10000 to 1FFFF”, The memory space number “3” corresponds to the address range “addresses 1FFFF to 2FFFF”.

ウェイト数16は、それぞれのアドレス範囲に割り付けられた外部メモリまたは入出力装置の性能によって規定され、具体的には、CPU11がデータを読み込むためにリード信号を出力してから実際にそのデータをデータバスから読み込むことができるまでの待機時間をシステムクロック数で示したものである。   The number of waits 16 is defined by the performance of the external memory or input / output device assigned to each address range. Specifically, after the CPU 11 outputs a read signal to read data, the data is actually transferred to the data. The waiting time until the data can be read from the bus is indicated by the number of system clocks.

例えば、図2に示したように、メモリ空間番号“1”ではウェイト数16は“0”であり、メモリ空間番号“2”ではウェイト数16は“5”であり、メモリ空間番号“3”ではウェイト数16は“20”となっている。   For example, as shown in FIG. 2, when the memory space number is “1”, the number of waits is “0”, and when the memory space number is “2”, the number of waits is 16 and the memory space number is “3”. The number of waits 16 is “20”.

これらは、それぞれ、SRAMなどの高速な主記憶、DRAMなどの低速な主記憶、およびEEPROMなどの2次記憶を想定して設定されたウェイト数16である。   These are the number of waits 16 set assuming high-speed main memory such as SRAM, low-speed main memory such as DRAM, and secondary storage such as EEPROM.

ウェイト上限値18は、図2では“8”に設定されている。これは、メモリ空間番号“1”および“2”の主記憶に対しては、CPU11のプリフェッチ動作を許可し、メモリ空間番号“3”の2次記憶に対しては、CPU11のプリフェッチ動作を停止させることを意味している。   The weight upper limit value 18 is set to “8” in FIG. This permits the prefetch operation of the CPU 11 for the main storage of the memory space numbers “1” and “2”, and stops the prefetch operation of the CPU 11 for the secondary storage of the memory space number “3”. It means to let you.

次に、上述した構成を持つマイクロプロセッサの動作について説明する。
図3は、本発明の実施例1に係わるマイクロプロセッサにおける動作の一例を示すテーブルである。ここでは、図2の設定情報がアドレスデコーダ15、ウェイト数設定レジスタ17、およびウェイト上限値設定レジスタ19にあらかじめセットされているものとしてマイクロプロセッサの動作を説明する。
Next, the operation of the microprocessor having the above configuration will be described.
FIG. 3 is a table showing an example of the operation in the microprocessor according to the first embodiment of the present invention. Here, the operation of the microprocessor will be described assuming that the setting information of FIG. 2 is set in advance in the address decoder 15, the wait number setting register 17, and the wait upper limit value setting register 19.

図3に示したテーブルの第1欄はCPU11がアドレスバス12へ出力するアドレスを示し、第2欄はそのアドレスでの命令コードを示し、第3欄はそのアドレスが属するメモリ空間番号を示している。   The first column of the table shown in FIG. 3 shows the address that the CPU 11 outputs to the address bus 12, the second column shows the instruction code at that address, and the third column shows the memory space number to which the address belongs. Yes.

まず、CPU11は、“02000番地”で“ジャンプ1”命令を実行する。この時のメモリ空間番号は“1”である。そして、“ジャンプ1”命令によってCPU11の実行は“20000番地”へジャンプする。   First, the CPU 11 executes a “jump 1” instruction at “address 02000”. The memory space number at this time is “1”. The execution of the CPU 11 jumps to “20000 address” by the “jump 1” instruction.

次に、CPU11は、“20000番地”で“演算1”命令を実行する。この時のメモリ空間番号は“3”になる。そして、処理が進み、CPU11の実行は“20100番地”に到達する。“20100番地”では、CPU11は、“ジャンプ2”命令を実行し、“10000番地”へジャンプする。   Next, the CPU 11 executes an “arithmetic 1” instruction at “address 20000”. The memory space number at this time is “3”. Then, the process proceeds and the execution of the CPU 11 reaches “20100”. At “20100”, the CPU 11 executes a “jump 2” instruction and jumps to “10000”.

“10000番地”のメモリ空間番号は“2”である。すなわち、図3に示した動作では、メモリ空間番号は“1”→“3”→“2”と変化する。ここで注意することは、アドレスバス12へCPU11が出力するアドレスは次の命令コートのアドレスであることである。   The memory space number of “10000 addresses” is “2”. That is, in the operation shown in FIG. 3, the memory space number changes from “1” → “3” → “2”. Note that the address output by the CPU 11 to the address bus 12 is the address of the next instruction code.

したがって、CPU11が“02000番地”で“ジャンプ1”命令を解釈実行する段階で次の“20000番地”がアドレスバス12へ出力され、アドレスデコーダ15は、メモリ空間番号“3”に対応する選択信号をウェイト数設定レジスタ17へ出力する。   Therefore, when the CPU 11 interprets and executes the “jump 1” instruction at “02000”, the next “20000” is output to the address bus 12, and the address decoder 15 selects the selection signal corresponding to the memory space number “3”. Is output to the wait number setting register 17.

図4は、本発明の実施例1に係わるマイクロプロセッサにおけるプリフェッチ禁止信号13の一例を示す波形図である。ここでは、図3に示した動作に従って生成されるプリフェッチ禁止信号13を時間軸で示している。   FIG. 4 is a waveform diagram showing an example of the prefetch inhibition signal 13 in the microprocessor according to the first embodiment of the present invention. Here, the prefetch prohibition signal 13 generated in accordance with the operation shown in FIG. 3 is shown on the time axis.

プリフェッチ禁止信号13は、“H”でCPU11のプリフェッチ動作を停止させる。すなわち、図4に示したように、メモリ空間番号“1”および“2”では、プリフェッチ禁止信号13は“L”であり、CPU11のプリフェッチ動作は許可される。また、メモリ空間番号“3”では、プリフェッチ禁止信号13は“H”であり、CPU11のプリフェッチ動作は停止される。   The prefetch inhibition signal 13 is “H” and stops the prefetch operation of the CPU 11. That is, as shown in FIG. 4, in the memory space numbers “1” and “2”, the prefetch prohibition signal 13 is “L”, and the prefetch operation of the CPU 11 is permitted. In the memory space number “3”, the prefetch prohibition signal 13 is “H”, and the prefetch operation of the CPU 11 is stopped.

図5は、本発明の実施例1に係わるマイクロプロセッサにおける詳細動作の一例を示すイメージ図である。ここでは、図3のメモリ空間番号“1”から“3”への遷移にかかわる動作を示した。   FIG. 5 is an image diagram showing an example of detailed operation in the microprocessor according to the first embodiment of the present invention. Here, the operation related to the transition from the memory space number “1” to “3” in FIG. 3 is shown.

図5の最上段はシステムクロック(CLK)の波形を示し、2番目の段はプリフェッチ禁止信号13を示し、3番目の段は命令コードの読み込みタイミングを示し、4番目の段はCPU11の内部動作タイミングを示し、最下段はCPU11が外部メモリへ出力するリード信号の波形を示している。   5 shows the waveform of the system clock (CLK), the second stage shows the prefetch inhibition signal 13, the third stage shows the instruction code read timing, and the fourth stage shows the internal operation of the CPU 11. The timing shows the timing, and the bottom row shows the waveform of the read signal that the CPU 11 outputs to the external memory.

図5に示したように、アドレスがメモリ空間番号“3”に遷移すると、CPU11の動作は逐次処理となり、長い待機期間に無駄なリード動作は発生しない。これにより、たとえ分岐命令があっても分岐判定後にバスサイクルを起動するので、無駄なバスサイクルは発生せず、アドレスバス12およびデータバスの負荷が軽減される。   As shown in FIG. 5, when the address transitions to the memory space number “3”, the operation of the CPU 11 is a sequential process, and no unnecessary read operation occurs during a long standby period. Thereby, even if there is a branch instruction, the bus cycle is started after the branch determination, so that a useless bus cycle does not occur, and the load on the address bus 12 and the data bus is reduced.

重要なことは、設定情報をあらかじめプログラムによって設定しておくことができるので、ウェイト数設定レジスタ17およびウェイト上限値設定レジスタ19に適宜値をセットすることで、ユーザがシステム固有の構成に応じた最適なプリフェッチ制御を行うことができるということである。   Importantly, since the setting information can be set in advance by a program, the user can set the values in the number-of-waits setting register 17 and the weight upper limit value setting register 19 in accordance with the configuration unique to the system. This means that optimal prefetch control can be performed.

上記実施例1によれば、メモリ空間ごとにマイクロプロセッサのプリフェッチ機能が制御されるので、システム固有の多様なメモリ構成および入出力装置の構成に柔軟に対応することができる。   According to the first embodiment, since the prefetch function of the microprocessor is controlled for each memory space, it is possible to flexibly cope with various memory configurations and input / output device configurations unique to the system.

また、上記実施例1によれば、メモリ空間ごとのウェイト数16およびアドレスとウェイト数設定レジスタ17との対応付けを電源投入時またはシステムリセット時にシステムプログラムによって設定するので、システム稼働後も必要に応じてCPU11のプリフェッチ制御を容易に変更することができる。   Further, according to the first embodiment, the number of waits 16 for each memory space and the correspondence between the address and the wait number setting register 17 are set by the system program at the time of power-on or system reset. Accordingly, the prefetch control of the CPU 11 can be easily changed.

さらに、上記実施例1によれば、ウェイト数16が大きい外部メモリまたは入出力装置に対して、CPU11は、キャッシュミスヒット時でもプリフェッチ動作を行わず待機状態であるので、無駄なバスサイクルは発生せず、アドレスバス12およびデータバスの負荷が軽減される。また、同時に、ブリフェッチ動作に必要なCPU11の負荷も軽減される。   Furthermore, according to the first embodiment, for the external memory or input / output device having a large number of waits 16, the CPU 11 is in a standby state without performing a prefetch operation even at the time of a cache miss, so a useless bus cycle occurs. Instead, the load on the address bus 12 and the data bus is reduced. At the same time, the load on the CPU 11 necessary for the brifetch operation is also reduced.

上述の実施例1では、アドレスデコーダ15は、構成の柔軟性を考慮してFPGAで構成するとしたが、本発明はこれに限られるものではなく、例えば、メモリ空間番号とアドレス範囲をあらかじめ固定しておき、それらの対応をロジック回路で構成することもできる。   In the first embodiment described above, the address decoder 15 is configured with an FPGA in consideration of the flexibility of the configuration. However, the present invention is not limited to this. For example, the memory space number and the address range are fixed in advance. These correspondences can also be configured by logic circuits.

また、上述の実施例1では、説明のためメモリ空間を3つに分割しそれぞれに外部メモリを割り当てたが、本発明はこれに限られるものではなく、原理的にはCPU11のメモリ空間に割り付けることができる任意の数の外部メモリおよび入出力装置に対応した構成とすることができる。   In the first embodiment, the memory space is divided into three and the external memory is assigned to each of them for the sake of explanation. However, the present invention is not limited to this, and in principle, the memory space is assigned to the memory space of the CPU 11. A configuration corresponding to an arbitrary number of external memories and input / output devices can be adopted.

図6は、本発明の実施例2に係わるマイクロプロセッサを示す回路ブロック図である。ここでは、主に、プリフェッチ機能の制御にかかわる部分を示した。   FIG. 6 is a circuit block diagram showing a microprocessor according to Embodiment 2 of the present invention. Here, the part mainly related to the control of the prefetch function is shown.

本発明の実施例2に係わるマイクロプロセッサは、命令コードに基づいて処理を行うCPU61、および外部ウェイト信号62に基づいてCPU61のプリフェッチ機能を制御するためのプリフェッチ禁止信号63を生成するプリフェッチ制御部64を備えている。   The microprocessor according to the second embodiment of the present invention includes a CPU 61 that performs processing based on an instruction code, and a prefetch control unit 64 that generates a prefetch inhibition signal 63 for controlling the prefetch function of the CPU 61 based on an external wait signal 62. It has.

CPU61の入力にはプリフェッチ制御部64からのプリフェッチ禁止信号63が入力され、CPU61の出力はプリフェッチ制御部64の第1の入力に供給されている。また、プリフェッチ制御部64の第2の入力には、外部ウェイト信号62が入力されている。   A prefetch inhibition signal 63 from the prefetch control unit 64 is input to the input of the CPU 61, and an output of the CPU 61 is supplied to a first input of the prefetch control unit 64. An external wait signal 62 is input to the second input of the prefetch control unit 64.

CPU61の機能および動作は、リセット信号65の出力を除いて実施例1と同様であるので、詳しい説明は省略する。   Since the functions and operations of the CPU 61 are the same as those in the first embodiment except for the output of the reset signal 65, detailed description thereof is omitted.

プリフェッチ制御部64は、図6に示したように、外部ウェイト信号62に同期してシステムクロック(以下、「CLK」という。)をカウントアップすることでウェイト数66を生成するウェイト数カウンタ67、ウェイト数66の上限値であるウェイト上限値68を保持するウェイト上限値設定レジスタ69、およびウェイト数66とウェイト上限値68を比較判定する判定回路70を備えている。   As shown in FIG. 6, the prefetch control unit 64 counts a system clock (hereinafter referred to as “CLK”) in synchronization with the external wait signal 62, thereby generating a wait number counter 67 that generates a wait number 66. A weight upper limit setting register 69 that holds a weight upper limit 68 that is an upper limit of the number of waits 66 and a determination circuit 70 that compares and determines the number of waits 66 and the weight upper limit 68 are provided.

ウェイト数カウンタ67の第1の入力にはCPU61からのリセット信号65が入力され、ウェイト数カウンタ67の第2の入力には外部ウェイト信号62が入力されている。ウェイト数カウンタ67の出力はウェイト数66として判定回路70の第1の入力に供給され、ウェイト上限値設定レジスタ69の出力はウェイト上限値68として判定回路70の第2の入力に供給され、判定回路70の出力はプリフェッチ禁止信号63としてCPU61に供給されている。   A reset signal 65 from the CPU 61 is input to the first input of the wait number counter 67, and an external wait signal 62 is input to the second input of the wait number counter 67. The output of the wait number counter 67 is supplied as a wait number 66 to the first input of the determination circuit 70, and the output of the weight upper limit value setting register 69 is supplied as the weight upper limit value 68 to the second input of the determination circuit 70 for determination. The output of the circuit 70 is supplied to the CPU 61 as a prefetch prohibiting signal 63.

ウェイト数カウンタ67は、外部ウェイト信号62によってCLKのカウントアップを開始し、そのカウント数をウェイト数66として判定回路70へ出力する。また、ウェイト数カウンタ67は、CPU61からのリセット信号65によってカウントアップが停止され初期状態にリセットされる。   The wait number counter 67 starts counting up the CLK by the external wait signal 62 and outputs the count number to the determination circuit 70 as the wait number 66. The wait number counter 67 is stopped from being counted up by a reset signal 65 from the CPU 61 and reset to an initial state.

CPU61は、プリフェッチ禁止信号63によってプリフェッチ動作を停止させられた後、データバスから次の命令コードまたはデータを読み込むとリセット信号65を出力する。   After the prefetch operation is stopped by the prefetch inhibition signal 63, the CPU 61 outputs a reset signal 65 when the next instruction code or data is read from the data bus.

ウェイト上限値設定レジスタ69および判定回路70の機能および動作は、実施例1と同様であるので説明は省略する。   Since the functions and operations of the wait upper limit setting register 69 and the determination circuit 70 are the same as those in the first embodiment, the description thereof is omitted.

実施例2では、実施例1と異なり、外部ウェイト信号62が入力されている間はCPU61を待機状態にすることができる。したがって、外部メモリまたは入出力装置のウェイト数66があらかじめ固定されていない場合にも対応することができる。   In the second embodiment, unlike the first embodiment, the CPU 61 can be in a standby state while the external wait signal 62 is being input. Therefore, it is possible to cope with the case where the number of waits 66 of the external memory or the input / output device is not fixed in advance.

上記実施例2によれば、外部メモリまたは入出力装置ごとにマイクロプロセッサのプリフェッチ機能が制御されるので、システム固有の多様な構成に柔軟に対応することができる。   According to the second embodiment, since the prefetch function of the microprocessor is controlled for each external memory or input / output device, it is possible to flexibly cope with various configurations unique to the system.

また、上記実施例2によれば、ウェイト上限値68を電源投入時またはシステムリセット時にシステムプログラムによって設定するので、システム稼働後も必要に応じてCPU61のプリフェッチ制御を容易に変更することができる。   Further, according to the second embodiment, the wait upper limit value 68 is set by the system program when the power is turned on or when the system is reset, so that the prefetch control of the CPU 61 can be easily changed as needed even after the system is operated.

さらに、上記実施例2によれば、外部メモリまたは入出力装置のアドレスに関係なくウェイト数66が生成されるので、システム稼働後に外部メモリおよび入出力装置のメモリ空間への割付を容易に変更することができる。   Further, according to the second embodiment, since the number of waits 66 is generated regardless of the address of the external memory or the input / output device, the allocation of the external memory and the input / output device to the memory space is easily changed after the system is operated. be able to.

さらに、上記実施例2によれば、ウェイト数66が可変の外部メモリまたは入出力装置に対して、CPU61は、キャッシュミスヒット時でもプリフェッチ動作を行わず待機状態であるので、無駄なバスサイクルは発生せず、アドレスバスおよびデータバスの負荷が軽減される。また、同時に、ブリフェッチ動作に必要なCPU61の負荷も軽減される。   Further, according to the second embodiment, for the external memory or input / output device having a variable number of waits 66, the CPU 61 is in a standby state without performing a prefetch operation even when a cache miss hits. No load occurs on the address bus and data bus. At the same time, the load on the CPU 61 necessary for the brifetch operation is also reduced.

上述の実施例1および2では、説明を容易にするため、ウェイト数設定レジスタ17を用いる構成とウェイト数カウンタ67を用いる構成を別々に記述したが、本発明はこれに限られるものではなく、ウェイト数設定レジスタ17とウェイト数カウンタ67の両方を用いる構成にしても良い。   In the first and second embodiments described above, the configuration using the wait number setting register 17 and the configuration using the wait number counter 67 are described separately for ease of explanation. However, the present invention is not limited to this. A configuration using both the wait number setting register 17 and the wait number counter 67 may be adopted.

本発明の実施例1に係わるマイクロプロセッサを示す回路ブロック図。1 is a circuit block diagram showing a microprocessor according to Embodiment 1 of the present invention. 本発明の実施例1に係わるマイクロプロセッサにおける設定情報の一例を示すテーブル。4 is a table showing an example of setting information in the microprocessor according to the first embodiment of the present invention. 本発明の実施例1に係わるマイクロプロセッサにおける動作の一例を示すテーブル。4 is a table showing an example of an operation in the microprocessor according to the first embodiment of the present invention. 本発明の実施例1に係わるマイクロプロセッサにおけるプリフェッチ禁止信号13の一例を示す波形図。FIG. 3 is a waveform diagram showing an example of a prefetch inhibition signal 13 in the microprocessor according to Embodiment 1 of the present invention. 本発明の実施例1に係わるマイクロプロセッサにおける詳細動作の一例を示すイメージ図。FIG. 3 is an image diagram showing an example of detailed operation in the microprocessor according to the first embodiment of the present invention. 本発明の実施例2に係わるマイクロプロセッサを示す回路ブロック図。FIG. 6 is a circuit block diagram showing a microprocessor according to Embodiment 2 of the present invention.

符号の説明Explanation of symbols

11、61 CPU
12 アドレスバス
13、63 プリフェッチ禁止信号
14、64 プリフェッチ制御部
15 アドレスデコーダ
16、66 ウェイト数
17 ウェイト数設定レジスタ
18、68 ウェイト上限値
19、69 ウェイト上限値設定レジスタ
20、70 判定回路
62 外部ウェイト信号
65 リセット信号
67 ウェイト数カウンタ
11, 61 CPU
12 Address bus 13, 63 Prefetch prohibition signal 14, 64 Prefetch control unit 15 Address decoder 16, 66 Wait number 17 Wait number setting register 18, 68 Wait upper limit value 19, 69 Wait upper limit value setting register 20, 70 Judgment circuit 62 External wait Signal 65 Reset signal 67 Wait number counter

Claims (5)

CPUがデータまたは命令コードを読み出すために必要なウェイトサイクル数を生成するウェイト数生成手段と、
前記CPUのプリフェッチを許す前記ウェイトサイクル数の上限を示すウェイト上限値を保持する保持手段と、
前記ウェイト数生成手段からの前記ウェイトサイクル数および前記保持手段からの前記ウェイト上限値を比較判定し、当該判定結果に基づいて前記CPUのプリフェッチ機能を停止させるプリフェッチ禁止信号を出力する判定手段を有することを特徴とするマイクロプロセッサ。
Wait number generation means for generating the number of wait cycles necessary for the CPU to read data or instruction code;
Holding means for holding a weight upper limit value indicating an upper limit of the number of wait cycles allowing the CPU to prefetch;
A determination unit that compares and determines the number of wait cycles from the wait number generation unit and the upper limit value of the wait from the holding unit, and outputs a prefetch prohibition signal that stops the prefetch function of the CPU based on the determination result; A microprocessor characterized by that.
前記ウェイト数生成手段は、あらかじめ定められた前記ウェイトサイクル数を保持する設定レジスタを備え、前記データまたは命令コードのアドレスが所定の範囲内である場合に、前記設定レジスタに保持されている前記ウェイトサイクル数を選択して出力することを特徴とする請求項1に記載のマイクロプロセッサ。   The wait number generation means includes a setting register for holding the predetermined number of wait cycles, and when the address of the data or instruction code is within a predetermined range, the wait number held in the setting register 2. The microprocessor according to claim 1, wherein the number of cycles is selected and output. 前記ウェイト数生成手段は、複数に分割された前記CPUのメモリ空間に対応した前記ウェイトサイクル数を保持する複数のレジスタを備え、前記データまたは命令コードのアドレスに基づいて、前記複数のレジスタから前記データまたは命令コードに対応する前記ウェイトサイクル数を選択して出力することを特徴とする請求項1に記載のマイクロプロセッサ。   The wait number generating means includes a plurality of registers for holding the number of wait cycles corresponding to the memory space of the CPU divided into a plurality, and from the plurality of registers based on the address of the data or instruction code 2. The microprocessor according to claim 1, wherein the number of wait cycles corresponding to data or an instruction code is selected and output. 前記ウェイト数生成手段は、外部ウェイト信号に基づいてクロック信号をカウントアップすることで前記データまたは命令コードに対応する前記ウェイトサイクル数を生成することを特徴とする請求項1に記載のマイクロプロセッサ。   2. The microprocessor according to claim 1, wherein the wait number generating means generates the wait cycle number corresponding to the data or instruction code by counting up a clock signal based on an external wait signal. 前記ウェイト上限値は、電源投入時またはシステムリセット時に前記保持手段に格納されることを特徴とする請求項1に記載のマイクロプロセッサ。   2. The microprocessor according to claim 1, wherein the wait upper limit value is stored in the holding unit at power-on or system reset.
JP2006003438A 2006-01-11 2006-01-11 Microprocessor Withdrawn JP2007188137A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006003438A JP2007188137A (en) 2006-01-11 2006-01-11 Microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006003438A JP2007188137A (en) 2006-01-11 2006-01-11 Microprocessor

Publications (1)

Publication Number Publication Date
JP2007188137A true JP2007188137A (en) 2007-07-26

Family

ID=38343289

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006003438A Withdrawn JP2007188137A (en) 2006-01-11 2006-01-11 Microprocessor

Country Status (1)

Country Link
JP (1) JP2007188137A (en)

Similar Documents

Publication Publication Date Title
JP7290393B2 (en) game machine
US20080320280A1 (en) Microprogrammed processor having mutiple processor cores using time-shared access to a microprogram control store
US7636812B2 (en) Cache memory control method and cache memory control device
US6125440A (en) Storing executing instruction sequence for re-execution upon backward branch to reduce power consuming memory fetch
CN101432691B (en) Method and system for controlling timing in a processor
JP4635063B2 (en) Cache memory control circuit and processor
WO2009098737A1 (en) External device access apparatus, its controlling method and system lsi
JP2005018553A (en) Memory interface circuit
KR100321745B1 (en) A micro controller unit for external memory access
JP2007188137A (en) Microprocessor
JP7290395B2 (en) game machine
KR20050113499A (en) Cache system having branch target address cache
KR100442290B1 (en) A circuit for controlling program counter
JP2004094807A (en) Instruction cache, microprocessor, and design method for same
JP7290394B2 (en) game machine
JP4283226B2 (en) Data processing device that performs instruction parallel processing depending on address range
JPH0683986A (en) Single chip microcomputer
US7124281B1 (en) Processing system having sequential address indicator signals
JP4343244B2 (en) Microcomputer
JP2003337790A (en) Bus control circuit and processor
JP4480787B2 (en) Processor power control apparatus and power control method
JP2007128336A (en) Parallel register access device and system lsi
JP2005056033A (en) Register circuit
JP2006048258A (en) Data processor
JP2005084712A (en) Cache system

Legal Events

Date Code Title Description
A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20081226

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090210

A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20090407