【0001】
【発明の属する技術分野】
本発明は、キャッシュ機能付きマイクロコンピュータに係り、特に、チップの外部端子数を削減することができるデータ転送方法に関する。
【0002】
【従来の技術】
従来、キャッシュ機能付きマイクロコンピュータにおいては、キャッシュがヒットした場合はキャッシュメモリからデータを読み出すので、外部メモリから読み出す場合に比べて高速に処理することができる。
【0003】
しかし、キャッシュがヒットしなかった場合は、外部メモリに対して通常の外部バスアクセスと同様の動作が行われるので、キャッシュ機能が無い場合に比べて外部メモリへのアクセス頻度は少なくなっても、外部メモリへのアクセスに必要な本数分だけデバイスの外部端子を設けなければならないことに変わりはない。
【0004】
【発明が解決しようとする課題】
携帯端末等では、小型化や軽量化のためにシステムを搭載する基板を極力小さくする必要があるので、可能な限りデバイスの端子数は減らしておきたいという要求がある。
【0005】
しかしながら、上記のようなマイクロコンピュータやメモリを含むシステムを搭載する基板は、システムを構成するデバイスの外部端子が多い分だけデバイスの専有面積や配線領域が大きくなってしまうという問題がある。
【0006】
本発明は上記の問題点を解決するもので、デバイスの外部端子数を減らすことが可能なデータ転送方法およびキャッシュ機能付きマイクロコンピュータを提供することを目的とする。
【0007】
【課題を解決するための手段】
この課題を解決するために、本発明の請求項1に係るデータ転送方法は、外部メモリとキャッシュメモリ間のデータ転送方法において、キャッシュがヒットしなかった場合の前記データ転送をシリアルインターフェースを介して行うものである。
【0008】
上記構成によれば、キャッシュ機能を備えながらも、外部メモリとの接続信号がシリアルデータ送受信用の数本で済むようになるため、デバイスのピン数および基板の配線領域を削減することが可能となる。
【0009】
本発明の請求項2に係るキャッシュ機能付きマイクロコンピュータは、請求項1記載のデータ転送方法を行うキャッシュ機能付きマイクロコンピュータにおいて、前記シリアルインターフェースは、システムの立ち上がり時に起動プログラムの最初の適当量のデータを外部メモリから自動受信する機能を具備するものである。
【0010】
上記構成によれば、システムの起動時にCPUがキャッシュ機能を使用しないモードになっていても自動的に起動プログラムを取り込むことができるため、外部メモリとの接続がシリアルインターフェースであってもスムーズにシステムを起動することができる。
【0011】
本発明の請求項3に係るキャッシュ機能付きマイクロコンピュータは、請求項2記載のキャッシュ機能付きマイクロコンピュータにおいて、前記シリアルインターフェースは、外部メモリに送信するデータに自らを識別するデバイス識別情報を与える機能と、外部メモリから受信するデータに含まれるデバイス識別情報が自らのデバイス識別情報と一致した場合にのみ受信データをキャッシュメモリに転送する機能とを具備するものである。
【0012】
上記構成によれば、シリアルインターフェースがデバイス識別情報を処理することにより、複数のキャッシュ機能付きマイクロコンピュータで構成されるシステムにおいても、外部メモリとキャッシュメモリ間のデータ転送を円滑に制御することができる。
【0013】
【発明の実施の形態】
以下、本発明の実施の形態について図面を参照しながら説明する。
図1は本発明の一実施の形態に係るキャッシュ機能付きマイクロコンピュータの構成を示すブロック図である。
【0014】
図1において、101はCPUとキャッシュメモリを内蔵するキャッシュ機能付きマイクロコンピュータ、102はCPU、103はキャッシュメモリ、104はメモリ部とシリアルインターフェース回路で構成されるメモリ内蔵外部デバイス、105はメモリ、106および107は特定のデータ転送フォーマットに従ってシリアルデータを送受信するためのシリアルインターフェース回路である。
【0015】
メモリ105には、CPU102が読み出す命令プログラムもしくはデータが書き込まれている。以下、CPUの読み出し動作について説明する。CPU102がメモリ105の領域をアクセスするときに、キャッシュがヒットした場合はキャッシュメモリ103に蓄積されているデータを読み出す。
【0016】
キャッシュがヒットしなかった場合は、アクセスするアドレスおよびデータ長などの情報で構成されたフォーマットを持つ制御データをシリアルインターフェース回路106の送信バッファに設定し、この制御データをメモリ内蔵外部デバイス104に送信する。
【0017】
メモリ内蔵外部デバイス104のシリアルインターフェース回路107は、制御データを受信すると、この制御データで指定されたメモリ105のアドレスからデータの読み出しを行い、そのデータとアクノリッジ信号(読み出し完了フラグ)をキャッシュ機能付きマイクロコンピュータ101に送信する。
【0018】
シリアルインターフェース回路106がアクノリッジ信号を受信すると、CPU102は受信した読み出しデータをキャッシュメモリ103の該当アドレスに蓄積する。以降、CPU102が再び同じアドレスをアクセスする場合は、内蔵キャッシュメモリ103に蓄積されたデータを読み出すことになる。
【0019】
CPUの書き込み動作はキャッシュメモリ方式により処理方法が異なるが、メモリ内蔵外部デバイス104のメモリ105に対する書き込み動作については、送信側および受信側のシリアルデータのフォーマットが読み出し時と異なるだけで、回路構成およびデータ転送方法は読み出し時と同様である。
【0020】
また、メモリ内蔵外部デバイス104にCPU102の起動プログラムが書かれているシステムの場合は、システムの立ち上がり時にメモリ内蔵外部デバイス104が起動プログラムの最初の数キロバイト分のデータを読み出し、これをシリアルインターフェース回路106が自動受信するような回路構成とする。
【0021】
また、複数のCPUが同一の外部メモリにアクセスする場合についても、通信するCPUのデバイス識別情報を制御データに付加することにより、同様の構成をとることができる。
【0022】
図2は複数のCPUを搭載するキャッシュ機能付きマイクロコンピュータの構成を示すブロック図である。図2において、201Aおよび201BはCPUとキャッシュメモリを内蔵するキャッシュ機能付きマイクロコンピュータ、202Aおよび202BはCPU、203Aおよび203Bはキャッシュメモリ、204はメモリ部とシリアルインターフェース回路で構成されるメモリ内蔵外部デバイス、205はメモリ、206Aおよび206Bおよび207は特定のデータ転送フォーマットに従ってシリアルデータを送受信するためのシリアルインターフェース回路である。
【0023】
メモリ205には、CPU202AおよびCPU202Bが読み出す命令プログラムもしくはデータがそれぞれ書き込まれている。CPU202AあるいはCPU202Bが読み出しを行うときに、キャッシュがヒットした場合はそれぞれのキャッシュメモリ203Aあるいは203Bに蓄積されているデータを読み出す。
【0024】
キャッシュがヒットしなかった場合は、アクセスするアドレスおよびデータ長などの情報に加えて、CPU202AあるいはCPU202B自身のデバイス識別情報を付加した制御データをシリアルインターフェース回路206Aあるいは206Bの送信バッファに設定し、この制御データをメモリ内蔵外部デバイス204に送信する。バス調停はCPU202Aと202B間で制御する。
【0025】
メモリ内蔵外部デバイス204のシリアルインターフェース回路207は、制御データを受信すると、この制御データで指定されたメモリ205のアドレスからデータの読み出しを行い、そのデータとアクノリッジ信号(読み出し完了フラグ)にデバイス識別情報を付加して要求元のキャッシュ機能付きマイクロコンピュータに送信する。
【0026】
この送信は全てのCPUに対して行われるが、受信側のシリアルインターフェース回路はデバイス識別情報が自分の識別情報と一致した場合にのみ、受信データをキャッシュメモリに転送する。
【0027】
以上のように本実施の形態では、キャッシュがヒットしなかった場合に外部メモリから読み出すデータをシリアルインターフェースを介して転送するため、外部メモリとの接続信号がシリアルデータ送受信用の数本で済むようになり、デバイス専有面積および基板配線領域の削減が可能となる。また、複数のCPUで構成されたシステムでは、さらに削減効果が大きくなる。その結果、携帯端末機器には欠かせないモジュールのさらなる小型化や軽量化を実現することができる。
【0028】
【発明の効果】
以上説明したように、本発明によれば、外部メモリとキャッシュメモリ間のデータ転送を行う専用のシリアルインターフェースを備えることにより、外部メモリとの接続信号がシリアルデータ送受信用の数本で済むようになるため、デバイスのピン数および基板の配線領域を削減することが可能となる。その結果、携帯端末機器には欠かせないモジュールのさらなる小型化や軽量化が実現できるという優れた効果が得られる。
【0029】
さらに本発明によれば、システムの立ち上がり時に起動プログラムの最初の数キロバイト分のデータをシリアルインターフェースが自動受信する機能を備えることで、起動時にCPUがキャッシュ機能を使用しないモードになっていても自動的に起動プログラムを取り込むことができるため、外部メモリとの接続がシリアルインターフェースであってもスムーズにシステムを起動することができるという優れた効果が得られる。
【0030】
さらに本発明によれば、シリアルインターフェースがデバイス識別情報を処理することにより、複数のキャッシュ機能付きマイクロコンピュータで構成されるシステムにおいても、外部メモリとキャッシュメモリ間のデータ転送を円滑に制御することができるという優れた効果が得られる。
【0031】
【図面の簡単な説明】
【図1】本発明の一実施の形態に係るキャッシュ機能付きマイクロコンピュータの構成を示すブロック図。
【図2】複数のCPUを搭載するキャッシュ機能付きマイクロコンピュータの構成を示すブロック図。
【符号の説明】
101、201A、201B キャッシュ機能付きマイクロコンピュータ
102、202A、202B CPU
103、203A、203B キャッシュメモリ
104、204 メモリ内蔵外部デバイス
105、205 メモリ
106、206A、206B シリアルインターフェース回路
107、207 メモリ内蔵外部デバイスのシリアルインターフェース回路[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a microcomputer with a cache function, and more particularly to a data transfer method capable of reducing the number of external terminals of a chip.
[0002]
[Prior art]
Conventionally, in a microcomputer with a cache function, data is read from a cache memory when a cache hit occurs, so that processing can be performed at a higher speed than when reading from an external memory.
[0003]
However, when the cache does not hit, since the same operation as the normal external bus access is performed on the external memory, even if the access frequency to the external memory is reduced as compared with the case without the cache function, It is still necessary to provide the external terminals of the device by the number required for accessing the external memory.
[0004]
[Problems to be solved by the invention]
In mobile terminals and the like, it is necessary to reduce the size of the substrate on which the system is mounted as much as possible in order to reduce the size and weight. Therefore, there is a demand for reducing the number of device terminals as much as possible.
[0005]
However, a substrate on which a system including a microcomputer and a memory as described above is mounted has a problem that the area occupied by devices and the wiring area are increased by the number of external terminals of the devices constituting the system.
[0006]
An object of the present invention is to solve the above problems and to provide a data transfer method and a microcomputer with a cache function capable of reducing the number of external terminals of a device.
[0007]
[Means for Solving the Problems]
In order to solve this problem, a data transfer method according to claim 1 of the present invention is a data transfer method between an external memory and a cache memory, wherein the data transfer is performed via a serial interface when a cache does not hit. Is what you do.
[0008]
According to the above configuration, while having a cache function, only a few signals for transmitting and receiving serial data are required for connection to the external memory, so that the number of pins of the device and the wiring area of the substrate can be reduced. Become.
[0009]
A microcomputer with a cache function according to a second aspect of the present invention is the microcomputer with the cache function for performing the data transfer method according to the first aspect, wherein the serial interface includes an initial appropriate amount of data of an activation program at the time of system startup. Is automatically received from an external memory.
[0010]
According to the above configuration, even when the CPU is in a mode in which the cache function is not used at the time of starting the system, the boot program can be automatically taken in. Therefore, even if the connection to the external memory is a serial interface, the system can be smoothly executed. Can be started.
[0011]
A microcomputer with a cache function according to a third aspect of the present invention is the microcomputer with the cache function according to the second aspect, wherein the serial interface has a function of giving device identification information for identifying itself to data transmitted to an external memory. A function of transferring received data to the cache memory only when device identification information included in data received from the external memory matches its own device identification information.
[0012]
According to the above configuration, the serial interface processes the device identification information, so that even in a system including a plurality of microcomputers with a cache function, data transfer between the external memory and the cache memory can be smoothly controlled. .
[0013]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
FIG. 1 is a block diagram showing a configuration of a microcomputer with a cache function according to one embodiment of the present invention.
[0014]
1, reference numeral 101 denotes a microcomputer with a cache function including a CPU and a cache memory; 102, a CPU; 103, a cache memory; 104, an external device with a built-in memory including a memory unit and a serial interface circuit; 105, a memory; And 107, serial interface circuits for transmitting and receiving serial data according to a specific data transfer format.
[0015]
In the memory 105, an instruction program or data read by the CPU 102 is written. Hereinafter, the read operation of the CPU will be described. If the cache hits when the CPU 102 accesses the area of the memory 105, the data stored in the cache memory 103 is read.
[0016]
If the cache does not hit, control data having a format composed of information such as the address to be accessed and the data length is set in the transmission buffer of the serial interface circuit 106, and the control data is transmitted to the external device 104 with a built-in memory. I do.
[0017]
Upon receiving the control data, the serial interface circuit 107 of the external device 104 with built-in memory reads the data from the address of the memory 105 specified by the control data, and has the cache function with the data and an acknowledge signal (read completion flag). This is transmitted to the microcomputer 101.
[0018]
When the serial interface circuit 106 receives the acknowledge signal, the CPU 102 stores the received read data at the corresponding address in the cache memory 103. Thereafter, when the CPU 102 accesses the same address again, the data stored in the internal cache memory 103 is read.
[0019]
The write operation of the CPU differs in processing method depending on the cache memory system. However, the write operation of the external device 104 with a built-in memory to the memory 105 differs only in the format of the serial data on the transmission side and the reception side from that at the time of reading. The data transfer method is the same as that at the time of reading.
[0020]
In the case of a system in which a startup program for the CPU 102 is written in the external device with built-in memory 104, the external device with built-in memory 104 reads out the first few kilobytes of data of the startup program at system startup, and transfers it to the serial interface circuit. The circuit configuration is such that the automatic reception is performed by 106.
[0021]
Also, when a plurality of CPUs access the same external memory, the same configuration can be obtained by adding the device identification information of the communicating CPU to the control data.
[0022]
FIG. 2 is a block diagram showing a configuration of a microcomputer with a cache function equipped with a plurality of CPUs. In FIG. 2, 201A and 201B are microcomputers with a cache function incorporating a CPU and a cache memory, 202A and 202B are CPUs, 203A and 203B are cache memories, and 204 is an external device with a built-in memory comprising a memory unit and a serial interface circuit. , 205 are memories, and 206A, 206B, and 207 are serial interface circuits for transmitting and receiving serial data according to a specific data transfer format.
[0023]
An instruction program or data read by the CPU 202A and the CPU 202B is written in the memory 205, respectively. When a cache hit occurs when the CPU 202A or the CPU 202B reads data, the data stored in the cache memory 203A or 203B is read.
[0024]
If the cache does not hit, control data to which the device identification information of the CPU 202A or the CPU 202B itself is added in addition to the information such as the address to access and the data length is set in the transmission buffer of the serial interface circuit 206A or 206B. The control data is transmitted to the external device 204 with a built-in memory. Bus arbitration is controlled between the CPUs 202A and 202B.
[0025]
When receiving the control data, the serial interface circuit 207 of the external device 204 with built-in memory reads the data from the address of the memory 205 specified by the control data, and sets the data and an acknowledge signal (read completion flag) as device identification information. And sends it to the requesting microcomputer with cache function.
[0026]
This transmission is performed to all CPUs, but the receiving-side serial interface circuit transfers the received data to the cache memory only when the device identification information matches its own identification information.
[0027]
As described above, in the present embodiment, when the cache does not hit, the data read from the external memory is transferred via the serial interface, so that only a few signals for connecting to the external memory are required for transmitting and receiving serial data. Thus, the area occupied by the device and the wiring area of the substrate can be reduced. Further, in a system including a plurality of CPUs, the reduction effect is further increased. As a result, it is possible to further reduce the size and weight of the module that is indispensable for the portable terminal device.
[0028]
【The invention's effect】
As described above, according to the present invention, by providing a dedicated serial interface for performing data transfer between the external memory and the cache memory, the number of connection signals with the external memory can be reduced to a few for serial data transmission and reception. Therefore, the number of pins of the device and the wiring area of the substrate can be reduced. As a result, there is obtained an excellent effect that further miniaturization and weight reduction of a module indispensable for a portable terminal device can be realized.
[0029]
Further, according to the present invention, the serial interface has a function of automatically receiving the first few kilobytes of data of the start program at the time of starting the system, so that even when the CPU is in a mode not using the cache function at the time of start, it is automatically operated. Since the boot program can be fetched in an appropriate manner, an excellent effect that the system can be started smoothly even when the connection to the external memory is a serial interface is obtained.
[0030]
Further, according to the present invention, the serial interface processes the device identification information, so that even in a system including a plurality of microcomputers with a cache function, it is possible to smoothly control data transfer between the external memory and the cache memory. The excellent effect that can be obtained is obtained.
[0031]
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of a microcomputer with a cache function according to an embodiment of the present invention.
FIG. 2 is a block diagram showing a configuration of a microcomputer with a cache function equipped with a plurality of CPUs.
[Explanation of symbols]
101, 201A, 201B Microcomputer with cache function 102, 202A, 202B CPU
103, 203A, 203B Cache memory 104, 204 External device with built-in memory 105, 205 Memory 106, 206A, 206B Serial interface circuit 107, 207 Serial interface circuit of external device with built-in memory