[go: up one dir, main page]

JP2001202285A - Microprocessor, and its program instruction and data storing method - Google Patents

Microprocessor, and its program instruction and data storing method

Info

Publication number
JP2001202285A
JP2001202285A JP2000009444A JP2000009444A JP2001202285A JP 2001202285 A JP2001202285 A JP 2001202285A JP 2000009444 A JP2000009444 A JP 2000009444A JP 2000009444 A JP2000009444 A JP 2000009444A JP 2001202285 A JP2001202285 A JP 2001202285A
Authority
JP
Japan
Prior art keywords
program
bus
data
memory
rams
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
JP2000009444A
Other languages
Japanese (ja)
Inventor
Shigeru Tsujita
茂 辻田
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 IC Microcomputer Systems Co Ltd
Original Assignee
NEC IC Microcomputer 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 NEC IC Microcomputer Systems Co Ltd filed Critical NEC IC Microcomputer Systems Co Ltd
Priority to JP2000009444A priority Critical patent/JP2001202285A/en
Publication of JP2001202285A publication Critical patent/JP2001202285A/en
Pending legal-status Critical Current

Links

Landscapes

  • Microcomputers (AREA)

Abstract

PROBLEM TO BE SOLVED: To minimize the increase of a software/hardware scale by improving the flexibility of the using form of the memory system of a Harvard architecture type microprocessor. SOLUTION: A memory part 10 is provided with RAMs 13a to 13d of 1 KB storing and holding a program or data, bus switching devices 11a to 11d for selectively connecting the RAMs 13a to 13d to one of a bus 2 for program fetch and a bus 3 for data access respectively in response to each supply of bus selection signals BSa to BSd, and a bus switching register 14 for outputting the signals BSa to BSd corresponding to a bus switching value set from a CPU 1.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明はマイクロプロセッサ
及びそのプログラム命令とデータの格納方法に関し、特
にハーバードアーキテクチャを用いるマイクロプロセッ
サ及びそのプログラム命令とデータの格納方法に関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microprocessor and a method for storing program instructions and data, and more particularly to a microprocessor using a Harvard architecture and a method for storing program instructions and data.

【0002】[0002]

【従来の技術】通常、マイクロプロセッサは、中央演算
装置(以下CPU)とメモリ系へのインタフェースのた
め、公知のフォンノイマン型アーキテクチャとハーバー
ドアーキテクチャの2種類のアーキテクチャの一つを用
いている。CPUにインタフェースしているメモリは、
CPUと同一チップ上に集積されている場合、あるいは
CPUのチップの外部にある場合もあり得る。フォンノ
イマン型アーキテクチャは、CPUは、プログラム命令
とデータの両方を保持する単一のメモリ系に一つのバス
インタフェースにより、接続している。従って、任意の
時に、1つのプログラム命令コード又は1つのデータの
いずれかのみがCPUに転送され、両者が同時に転送さ
れることはない。
2. Description of the Related Art Generally, a microprocessor uses one of two types of well-known architectures, that is, a von Neumann architecture and a Harvard architecture, for interfacing with a central processing unit (hereinafter, CPU) and a memory system. The memory that interfaces to the CPU is:
It may be integrated on the same chip as the CPU or external to the CPU chip. In the von Neumann architecture, the CPU is connected to a single memory system that holds both program instructions and data by one bus interface. Therefore, at any time, only one program instruction code or one data is transferred to the CPU, and neither is transferred at the same time.

【0003】これに対して、ハーバードアーキテクチャ
は、別々の(すなわち2つの)メモリにそれぞれ保持し
ているプログラム命令とデータを同時にアクセス可能と
するため、2つのメモリの各々に対する専用のバスイン
タフェースを備える。従って、プログラム命令とデータ
の同時アクセスにより、CPUの処理速度を向上でき
る。すなわち、ハーバードアーキテクチャを用いるマイ
クロプロセッサは、フォンノイマン型アーキテクチャを
用いるマイクロプロセッサで実行する処理と同一の処理
を、より少ない動作(バスアクセス等)サイクルで実行
でき、後者より処理速度を向上できる。
On the other hand, the Harvard architecture has a dedicated bus interface for each of the two memories so that the program instructions and data held in separate (ie, two) memories can be simultaneously accessed. . Therefore, the processing speed of the CPU can be improved by simultaneously accessing the program instruction and the data. In other words, the microprocessor using the Harvard architecture can execute the same processing as that performed by the microprocessor using the von Neumann architecture in a smaller number of operation (such as bus access) cycles, and can improve the processing speed compared to the latter.

【0004】ここで、プログラム命令を保持するメモリ
をプログラムメモリ、データを保持するメモリをデータ
メモリと呼ぶ。これらメモリとしては、プログラム又は
データの内容により読み出し専用メモリ(リードオンリ
ーメモリ:以下ROM)等の不揮発性メモリ、あるいは
随時読み書き可能メモリ(ランダムアクセスメモリ:以
下RAM)のいずれも用いられるが、説明の便宜上、以
下の説明では、プログラムメモリ及びデータメモリとし
てRAMを用いるものとし、これらをプログラムRAM
及びデータRAMとそれぞれ呼ぶ。
[0004] Here, a memory holding program instructions is called a program memory, and a memory holding data is called a data memory. As these memories, any of a nonvolatile memory such as a read-only memory (hereinafter referred to as ROM) or a memory which can be read and written at any time (random access memory: hereinafter referred to as RAM) is used depending on the contents of a program or data. For convenience, in the following description, a RAM will be used as a program memory and a data memory, and these will be referred to as a program RAM and a RAM.
And a data RAM.

【0005】従来のハーバードアーキテクチャのマイク
ロプロセッサは、プログラムRAMとデータRAMの容
量は予め決まっており、これらをお互いに他方の用途で
使用する場合には、速度低下を伴っていた。また、キャ
ッシュメモリを利用する場合、比較アドレス保持用のメ
モリが必要であり、単位面積あたりのメモリ容量が少な
くなっていた。
In a conventional Harvard architecture microprocessor, the capacities of a program RAM and a data RAM are predetermined, and when these are used for other purposes, the speed is reduced. Further, when a cache memory is used, a memory for holding a comparison address is required, and the memory capacity per unit area has been reduced.

【0006】ハーバードアーキテクチャを用いた従来の
第1のマイクロプロセッサの一例をブロックで示す図8
を参照すると、この図に示す従来のマイクロプロセッサ
100は、ハーバードアーキテクチャを採用しプログラ
ムフェッチ用バス102とデータアクセス用バス103
と内部バス104とを持ちこれら各バスを独立して同時
に制御することが可能なCPU101と、プログラムフ
ェッチ用バス102に接続され基本的にはプログラムを
保持し余剰領域にデータを格納可能なプログラムRAM
105と、データアクセス用バス103に接続され基本
的にはデータを保持し余剰領域にプログラムを格納可能
なデータRAM106と、CPU101の内部バス10
4に接続され汎用バスとの間でデータ転送を行うととも
にこの汎用バス8を制御するバスコントローラ107
と、チップ外部に設けられ汎用バス8と接続されてCP
U101が実行するプログラムやデータを格納している
外部メモリ9とを備える。
FIG. 8 is a block diagram showing an example of a first conventional microprocessor using the Harvard architecture.
Referring to FIG. 1, a conventional microprocessor 100 shown in FIG. 1 employs a Harvard architecture and employs a program fetch bus 102 and a data access bus 103.
And a program RAM which is connected to a program fetch bus 102 and which basically holds programs and can store data in a surplus area.
105, a data RAM 106 connected to the data access bus 103 and capable of storing data and storing programs in a surplus area, and an internal bus 10 of the CPU 101.
A bus controller 107 connected to the general-purpose bus 4 for performing data transfer with the general-purpose bus 8 and controlling the general-purpose bus 8
And a CP connected to a general-purpose bus 8 provided outside the chip.
The external memory 9 stores programs and data to be executed by the U101.

【0007】以上の構成において、CPU101は高速
にプログラムRAM105からプログラムフェッチでき
るが、プログラムRAM105の余剰領域に格納された
データへのデータアクセスは後述する理由により低速で
ある。また、CPU101は高速にデータRAM106
をデータアクセスできるが、データRAM106の余剰
領域に格納されたプログラムに対するプログラムフェッ
チは上記と同様の理由により低速である。
In the above configuration, the CPU 101 can perform a program fetch from the program RAM 105 at high speed, but access to data stored in a surplus area of the program RAM 105 is slow for a reason described later. Further, the CPU 101 can operate the data RAM 106 at high speed.
However, the program fetch for the program stored in the surplus area of the data RAM 106 is slow for the same reason as described above.

【0008】しかし、従来の第1のマイクロプロセッサ
には次のような問題点があった。
However, the first conventional microprocessor has the following problems.

【0009】第1の問題点は、プログラムRAMの余剰
領域をデータRAMとして使用する場合にデータアクセ
ス速度が低下し、またデータRAMの余剰領域をプログ
ラムRAMとして使用する場合にプログラムフェッチ速
度が低下することである。
The first problem is that the data access speed is reduced when the surplus area of the program RAM is used as the data RAM, and the program fetch speed is reduced when the surplus area of the data RAM is used as the program RAM. That is.

【0010】この理由は、CPU101は、プログラム
RAMの余剰領域のデータをアクセスする場合、プログ
ラムフェッチ用バス102に加えてCPU101内部に
おいてプログラムフェッチ用バス102とデータアクセ
ス用バス103とを接続するためのバスブリッジ(図示
しない)を経由して、プログラムRAM105をデータ
アクセスし、また、データRAMの余剰領域のプログラ
ムをフェッチする場合、データアクセス用バス103に
加えて上記バスブリッジを経由して、データRAM10
6からプログラムフェッチするためである。
The reason for this is that when the CPU 101 accesses data in a surplus area of the program RAM, the CPU 101 connects the program fetch bus 102 and the data access bus 103 inside the CPU 101 in addition to the program fetch bus 102. When accessing the program RAM 105 via a bus bridge (not shown) and fetching a program in a surplus area of the data RAM, the data RAM 10 is accessed via the bus bridge in addition to the data access bus 103.
6 for program fetch.

【0011】第2の問題点は、上記マイクロプロセッサ
において、処理速度の最高性能が要求される場合、メモ
リの有効利用ができないことである。
A second problem is that, when the microprocessor requires the highest processing speed, the memory cannot be used effectively.

【0012】この理由は、第1の問題点のために、処理
速度の最高性能を引き出すためには、プログラムをプロ
グラムRAM105に、データをデータRAM106に
それぞれ配置することが必須であり、各々のメモリ領域
に余剰が生じても他方の用途には使用できないためであ
る。
The reason for this is that, in order to obtain the highest processing speed, it is necessary to arrange the program in the program RAM 105 and the data in the data RAM 106, respectively, because of the first problem. This is because even if there is a surplus in the area, it cannot be used for the other purpose.

【0013】プログラムサイズとデータサイズの異なる
複数のプログラムAとプログラムBを切り替えて実行す
る場合のプログラムRAMとデータRAMの必要メモリ
容量の一例を示す図9を参照すると、この例では、プロ
グラムRAM105の容量は2KB、データRAM10
6の容量は3KBそれぞれ必要である。
FIG. 9 shows an example of a required memory capacity of a program RAM and a data RAM when a plurality of programs A and B having different program sizes and data sizes are switched and executed. Capacity is 2KB, data RAM10
The capacity of 6 requires 3 KB each.

【0014】しかし、プログラムAを実行している間
は、データRAM106はその容量を全部利用している
が、プログラムRAM105は1KBの余剰が生じる。
一方、プログラムBを実行している間は、プログラムR
AM105はその容量を全部利用しているが、データR
AM106は2KBの余剰を生じる。
However, while the program A is being executed, the data RAM 106 uses the entire capacity thereof, but the program RAM 105 has a surplus of 1 KB.
On the other hand, while the program B is being executed, the program R
The AM 105 uses the entire capacity, but the data R
The AM 106 has a surplus of 2 KB.

【0015】上述したような従来の第1のマイクロプロ
セッサの問題点を解決し、ハーバードアーキテクチャを
用いるマイクロプロセッサのメモリ系における利用形態
の柔軟性を改善を図った特開平8−63354号公報
(文献1)記載の従来の第2のマイクロプロセッサは、
CPUのプログラムフェッチユニット及びデータ読出書
込ユニットと、メモリ系を構成する2つのメモリをそれ
ぞれインタフェースする2つのバスとの間に、バス使用
権の調停と制御のためのアービトレーションユニットを
備え、プログラムの動作状況に合わせて、与えられた命
令フェッチあるいはデータ読出及び書込要求のためにい
ずれのバスを用いるべきかを判断する制御プロセスを実
行するというものである。
Japanese Patent Application Laid-Open No. 8-63354 discloses a solution to the problems of the first conventional microprocessor as described above, and an improvement in the flexibility of use of a microprocessor using a Harvard architecture in a memory system. 1) The conventional second microprocessor described in 1)
An arbitration unit for arbitration and control of the right to use the bus is provided between the program fetch unit and the data read / write unit of the CPU and the two buses respectively interfacing the two memories constituting the memory system. In accordance with the operation situation, a control process for determining which bus should be used for a given instruction fetch or data read and write request is executed.

【0016】しかし、この従来の第2のマイクロプロセ
ッサのアービトレーションユニットは、2つのバス専用
の2つのバスコントローラと、上記プロセス制御専用の
プロセス制御装置(CPU)を含み、ソフトウェア/ハ
ードウェアとして大規模なものである。
However, the conventional arbitration unit of the second microprocessor includes two bus controllers dedicated to two buses and a process control device (CPU) dedicated to the process control, and is a large-scale software / hardware. It is something.

【0017】[0017]

【発明が解決しようとする課題】上述した従来の第1の
マイクロプロセッサは、CPUが、プログラムRAMの
余剰領域のデータをアクセスする場合、プログラムフェ
ッチ用バスに加えてバス間接続用のバスブリッジを経由
してプログラムRAMをデータアクセスし、また、デー
タRAMの余剰領域のプログラムをフェッチする場合、
データアクセス用バスに加えて上記バスブリッジを経由
してデータRAMからプログラムフェッチするため、プ
ログラムRAMの余剰領域をデータRAMとして使用す
る場合にデータアクセス速度が低下し、またデータRA
Mの余剰領域をプログラムRAMとして使用する場合に
プログラムフェッチ速度が低下するという欠点があっ
た。
When the CPU accesses data in a surplus area of the program RAM, the first conventional microprocessor described above includes a bus bridge for connecting buses in addition to a bus for program fetch. When accessing the program RAM via the data and fetching the program in the surplus area of the data RAM,
Since the program fetch is performed from the data RAM via the bus bridge in addition to the data access bus, the data access speed is reduced when a surplus area of the program RAM is used as the data RAM.
When the surplus area of M is used as the program RAM, there is a disadvantage that the program fetch speed is reduced.

【0018】また、上記欠点のために、処理速度の最高
性能を引き出すためには、プログラムをプログラムRA
Mに、データをデータRAMにそれぞれ配置することが
必須であり、各々のメモリ領域に余剰が生じても他方の
用途には使用できないため、処理速度の最高性能が要求
される場合、メモリの有効利用ができないという欠点が
あった。
Due to the above-mentioned drawbacks, in order to obtain the highest performance of the processing speed, the program must be executed by the program RA.
In M, it is essential to arrange data in the data RAM, and even if each memory area has a surplus, it cannot be used for the other purpose. There was a disadvantage that it could not be used.

【0019】上記欠点を解決し、ハーバードアーキテク
チャを用いるマイクロプロセッサのメモリ系における利
用形態の柔軟性を改善を図った従来の第2のマイクロプ
ロセッサは、その重要構成要素であるバス使用権の調停
と制御のためのアービトレーションユニットが、2つの
バス専用の2つのバスコントローラと、上記プロセス制
御専用のプロセス制御装置(CPU)を含み、ソフトウ
ェア/ハードウェアとして大規模なものとなるという欠
点があった。
The second conventional microprocessor which solves the above-mentioned drawbacks and improves the flexibility of the use form of the microprocessor using the Harvard architecture in the memory system is a arbiter for arbitration of the right to use the bus, which is an important component thereof. An arbitration unit for control includes two bus controllers dedicated to two buses and a process control device (CPU) dedicated to the process control, and has a drawback that the software / hardware becomes large-scale.

【0020】本発明の目的は、上記欠点を解決し、ハー
バードアーキテクチャを用いるマイクロプロセッサのメ
モリ系における利用形態の柔軟性を改善するとともにソ
フトウェア/ハードウェア規模の増大を最小限とするマ
イクロプロセッサ及びそのプログラム命令とデータの格
納方法を提供することにある。
SUMMARY OF THE INVENTION It is an object of the present invention to solve the above-mentioned drawbacks, to improve the flexibility of use of a Harvard architecture in a memory system of a microprocessor, and to minimize an increase in software / hardware scale and its microprocessor. An object of the present invention is to provide a method for storing program instructions and data.

【0021】[0021]

【課題を解決するための手段】本発明のマイクロプロセ
ッサは、メモリ部に別々に格納したプログラム命令とデ
ータをプログラムフェッチ用バスとデータアクセス用バ
スと内部バスとを独立して同時に制御して前記プログラ
ム命令と前記データを同時にアクセス可能とするハーバ
ードアーキテクチャを採用したCPUを備えるマイクロ
プロセッサにおいて、前記メモリ部が、プログラム又は
データを格納保持するそれぞれ一定容量のN(Nは3以
上の整数)個のRAMと、前記N個のRAMの各々を個
別に前記プログラムフェッチ用バスとデータアクセス用
バスとのいずれか一方に選択的に接続するRAM切換手
段とを備え、前記プログラムフェッチ用バスに接続した
方のRAMには前記プログラム命令を前記データアクセ
ス用バスに接続した方のRAMには前記データをそれぞ
れ格納することによりプログラム命令とデータの各々の
格納用メモリの容量比を最適に設定することを特徴とす
るものである。
A microprocessor according to the present invention controls a program fetch bus, a data access bus, and an internal bus independently and simultaneously of program instructions and data separately stored in a memory unit. In a microprocessor including a CPU adopting a Harvard architecture that enables simultaneous access to a program instruction and the data, the memory unit includes N (N is an integer of 3 or more), each of which has a predetermined capacity for storing and holding a program or data. A RAM and RAM switching means for selectively connecting each of the N RAMs individually to one of the program fetch bus and the data access bus, wherein the RAM switching means is connected to the program fetch bus. The RAM is connected to the program instruction by the data access bus. The square of the RAM is characterized in that the optimum setting the volume ratio of the memory for storing each of the program instructions and data by storing the data, respectively.

【0022】また、前記RAM切換手段が、前記内部バ
スに接続されこの内部バスを経由して前記CPUから設
定されたバス切換値に対応するN個のバス選択信号を出
力するバス切換レジスタと、それぞれ前記プログラムフ
ェッチ用バスと前記データアクセス用バスに接続され前
記バス選択信号の各々のレベルに従い前記プログラムフ
ェッチ用バスと前記データアクセス用バスのいずれか一
方を選択するN個のバス切換器と、前記バス切換器の各
々と前記RAMの各々とをそれぞれ接続するN個のメモ
リバスとを備えても良い。
A bus switching register connected to the internal bus for outputting N bus selection signals corresponding to a bus switching value set by the CPU via the internal bus; N bus switches connected to the program fetch bus and the data access bus, respectively, for selecting one of the program fetch bus and the data access bus according to each level of the bus selection signal; The memory may include N memory buses for connecting each of the bus switches and each of the RAMs.

【0023】さらに、マイクロコンピュータが、チップ
外部の汎用バスと、前記内部バスに接続されこの内部バ
スと前記汎用バスとの間でデータ転送を行うとともにこ
の汎用バスを制御するバスコントローラと、前記汎用バ
スに接続され前記CPUが実行する前記プログラム命令
とデータを格納したチップ外部の外部メモリとを備えて
も良い。
A microcomputer connected to the internal bus, for transferring data between the internal bus and the general-purpose bus, and controlling the general-purpose bus; An external memory connected to a bus and external to the chip and storing the program instructions and data to be executed by the CPU may be provided.

【0024】本発明のマイクロプロセッサのプログラム
命令とデータの格納方法は、プログラム又はデータを格
納保持するそれぞれ一定容量のN(Nは3以上の整数)
個のRAMを備えるメモリ部に別々に格納したプログラ
ム命令とデータをプログラムフェッチ用バスとデータア
クセス用バスと内部バスとを独立して同時に制御して前
記プログラム命令と前記データを同時にアクセス可能と
するハーバードアーキテクチャを採用したCPUを備え
るマイクロプロセッサのプログラムサイズとデータサイ
ズの異なる複数のプログラムを切り替えて実行する場合
における前記メモリ部へのプログラム命令とデータの格
納方法において、前記N個のRAMのうち前記複数のプ
ログラムの実行順序に応じて順次前記複数のプログラム
の各々のプログラムサイズに対応するメモリ容量を満足
する個数の前記RAMに前記プログラムフェッチ用バス
を接続してプログラム格納用メモリに設定し、前記プロ
グラム格納用メモリに設定したRAM以外のRAMにデ
ータアクセス用バスを接続してデータ格納用メモリに設
定することによりプログラム命令とデータの各々の格納
用メモリの容量比を最適に設定することを特徴とするも
のである。
The method of storing program instructions and data of the microprocessor according to the present invention is a method of storing and holding a program or data, each having a fixed capacity of N (N is an integer of 3 or more).
A program fetch bus, a data access bus and an internal bus independently and simultaneously controlling program instructions and data separately stored in a memory unit having a plurality of RAMs, thereby enabling the program instructions and the data to be simultaneously accessed. In a method of storing program instructions and data in the memory unit when switching and executing a plurality of programs having different program sizes and data sizes of a microprocessor including a CPU that employs a Harvard architecture, the N RAMs include: The program fetch bus is connected to a number of the RAMs satisfying a memory capacity corresponding to a program size of each of the plurality of programs sequentially according to an execution order of the plurality of programs, and the number of the RAMs is set as a program storage memory. Program storage memo A data access bus is connected to a RAM other than the RAM set as the data storage memory and the data storage memory is set, thereby optimally setting a capacity ratio of the memory for storing the program instruction and the data. is there.

【0025】また、前記複数のプログラムが、プログラ
ムサイズとデータサイズの異なる第1のプログラムと第
2のプログラムであり、前記N個のRAMの全てに前記
データアクセス用バスを接続して前記データの格納用に
設定する初期設定処理である第1のステップと、前記第
1のプログラムのプログラムサイズに対応するメモリ容
量を満たすよう第1の個数の前記RAMに前記プログラ
ムフェッチ用バスを接続し前記第1のプログラムを格納
するよう設定する第2のステップと、前記第1のプログ
ラムを実行する第3のステップと、前記第1のプログラ
ムの終了後、前記N個のRAMの全てに前記データアク
セス用バスを接続して前記データの格納用に設定する第
4のステップと、前記第2のプログラムのプログラムサ
イズに対応するメモリ容量を満たすよう第2の個数の前
記RAMに前記プログラムフェッチ用バスを接続し前記
第2のプログラムを格納するよう設定する第5のステッ
プと、前記第2のプログラムを実行する第6のステップ
とを有しても良い。
Further, the plurality of programs are a first program and a second program having different program sizes and data sizes, and the data access bus is connected to all of the N RAMs to store the data. Connecting the program fetch bus to a first number of the RAMs so as to satisfy a first step which is an initial setting process for setting for storage and a memory capacity corresponding to a program size of the first program; A second step of setting the first program to be stored, a third step of executing the first program, and after the completion of the first program, access to all of the N RAMs for the data access. A fourth step of connecting a bus to set the data to be stored, and a method corresponding to a program size of the second program. A fifth step of connecting the program fetch bus to the second number of the RAMs so as to satisfy the storage capacity and setting the second program to be stored, and a sixth step of executing the second program May be provided.

【0026】さらに、前記複数のプログラムが、プログ
ラムサイズとデータサイズが異なり常時前記メモリ部に
保持する第1のプログラムと必要に応じてロードされる
第2のプログラム及び第3のプログラムであり、前記N
個のRAMの全てに前記データアクセス用バスを接続し
て前記データの格納用に設定する初期設定処理である第
1のステップと、前記第1のプログラムのプログラムサ
イズに対応するメモリ容量を満たすよう第1の個数の前
記RAMに前記プログラムフェッチ用バスを接続し前記
第1のプログラムを格納し、前記第2のプログラムのプ
ログラムサイズに対応するメモリ容量を満たすよう第2
の個数の前記RAMに前記プログラムフェッチ用バスを
接続し前記第2のプログラムを格納するようそれぞれ設
定する第2のステップと、前記第1のプログラムを実行
する第3のステップと、前記第1のプログラムの終了
後、前記第2のプログラムを実行する第4のステップ
と、前記第2のプログラムの終了後、前記N個のRAM
の全てに前記データアクセス用バスを接続して前記デー
タの格納用に設定する第5のステップと、前記第1のプ
ログラムのプログラムサイズに対応するメモリ容量を満
たすよう第1の個数の前記RAMに前記プログラムフェ
ッチ用バスを接続し前記第1のプログラムを格納し、前
記第3のプログラムのプログラムサイズに対応するメモ
リ容量を満たすよう第3の個数の前記RAMに前記プロ
グラムフェッチ用バスを接続し前記第3のプログラムを
格納するようそれぞれ設定する第6のステップと、前記
第1のプログラムを実行する第7のステップと、前記第
1のプログラムの終了後、前記第3のプログラムを実行
する第8のステップとを有しても良い。
Further, the plurality of programs are a first program which is different in program size and data size and is always held in the memory unit, and a second program and a third program which are loaded as needed. N
A first step which is an initial setting process for connecting the data access bus to all of the RAMs and setting the data to be stored, and satisfying a memory capacity corresponding to a program size of the first program. The program fetch bus is connected to a first number of the RAMs to store the first program, and a second number is set so as to satisfy a memory capacity corresponding to a program size of the second program.
A second step of connecting the program fetch bus to the number of the RAMs and setting each to store the second program; a third step of executing the first program; A fourth step of executing the second program after the end of the program, and the N RAMs after the end of the second program.
A fifth step of connecting the data access bus to all of the above and setting the data to be stored, and a first number of the RAMs satisfying a memory capacity corresponding to a program size of the first program. Connecting the program fetch bus to the third number of the RAMs to connect the program fetch bus, store the first program, and satisfy a memory capacity corresponding to a program size of the third program; A sixth step of setting each to store a third program, a seventh step of executing the first program, and an eighth step of executing the third program after the end of the first program Steps may be included.

【0027】[0027]

【発明の実施の形態】次に、本発明の実施の形態につい
て図面を参照して詳細に説明する。
Next, embodiments of the present invention will be described in detail with reference to the drawings.

【0028】本実施の形態のマイクロプロセッサは、例
えばプログラムサイズが大きくデータサイズが小さいプ
ログラムと、プログラムサイズが小さくデータサイズが
大きいプログラムとを含む複数のプログラムを切り替え
て実行する場合に、これら複数のプログラムのプログラ
ム命令コード(以下単にプログラムと呼ぶ)とデータ
を、複数の限られた容量の随時読み書き可能メモリ(ラ
ンダムアクセスメモリ:以下RAM)にロードし、実行
するプログラムのプログラムサイズとデータサイズに合
わせて、RAMをプログラムフェッチ用バスに接続する
か、データアクセス用バスに接続するかを選択すること
により、プログラムの動作状況に合わせてプログラムR
AMとデータRAMの容量比を可変し、これによりハー
バードアーキテクチャの高速性を損なうことなく、限ら
れた容量のメモリを有効利用することを特徴とするもの
である。
The microprocessor according to the present embodiment, when switching and executing a plurality of programs including a program having a large program size and a small data size and a program having a small program size and a large data size, for example, A program instruction code (hereinafter, simply referred to as a program) and data of a program are loaded into a plurality of limited-capacity readable / writable memories (random access memory: hereinafter, referred to as a RAM), and the program size and data size of a program to be executed are adjusted. By selecting whether to connect the RAM to the program fetch bus or the data access bus, the program R can be adjusted according to the operation state of the program.
The present invention is characterized in that the capacity ratio between the AM and the data RAM is changed, thereby effectively utilizing a limited capacity memory without impairing the high speed of the Harvard architecture.

【0029】次に、本発明の実施の形態をブロックで示
す図1を参照すると、この図に示す本実施の形態のマイ
クロプロセッサは、ハーバードアーキテクチャを採用し
プログラムフェッチ用バス2とデータアクセス用バス3
と内部バス4とを持ちこれら各バスを独立して同時に制
御することが可能なCPU1と、メモリ部からのプログ
ラムフェッチを高速に行うことができる上記プログラム
フェッチ用バス2と、メモリ部のデータアクセスを高速
に行うことができる上記データアクセス用バス3と、内
蔵周辺ブロックを接続するためのバスである上記内部バ
ス4と、内部バス4に接続されこの内部バス4と後述の
汎用バス8との間でデータ転送を行うとともにこの汎用
バス8を制御するバスコントローラ7と、チップ外部の
汎用バス8と、汎用バス8に接続されCPU1が実行す
るプログラム命令やデータを格納したチップ外部の外部
メモリ9と、プログラム又はデータを格納保持する複数
個、本実施の形態では後述のように4個のRAMを備え
るメモリ部10とを備える。
Next, referring to FIG. 1 which shows a block diagram of an embodiment of the present invention, the microprocessor of this embodiment shown in FIG. 1 employs a Harvard architecture and employs a program fetch bus 2 and a data access bus. 3
CPU 1 which has an internal bus 4 and can control each of these buses independently and simultaneously; the above-mentioned program fetch bus 2 which can perform a high-speed program fetch from a memory unit; Of the data access bus 3, which can perform high-speed data transfer, the internal bus 4, which is a bus for connecting built-in peripheral blocks, and the internal bus 4 connected to the internal bus 4 and a general-purpose bus 8 described later. A bus controller 7 for transferring data between and controlling the general-purpose bus 8, a general-purpose bus 8 outside the chip, and an external memory 9 connected to the general-purpose bus 8 and storing program instructions and data to be executed by the CPU 1. And a memory unit 10 having a plurality of RAMs for storing and holding programs or data, in this embodiment, four RAMs as described later. Provided.

【0030】メモリ部10は、プログラム又はデータを
格納保持するそれぞれ一定容量、例えば1KBのRAM
13a〜13dと、内部バス4に接続されこの内部バス
4を経由してCPU1から設定されたバス切換値に対応
するバス選択信号BSa〜BSdを出力するバス切換レ
ジスタ14と、それぞれプログラムフェッチ用バス2と
データアクセス用バス3に接続されバス選択信号BSa
〜BSdの各々のレベルに従いプログラムフェッチ用バ
ス2とデータアクセス用バス3のいずれか一方を選択す
るバス切換器11a〜11dと、バス切換器11a〜1
1dとRAM13a〜13dの各々とをそれぞれ接続す
るメモリバス12A〜12dとを備える。
The memory unit 10 has a fixed capacity, for example, a 1 KB RAM for storing and holding a program or data.
13a to 13d, a bus switching register 14 connected to the internal bus 4 and outputting bus selection signals BSa to BSd corresponding to a bus switching value set from the CPU 1 via the internal bus 4, and a bus for program fetch, respectively. 2 and a bus select signal BSa connected to the data access bus 3
Bus selectors 11a to 11d for selecting one of the program fetch bus 2 and the data access bus 3 in accordance with each level of.
1d and memory buses 12A to 12d respectively connecting the RAMs 13a to 13d.

【0031】外部メモリ9には、電源投入直後にCPU
1が実行するプログラムやRAM13a〜13dにロー
ドして使用するプログラムを格納している。
The external memory 9 has a CPU
1 and programs to be loaded and used in the RAMs 13a to 13d.

【0032】本実施の形態の構成要素のうち、メモリ部
10のバス切換器11a〜11dとバス切換レジスタ1
4は、当業者によってよく知られており、また、発明の
内容には直接関係が無いため、その内部構成の説明は省
略する。
Among the components of the present embodiment, the bus switching units 11a to 11d of the memory unit 10 and the bus switching register 1
4 is well known by those skilled in the art, and has no direct relation to the content of the invention, so that the description of its internal configuration is omitted.

【0033】次に、図1及び本実施の形態の第1の実施
例の処理をフローチャートで示す図2を参照して本実施
例の動作であるマイクロプロセッサのプログラム命令と
データの格納方法について説明すると、まず、本実施例
では従来と同様のプログラムサイズとデータサイズの異
なる2つのプログラムAとプログラムBを切り替えて実
行するものであり、これらプログラムA,Bをメモリ部
10のRAM13a〜13dにロードして使用する。本
実施例のプログラムを実行する際に必要となるメモリ容
量を模式的に示す図3を併せて参照すると、この例で
は、プログラムAは、プログラムサイズが1KB、デー
タサイズが3KBであり、プログラムBは、プログラム
サイズが2KB、データサイズが1KBである。
Next, referring to FIG. 1 and FIG. 2 which is a flowchart showing the processing of the first embodiment of this embodiment, a method of storing program instructions and data of a microprocessor which is the operation of this embodiment will be described. Then, first, in the present embodiment, two programs A and B having the same program size and data size as the conventional one are switched and executed, and these programs A and B are loaded into the RAMs 13a to 13d of the memory unit 10. To use. Referring also to FIG. 3, which schematically shows the memory capacity required when executing the program of this embodiment, in this example, the program A has a program size of 1 KB, a data size of 3 KB, and a program B. Has a program size of 2 KB and a data size of 1 KB.

【0034】まず、CPU1は電源投入後、外部メモリ
9に格納されているプログラムを実行する。プログラム
動作が始まると、CPU1とバス切換レジスタ14の初
期設定処理を行う(ステップS1)。この処理で設定さ
れる初期設定値は、メモリ部10のRAM13a〜13
dの全てをデータ格納用に設定する(テーブルT1)。
First, the CPU 1 executes a program stored in the external memory 9 after power is turned on. When the program operation starts, the CPU 1 and the bus switch register 14 are initialized (step S1). The initial setting values set in this process are stored in the RAMs 13 a to 13 of the memory unit 10.
All of d are set for data storage (table T1).

【0035】次に、外部メモリ9から、RAM13aへ
プログラムAをロードし(ステップS2)、バス切換レ
ジスタ14を設定してRAM13aをプログラムフェッ
チ用バス2に接続する(ステップS3)。この処理によ
る設定内容は、RAM13a,13bをプログラム格納
用、RAM13c,13dをデータ格納用とする(テー
ブルT2)。
Next, the program A is loaded from the external memory 9 to the RAM 13a (step S2), the bus switching register 14 is set, and the RAM 13a is connected to the program fetch bus 2 (step S3). The setting contents by this processing are such that the RAMs 13a and 13b are used for storing programs and the RAMs 13c and 13d are used for storing data (table T2).

【0036】この状態でRAM13aにロードされたプ
ログラムAが実行可能になるため、プログラムAの先頭
アドレスへ分岐し、プログラムAを実行する(ステップ
S4)。
In this state, since the program A loaded in the RAM 13a becomes executable, the program branches to the start address of the program A and executes the program A (step S4).

【0037】CPU1は、プログラムAの実行終了後、
ステップS5へ処理を進める。ここでは、プログラムB
をロードするため、バス切換レジスタ14を設定し、R
AM13a〜13dをデータアクセス用バス3に接続す
る(ステップS5)。この処理による設定内容は、RA
M13a〜13dの全てをデータ格納用とする(テーブ
ルT3)。
After completing the execution of the program A, the CPU 1
The process proceeds to step S5. Here, program B
, The bus switching register 14 is set, and R
The AMs 13a to 13d are connected to the data access bus 3 (Step S5). The setting contents by this processing are RA
All of M13a to M13d are used for storing data (table T3).

【0038】さらに、外部メモリ9からRAM13a,
13bへプログラムBをロードし(ステップS6)、バ
ス切換レジスタ14を設定してRAM13a,13bを
プログラムフェッチ用バス2に接続する(ステップS
7)。この処理の結果設定内容は、RAM13a〜13
cをプログラム格納用、RAM13dをデータ格納用と
する(テーブルT4)。
Further, the RAM 13a,
13b, the program B is loaded (step S6), the bus switching register 14 is set, and the RAMs 13a and 13b are connected to the program fetch bus 2 (step S6).
7). The setting contents as a result of this processing are stored in the RAMs 13a to 13a.
Let c be for storing programs and the RAM 13d for storing data (table T4).

【0039】この状態でRAM13a,13bにロード
されたプログラムBが実行可能になるため、プログラム
Bの先頭アドレスへ分岐し、プログラムBを実行する
(ステップS8)。
In this state, since the program B loaded in the RAMs 13a and 13b becomes executable, the program branches to the head address of the program B and executes the program B (step S8).

【0040】本実施例の動作におけるメモリ部10のバ
ス選択信号とメモリバス(ここでは説明の便宜上バス選
択信号BSaとメモリバス12aについてのみ図示す
る)の状態に注目した信号波形をタイミングチャートで
示す図4を参照すると、まず、電源投入後、バス選択信
号BSa〜BSdはCPU1によりLレベルに設定さ
れ、対応するRAM13a〜13dのメモリバス12a
〜12dがデータアクセス用バス3に接続される。
In the operation of this embodiment, a timing chart shows signal waveforms focusing on the state of the bus selection signal of the memory section 10 and the state of the memory bus (only the bus selection signal BSa and the memory bus 12a are shown here for convenience of explanation). Referring to FIG. 4, first, after power is turned on, bus selection signals BSa to BSd are set to L level by CPU 1 and memory buses 12a of corresponding RAMs 13a to 13d are set.
To 12d are connected to the data access bus 3.

【0041】この状態でCPU1はプログラムAをRA
M13aに、プログラムA用データをRAM13b〜1
3dにそれぞれロードし、このロード終了後にバス選択
信号BSaをHレベルに設定し、メモリバス12aをプ
ログラムフェッチ用バス2に接続してプログラムAを実
行する。この状態ではRAM13b〜13dのメモリバ
ス12b〜12dはデータアクセス用バス3に接続され
ており、CPU1は、RAM13b〜13dに対しプロ
グラムAの実行に必要なデータアクセスを行う。
In this state, the CPU 1 stores the program A in the RA
M13a stores program A data in RAMs 13b-1
3d, the bus selection signal BSa is set to the H level after the end of the loading, and the memory bus 12a is connected to the program fetch bus 2 to execute the program A. In this state, the memory buses 12b to 12d of the RAMs 13b to 13d are connected to the data access bus 3, and the CPU 1 performs data access to the RAMs 13b to 13d necessary for executing the program A.

【0042】プログラムAが終了してメインプログラム
へ復帰後、バス選択信号BSa〜BSdはCPU1によ
りLレベルに設定され、RAM13a〜13dのメモリ
バス12a〜12dがデータアクセス用バス3に接続さ
れる。この状態でCPU1はプログラムBをRAM13
a,13bに、プログラムB用データをRAM13cに
それぞれロードし、このロード終了後にバス選択信号B
Sa,BSbをHレベルに設定してメモリバス12a,
12bをプログラムフェッチ用バス2に接続してプログ
ラムBを実行する。この状態ではRAM13cメモリバ
ス12cはデータアクセス用バス3に接続されており、
CPU1は、RAM13cに対しプログラムBの実行に
必要なデータアクセスを行う。
After the program A ends and returns to the main program, the bus selection signals BSa to BSd are set to L level by the CPU 1 and the memory buses 12a to 12d of the RAMs 13a to 13d are connected to the data access bus 3. In this state, the CPU 1 stores the program B in the RAM 13
a and 13b are loaded with data for the program B into the RAM 13c, respectively.
Sa and BSb are set to the H level, and the memory buses 12a,
12b is connected to the program fetch bus 2 to execute the program B. In this state, the RAM 13c memory bus 12c is connected to the data access bus 3, and
The CPU 1 accesses data necessary for executing the program B to the RAM 13c.

【0043】次に、本実施の形態の第2の実施例につい
て説明する。
Next, a second example of this embodiment will be described.

【0044】本実施例ではプログラムサイズとデータサ
イズの異なる3つのプログラムC、D及びEを切り替え
て実行するものであり、さらに、このうちプログラムC
は常時実行可能なようにRAM13a〜13dに保持
し、他のプログラムD及びEのいずれか一方を必要に応
じて即時切り替え実行可能なようにプログラムCととも
にRAM13a〜13dに保持するものである。すなわ
ち、RAM13a〜13dには、プログラムC,D、プ
ログラムC,Eのいずれかの組を常時ロードして使用す
る。
In this embodiment, three programs C, D and E having different program sizes and data sizes are switched and executed.
Are stored in the RAMs 13a to 13d so that they can be executed at all times, and one of the other programs D and E is stored in the RAMs 13a to 13d together with the program C so that they can be switched immediately and executed as needed. That is, any set of the programs C and D and the programs C and E is always loaded and used in the RAMs 13a to 13d.

【0045】本実施例のプログラムを実行する際に必要
となるメモリ容量を模式的に示す図5を併せて参照する
と、この例では、プログラムC,Dは、各々のプログラ
ムサイズが1KB、データサイズが両方合わせて2KB
である。また、プログラムEは、プログラムサイズが2
KB、データサイズがプログラムCと合わせて1KBで
ある。従って、必要メモリ容量は、全部で4KBとな
る。
Referring also to FIG. 5, which schematically shows the memory capacity required when executing the program of the present embodiment, in this example, the programs C and D each have a program size of 1 KB and a data size of 1 KB. Is 2KB in total
It is. Program E has a program size of 2
The KB and the data size are 1 KB together with the program C. Therefore, the required memory capacity is 4 KB in total.

【0046】次に、図1、図5及び本実施の形態の第2
の実施例の処理をフローチャートで示す図6を参照して
本実施例の動作であるマイクロプロセッサのプログラム
命令とデータの格納方法について説明すると、まず、C
PU1は電源投入後、外部メモリ9に格納されているプ
ログラムを実行する。プログラム動作が始まると、CP
U1,バス切換レジスタ14及びシステムの初期設定処
理を行う(ステップS21)。この処理で設定される初
期設定値は、メモリ部10のRAM13a〜13dの全
てをデータ格納用に設定する(テーブルT21)。
Next, FIGS. 1 and 5 and the second embodiment of the present invention will be described.
A method of storing program instructions and data of a microprocessor, which is an operation of the present embodiment, will be described with reference to FIG.
After turning on the power, the PU 1 executes a program stored in the external memory 9. When the program operation starts, CP
The U1 and the bus switching register 14 and the system are initialized (step S21). The initial setting value set in this process sets all of the RAMs 13a to 13d of the memory unit 10 for data storage (table T21).

【0047】次に、外部メモリ9からRAM13aへプ
ログラムCをロード(ステップS22)して、同様にR
AM13bへプログラムDをロードし(ステップS2
3)、バス切換レジスタ14を設定してRAM13a,
13bをプログラムフェッチ用バス2に接続する(ステ
ップS24)。この処理による設定内容は、RAM13
a,13bをプログラム格納用、RAM13c,13d
をデータ格納用とする(テーブルT22)。
Next, the program C is loaded from the external memory 9 to the RAM 13a (step S22), and the R
Load the program D into the AM 13b (step S2
3), the bus switching register 14 is set and the RAM 13a,
13b is connected to the program fetch bus 2 (step S24). The setting contents by this processing are stored in the RAM 13
a, 13b for storing programs, RAM 13c, 13d
For storing data (table T22).

【0048】この状態でRAM13a,13bにロード
されたプログラムC,Dが実行可能になるため、プログ
ラムCの先頭アドレスへ分岐し、プログラムCを実行す
る(ステップS25)。さらに、プログラムCの実行終
了後、プログラムDの先頭アドレスへ分岐し、プログラ
ムDを実行する(ステップS26)。
In this state, since the programs C and D loaded in the RAMs 13a and 13b become executable, the program branches to the head address of the program C and executes the program C (step S25). Further, after the execution of the program C is completed, the program branches to the head address of the program D and executes the program D (step S26).

【0049】CPU1は、プログラムDの実行終了後、
ステップS27へ処理を進める。ここでは、プログラム
Eをロードするため、メモリ部10のバス切換レジスタ
14を設定し、RAM13a,13b,13c,13d
をデータアクセス用バス3に接続する(ステップS2
7)。この処理による設定内容は、RAM13a〜13
dの全てをデータ格納用とする(テーブルT23)。
After completing the execution of the program D, the CPU 1
The process proceeds to step S27. Here, in order to load the program E, the bus switching register 14 of the memory unit 10 is set, and the RAMs 13a, 13b, 13c, and 13d are set.
Is connected to the data access bus 3 (step S2).
7). The setting contents by this processing are stored in the RAMs 13a to 13a.
All of d are used for storing data (table T23).

【0050】さらに、外部メモリ9からRAM13b,
13cへプログラムEをロードし(ステップS28)、
バス切換レジスタ14を設定してRAM13a,13
b,13cをプログラムフェッチ用バス2に接続する
(ステップS29)。この処理の結果設定内容は、RA
M13a〜13cをプログラム格納用、RAM13dを
データ格納用とする(テーブルT24)。
Further, the RAM 13b,
13c to load the program E (step S28),
By setting the bus switching register 14, the RAM 13a, 13
b, 13c are connected to the program fetch bus 2 (step S29). The result of this process is
M13a to 13c are used for storing programs, and the RAM 13d is used for storing data (table T24).

【0051】この状態でRAM13a,13b,13c
にロードされたプログラムC,Eが実行可能になるた
め、プログラムCの先頭アドレスへ分岐し、プログラム
Cを実行する(ステップS30)。さらにプログラムC
の実行終了後、プログラムEの先頭アドレスへ分岐し、
プログラムEを実行する(ステップS31)。
In this state, the RAMs 13a, 13b, 13c
Since the programs C and E loaded in the program C become executable, the program branches to the start address of the program C and executes the program C (step S30). Further program C
Is executed, the program branches to the start address of the program E,
The program E is executed (Step S31).

【0052】本実施例の動作におけるバス選択信号とメ
モリバス(ここでは説明の便宜上バス選択信号BSaと
メモリバス12aについてのみ図示する)の状態に注目
した信号波形をタイミングチャートで示す図7を参照す
ると、まず、電源投入後、バス選択信号BSa〜BSd
はCPU1によりLレベルに設定され、対応するRAM
13a〜RAM13dのメモリバス12a〜12dの各
々がデータアクセス用バス3に接続される。
FIG. 7 is a timing chart showing signal waveforms focusing on the states of the bus selection signal and the memory bus (only the bus selection signal BSa and the memory bus 12a are shown here for convenience of explanation) in the operation of the present embodiment. Then, first, after the power is turned on, the bus selection signals BSa to BSd
Is set to L level by the CPU 1 and the corresponding RAM
Each of the memory buses 12a to 12d of the RAMs 13a to 13d is connected to the data access bus 3.

【0053】この状態でCPU1はプログラムC,Dの
各々をRAM13a,13bにそれぞれロードし、この
ロード終了後にバス選択信号BSa,BSbをHレベル
に設定し、メモリバス12a,12bをプログラムフェ
ッチ用バス2に接続してプログラムCを実行する。この
状態ではRAM13c,13dのメモリバス12c,1
2dはデータアクセス用バス3に接続されており、CP
U1は、RAM13c,13dに対しプログラムCの実
行に必要なデータアクセスを行う。
In this state, the CPU 1 loads the programs C and D into the RAMs 13a and 13b respectively, sets the bus selection signals BSa and BSb to H level after the loading is completed, and sets the memory buses 12a and 12b to the program fetch bus. 2 and the program C is executed. In this state, the memory buses 12c, 1 of the RAMs 13c, 13d
2d is connected to the data access bus 3, and CP
U1 accesses the RAMs 13c and 13d with data necessary for executing the program C.

【0054】このプログラムCの実行終了後にプログラ
ムDを実行する。このときCPU1は、RAM13c,
13dに対しプログラムDの実行に必要なデータアクセ
スを行う。
After the execution of the program C is completed, the program D is executed. At this time, the CPU 1
Data access necessary for execution of the program D is performed on 13d.

【0055】プログラムDが終了し、メインプログラム
へ復帰後、メモリ部10のバス選択信号BSa〜BSd
はCPU1によりLレベルに設定され、RAM13a〜
13dのメモリバス12a〜12dがデータアクセス用
バス3に接続される。この状態でCPU1はプログラム
EをRAM13b,13cにロードし、このロード終了
後にバス選択信号BSaをHレベルに設定してメモリバ
ス12aをプログラムフェッチ用バス2に接続してプロ
グラムCを実行する。この状態ではRAM13dのメモ
リバス12dはデータアクセス用バス3に接続されてお
り、CPU1は、RAM13dに対しプログラムCの実
行に必要なデータアクセスを行う。
After the program D is completed and the program returns to the main program, the bus selection signals BSa to BSd of the memory section 10
Are set to L level by the CPU 1 and the RAMs 13a to 13a
The 13d memory buses 12a to 12d are connected to the data access bus 3. In this state, the CPU 1 loads the program E into the RAMs 13b and 13c, sets the bus selection signal BSa to H level after this loading is completed, connects the memory bus 12a to the program fetch bus 2, and executes the program C. In this state, the memory bus 12d of the RAM 13d is connected to the data access bus 3, and the CPU 1 accesses the RAM 13d with data necessary for executing the program C.

【0056】このプログラムCの実行終了後に、バス選
択信号BSb、BScをHレベルに設定してメモリバス
12b,12cをプログラムフェッチ用バス2に接続し
てプログラムEを実行する。CPU1は、RAM13d
に対しプログラムEの実行に必要なデータアクセスを行
う。
After the execution of the program C, the bus selection signals BSb and BSc are set to the H level, and the memory buses 12b and 12c are connected to the program fetch bus 2 to execute the program E. The CPU 1 has a RAM 13d
Performs data access necessary for execution of the program E.

【0057】以上述べたように、本発明のマイクロプロ
セッサは、CPUがハーバードアーキテクチャを採用
し、プログラムメモリ及びデータメモリとして複数の一
定容量のRAMを用い、プログラムに応じてバス切換レ
ジスタを設定することにより、これら複数のRAMのう
ちのいずれかをプログラム用メモリあるいはデータ用メ
モリに設定できる。このように、プログラムメモリ容量
とデータメモリ容量の管理をソフトウェアにより行える
ため、個々のプログラム毎に最適な容量比を設定でき、
かつ、プログラムを高速に実行できるというハーバード
アーキテクチャの特徴を保持することができる。
As described above, in the microprocessor of the present invention, the CPU adopts the Harvard architecture, uses a plurality of fixed-capacity RAMs as the program memory and the data memory, and sets the bus switching register according to the program. Thereby, any of the plurality of RAMs can be set as a program memory or a data memory. In this way, since the program memory capacity and the data memory capacity can be managed by software, the optimal capacity ratio can be set for each program,
In addition, the feature of the Harvard architecture that a program can be executed at high speed can be maintained.

【0058】すなわち、本発明の第1の効果は、様々な
プログラムサイズとデータサイズのプログラムを、限ら
れた容量のRAMにソフトウェアによりロードして実行
するマイクロプロセッサにおいて、プログラムの内容に
応じてプログラムRAMとデータRAMの容量比を可変
できるので、限られた容量のメモリを有効利用できるこ
とである。
That is, a first effect of the present invention is that a microprocessor that loads programs of various program sizes and data sizes into a limited-capacity RAM by software and executes the programs according to the contents of the programs. Since the capacity ratio between the RAM and the data RAM can be varied, a limited capacity memory can be used effectively.

【0059】その理由は、複数のRAMの各々をプログ
ラムフェッチ用バスとデータアクセス用バスのいずれに
も接続可能として、プログラムサイズが小さく所要メモ
リ容量が少なくて済む場合には、そのプログラムサイズ
分の容量に対応する数のRAM以外の剰余のRAMをデ
ータ用とし、逆に、データの所要メモリ容量が少ない場
合は、そのデータサイズ分の容量に対応する数のRAM
以外の剰余のRAMをプログラム用として利用できるた
めである。
The reason is that each of the plurality of RAMs can be connected to either the program fetch bus or the data access bus, and if the program size is small and the required memory capacity is small, the program size can be reduced. A surplus RAM other than the number of RAMs corresponding to the capacity is used for data. Conversely, if the required memory capacity of data is small, the number of RAMs corresponding to the data size is used.
This is because a surplus RAM other than the above can be used for the program.

【0060】第2の効果は、第1の効果を得ながらも、
プログラムの実行速度が低下しないことである。
The second effect is that while obtaining the first effect,
That is, the execution speed of the program does not decrease.

【0061】その理由は、RAMに接続されるバスを切
り替えることにより、プログラムはプログラムフェッチ
用バス経由でのみ実行し、データはデータアクセス用バ
ス経由でのみアクセスを行うというハーバードアーキテ
クチャの特徴を保持することが可能となるためである。
The reason is that by switching the bus connected to the RAM, the program can be executed only via the program fetch bus, and the data can be accessed only via the data access bus. This is because it becomes possible.

【0062】以上本発明の実施の形態を述べたが、本発
明は上記実施の形態に限られることなく種々の変形が可
能である。例えば、RAMの数は4つの場合について説
明したが、RAMの数に制限はない。
Although the embodiments of the present invention have been described above, the present invention is not limited to the above embodiments, and various modifications can be made. For example, although the case where the number of RAMs is four has been described, the number of RAMs is not limited.

【0063】また、各RAMの容量が1KBの場合につ
いて説明したが個々のRAMの容量についても制限はな
い。
The case where the capacity of each RAM is 1 KB has been described, but the capacity of each RAM is not limited.

【0064】また、電源投入直後にCPU1が実行する
プログラムは、他のバスに接続されたメモリに入ってい
てもよい。
The program executed by the CPU 1 immediately after turning on the power may be stored in a memory connected to another bus.

【0065】また、プログラムサイズとデータサイズに
ついても実施例で示したものに限る必要がなく、本発明
の主旨を逸脱しない限り自由に設定できることは勿論で
ある。
Further, the program size and the data size need not be limited to those shown in the embodiments, and can be freely set without departing from the gist of the present invention.

【0066】[0066]

【発明の効果】以上説明したように、本発明のマイクロ
プロセッサ及びそのプログラム命令とデータの格納方法
は、メモリ部が、プログラム又はデータを格納保持する
それぞれ一定容量のN個のRAMと、このN個のRAM
の各々を個別にプログラムフェッチ用バスとデータアク
セス用バスとのいずれか一方に選択的に接続するRAM
切換手段とを備え、N個のRAMの各々をプログラムフ
ェッチ用バスとデータアクセス用バスのいずれにも接続
可能として、プログラムサイズが小さく所要メモリ容量
が少なくて済む場合には、そのプログラムサイズ分の容
量に対応する数のRAM以外の剰余のRAMをデータ用
とし、逆に、データの所要メモリ容量が少ない場合は、
そのデータサイズ分の容量に対応する数のRAM以外の
剰余のRAMをプログラム用として利用できるため、プ
ログラムの内容に応じてプログラムRAMとデータRA
Mの容量比を可変できるので、限られた容量のメモリを
有効利用できるという効果がある。
As described above, according to the microprocessor of the present invention and its method of storing program instructions and data, the memory section comprises N RAMs each having a fixed capacity for storing and holding a program or data; RAM
, Each of which is selectively connected to one of a program fetch bus and a data access bus individually.
Switching means, each of the N RAMs can be connected to either the program fetch bus or the data access bus. If the program size is small and the required memory capacity is small, then The remaining RAM other than the number of RAMs corresponding to the capacity is used for data, and conversely, if the required memory capacity of data is small,
A surplus RAM other than the number of RAMs corresponding to the capacity of the data size can be used for the program.
Since the capacity ratio of M can be changed, there is an effect that a memory having a limited capacity can be used effectively.

【0067】また、RAMに接続されるバスを切り替え
ることにより、プログラムはプログラムフェッチ用バス
経由でのみ実行し、データはデータアクセス用バス経由
でのみアクセスを行うというハーバードアーキテクチャ
の特徴を保持することが可能となるため、プログラムの
実行速度が低下することなく高性能を発揮できるという
効果がある。
By switching the bus connected to the RAM, the program can be executed only via the program fetch bus, and the data can be accessed only via the data access bus. As a result, there is an effect that high performance can be exhibited without lowering the execution speed of the program.

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

【図1】本発明のマイクロプロセッサの一実施の形態を
示すブロック図である。
FIG. 1 is a block diagram illustrating an embodiment of a microprocessor according to the present invention.

【図2】本実施の形態のマイクロプロセッサにおける第
1の実施例の動作の一例を示すフローチャートである。
FIG. 2 is a flowchart illustrating an example of the operation of the first example in the microprocessor of the present embodiment;

【図3】本実施例のプログラムを実行する際に必要とな
るメモリ容量を模式的に示す説明図である。
FIG. 3 is an explanatory diagram schematically showing a memory capacity required when executing a program according to the embodiment.

【図4】本実施例の動作の一例を示すタイムチャートで
ある。
FIG. 4 is a time chart illustrating an example of the operation of the present embodiment.

【図5】本実施の形態のマイクロプロセッサにおける第
2の実施例のプログラムを実行する際に必要となるメモ
リ容量を模式的に示す説明図である。
FIG. 5 is an explanatory diagram schematically showing a memory capacity required for executing a program of a second example in the microprocessor of the present embodiment.

【図6】本実施例の動作の一例を示すフローチャートで
ある。
FIG. 6 is a flowchart illustrating an example of the operation of the present embodiment.

【図7】本実施例の動作の一例を示すタイムチャートで
ある。
FIG. 7 is a time chart showing an example of the operation of the present embodiment.

【図8】従来の第1のマイクロプロセッサの一例を示す
ブロック図である。
FIG. 8 is a block diagram illustrating an example of a conventional first microprocessor.

【図9】プログラムとデータの各サイズの異なる複数の
プログラムを切り替えて実行する場合のプログラムRA
MとデータRAMの必要メモリ容量の一例を示す説明図
である。
FIG. 9 shows a program RA in a case where a plurality of programs having different sizes of a program and data are switched and executed.
FIG. 3 is an explanatory diagram showing an example of a required memory capacity of M and a data RAM.

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

1,101 CPU 2,102 プログラムフェッチ用バス 3,103 データアクセス用バス 4,104 内部バス 7,107 バスコントローラ 8 汎用バス 9 外部メモリ 10 メモリ部 11a〜11d バス切換器 12A〜12d メモリバス 13a〜13d RAM 14 切換レジスタ 20,100 マイクロプロセッサ 105 プログラムRAM 106 データRAM DESCRIPTION OF SYMBOLS 1, 101 CPU 2, 102 Bus for program fetch 3, 103 Bus for data access 4, 104 Internal bus 7, 107 Bus controller 8 General-purpose bus 9 External memory 10 Memory unit 11a-11d Bus switcher 12A-12d Memory bus 13a- 13d RAM 14 switching register 20, 100 microprocessor 105 program RAM 106 data RAM

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】 メモリ部に別々に格納したプログラム命
令とデータをプログラムフェッチ用バスとデータアクセ
ス用バスと内部バスとを独立して同時に制御して前記プ
ログラム命令と前記データを同時にアクセス可能とする
ハーバードアーキテクチャを採用したCPUを備えるマ
イクロプロセッサにおいて、 前記メモリ部が、プログラム又はデータを格納保持する
それぞれ一定容量のN(Nは3以上の整数)個のRAM
と、 前記N個のRAMの各々を個別に前記プログラムフェッ
チ用バスとデータアクセス用バスとのいずれか一方に選
択的に接続するRAM切換手段とを備え、 前記プログラムフェッチ用バスに接続した方のRAMに
は前記プログラム命令を前記データアクセス用バスに接
続した方のRAMには前記データをそれぞれ格納するこ
とによりプログラム命令とデータの各々の格納用メモリ
の容量比を最適に設定することを特徴とするマイクロプ
ロセッサ。
1. A program fetch bus, a data access bus, and an internal bus for program instructions and data separately stored in a memory unit are simultaneously and independently controlled so that the program instructions and the data can be accessed simultaneously. In a microprocessor including a CPU employing a Harvard architecture, the memory unit includes N (N is an integer of 3 or more) RAMs each storing a program or data and having a fixed capacity.
And RAM switching means for selectively connecting each of the N RAMs individually to one of the program fetch bus and the data access bus. The program instruction is stored in the RAM in which the program instruction is connected to the data access bus, and the data is stored in the RAM, so that the capacity ratio of the memory for storing the program instruction and the data is optimally set. Microprocessor.
【請求項2】 前記RAM切換手段が、前記内部バスに
接続されこの内部バスを経由して前記CPUから設定さ
れたバス切換値に対応するN個のバス選択信号を出力す
るバス切換レジスタと、 それぞれ前記プログラムフェッチ用バスと前記データア
クセス用バスに接続され前記バス選択信号の各々のレベ
ルに従い前記プログラムフェッチ用バスと前記データア
クセス用バスのいずれか一方を選択するN個のバス切換
器と、 前記バス切換器の各々と前記RAMの各々とをそれぞれ
接続するN個のメモリバスとを備える特徴とする請求項
1記載のマイクロプロセッサ。
2. A bus switching register connected to the internal bus, the RAM switching means outputting N bus selection signals corresponding to a bus switching value set from the CPU via the internal bus; N bus switches connected to the program fetch bus and the data access bus, respectively, for selecting one of the program fetch bus and the data access bus according to each level of the bus selection signal; 2. The microprocessor according to claim 1, further comprising N memory buses respectively connecting each of said bus switches and each of said RAMs.
【請求項3】 チップ外部の汎用バスと、 前記内部バスに接続されこの内部バスと前記汎用バスと
の間でデータ転送を行うとともにこの汎用バスを制御す
るバスコントローラと、 前記汎用バスに接続され前記CPUが実行する前記プロ
グラム命令とデータを格納したチップ外部の外部メモリ
とを備えることを特徴とする請求項1記載のマイクロプ
ロセッサ。
3. A general-purpose bus external to the chip, a bus controller connected to the internal bus for performing data transfer between the internal bus and the general-purpose bus and controlling the general-purpose bus, and connected to the general-purpose bus. 2. The microprocessor according to claim 1, further comprising: an external memory external to a chip that stores the program instructions executed by the CPU and data.
【請求項4】 プログラム又はデータを格納保持するそ
れぞれ一定容量のN(Nは3以上の整数)個のRAMを
備えるメモリ部に別々に格納したプログラム命令とデー
タをプログラムフェッチ用バスとデータアクセス用バス
と内部バスとを独立して同時に制御して前記プログラム
命令と前記データを同時にアクセス可能とするハーバー
ドアーキテクチャを採用したCPUを備えるマイクロプ
ロセッサのプログラムサイズとデータサイズの異なる複
数のプログラムを切り替えて実行する場合における前記
メモリ部へのプログラム命令とデータの格納方法におい
て、 前記N個のRAMのうち前記複数のプログラムの実行順
序に応じて順次前記複数のプログラムの各々のプログラ
ムサイズに対応するメモリ容量を満足する個数の前記R
AMに前記プログラムフェッチ用バスを接続してプログ
ラム格納用メモリに設定し、前記プログラム格納用メモ
リに設定したRAM以外のRAMにデータアクセス用バ
スを接続してデータ格納用メモリに設定することにより
プログラム命令とデータの各々の格納用メモリの容量比
を最適に設定することを特徴とするマイクロプロセッサ
のプログラム命令とデータの格納方法。
4. Program instructions and data separately stored in a memory unit having N (N is an integer of 3 or more) RAMs each having a fixed capacity for storing and holding a program or data are stored in a memory section for program fetch and data access. A plurality of programs having different program sizes and data sizes of a microprocessor including a CPU employing a Harvard architecture that controls the bus and the internal bus independently and simultaneously to allow simultaneous access to the program instruction and the data are executed. In the method of storing program instructions and data in the memory unit, the memory capacity corresponding to the program size of each of the plurality of programs is sequentially determined according to the execution order of the plurality of programs among the N RAMs. Satisfying number of R
By connecting the program fetch bus to the AM and setting it as a program storage memory, and connecting a data access bus to a RAM other than the RAM set as the program storage memory and setting it as a data storage memory, A method for storing a program instruction and data of a microprocessor, wherein the ratio of the capacity of each memory for storing the instruction and the data is set optimally.
【請求項5】 前記複数のプログラムが、プログラムサ
イズとデータサイズの異なる第1のプログラムと第2の
プログラムであり、 前記N個のRAMの全てに前記データアクセス用バスを
接続して前記データの格納用に設定する初期設定処理で
ある第1のステップと、 前記第1のプログラムのプログラムサイズに対応するメ
モリ容量を満たすよう第1の個数の前記RAMに前記プ
ログラムフェッチ用バスを接続し前記第1のプログラム
を格納するよう設定する第2のステップと、 前記第1のプログラムを実行する第3のステップと、 前記第1のプログラムの終了後、前記N個のRAMの全
てに前記データアクセス用バスを接続して前記データの
格納用に設定する第4のステップと、 前記第2のプログラムのプログラムサイズに対応するメ
モリ容量を満たすよう第2の個数の前記RAMに前記プ
ログラムフェッチ用バスを接続し前記第2のプログラム
を格納するよう設定する第5のステップと、 前記第2のプログラムを実行する第6のステップとを有
することを特徴とする請求項4記載のマイクロプロセッ
サのプログラム命令とデータの格納方法。
5. The program according to claim 1, wherein the plurality of programs are a first program and a second program having different program sizes and data sizes, and the data access bus is connected to all of the N RAMs. A first step of an initial setting process for setting for storage, and connecting the program fetch bus to the first number of RAMs so as to satisfy a memory capacity corresponding to a program size of the first program. A second step of setting the first program to be stored; a third step of executing the first program; and after the first program has ended, the data access to all of the N RAMs is performed. A fourth step of connecting a bus and setting the data to be stored; and a memo corresponding to the program size of the second program. A fifth step of connecting the program fetch bus to the second number of RAMs so as to satisfy a capacity and setting the second program to be stored, and a sixth step of executing the second program. 5. The method according to claim 4, further comprising: storing a program instruction and data in the microprocessor.
【請求項6】 前記複数のプログラムが、プログラムサ
イズとデータサイズが異なり常時前記メモリ部に保持す
る第1のプログラムと必要に応じてロードされる第2の
プログラム及び第3のプログラムであり、 前記N個のRAMの全てに前記データアクセス用バスを
接続して前記データの格納用に設定する初期設定処理で
ある第1のステップと、 前記第1のプログラムのプログラムサイズに対応するメ
モリ容量を満たすよう第1の個数の前記RAMに前記プ
ログラムフェッチ用バスを接続し前記第1のプログラム
を格納し、前記第2のプログラムのプログラムサイズに
対応するメモリ容量を満たすよう第2の個数の前記RA
Mに前記プログラムフェッチ用バスを接続し前記第2の
プログラムを格納するようそれぞれ設定する第2のステ
ップと、 前記第1のプログラムを実行する第3のステップと、 前記第1のプログラムの終了後、前記第2のプログラム
を実行する第4のステップと、 前記第2のプログラムの終了後、前記N個のRAMの全
てに前記データアクセス用バスを接続して前記データの
格納用に設定する第5のステップと、 前記第1のプログラムのプログラムサイズに対応するメ
モリ容量を満たすよう第1の個数の前記RAMに前記プ
ログラムフェッチ用バスを接続し前記第1のプログラム
を格納し、前記第3のプログラムのプログラムサイズに
対応するメモリ容量を満たすよう第3の個数の前記RA
Mに前記プログラムフェッチ用バスを接続し前記第3の
プログラムを格納するようそれぞれ設定する第6のステ
ップと、 前記第1のプログラムを実行する第7のステップと、 前記第1のプログラムの終了後、前記第3のプログラム
を実行する第8のステップとを有することを特徴とする
請求項4記載のマイクロプロセッサのプログラム命令と
データの格納方法。
6. The plurality of programs are a first program which is different in program size and data size and is always stored in the memory unit, and a second program and a third program which are loaded as needed. A first step which is an initial setting process for connecting the data access bus to all of the N RAMs and setting the data to be stored, and satisfying a memory capacity corresponding to a program size of the first program The program fetch bus is connected to a first number of the RAMs to store the first program, and a second number of the RAs are stored so as to satisfy a memory capacity corresponding to a program size of the second program.
A second step of connecting the program fetch bus to M to store the second program, a third step of executing the first program, and after the first program ends A fourth step of executing the second program, and after completion of the second program, connecting the data access bus to all of the N RAMs and setting for storing the data. 5) connecting the program fetch bus to a first number of the RAMs so as to satisfy a memory capacity corresponding to a program size of the first program, storing the first program, and A third number of the RAs is set to satisfy a memory capacity corresponding to a program size of a program.
A sixth step of connecting the program fetch bus to M to store the third program, a seventh step of executing the first program, and after the first program ends The method according to claim 4, further comprising an eighth step of executing the third program.
JP2000009444A 2000-01-18 2000-01-18 Microprocessor, and its program instruction and data storing method Pending JP2001202285A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000009444A JP2001202285A (en) 2000-01-18 2000-01-18 Microprocessor, and its program instruction and data storing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000009444A JP2001202285A (en) 2000-01-18 2000-01-18 Microprocessor, and its program instruction and data storing method

Publications (1)

Publication Number Publication Date
JP2001202285A true JP2001202285A (en) 2001-07-27

Family

ID=18537593

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000009444A Pending JP2001202285A (en) 2000-01-18 2000-01-18 Microprocessor, and its program instruction and data storing method

Country Status (1)

Country Link
JP (1) JP2001202285A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007004350A (en) * 2005-06-22 2007-01-11 Nec Electronics Corp Method for executing temporary use program, microprocessor system, information processor and program
JP2007109008A (en) * 2005-10-13 2007-04-26 Renesas Technology Corp Semiconductor storage device, arithmetic processing unit, and storage system
CH699208A1 (en) * 2008-07-25 2010-01-29 Em Microelectronic Marin Sa shared memory processor and buffer system circuit.
CH699207A1 (en) * 2008-07-25 2010-01-29 Em Microelectronic Marin Sa shared memory processor circuit.

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007004350A (en) * 2005-06-22 2007-01-11 Nec Electronics Corp Method for executing temporary use program, microprocessor system, information processor and program
JP2007109008A (en) * 2005-10-13 2007-04-26 Renesas Technology Corp Semiconductor storage device, arithmetic processing unit, and storage system
CH699208A1 (en) * 2008-07-25 2010-01-29 Em Microelectronic Marin Sa shared memory processor and buffer system circuit.
CH699207A1 (en) * 2008-07-25 2010-01-29 Em Microelectronic Marin Sa shared memory processor circuit.

Similar Documents

Publication Publication Date Title
US7783827B2 (en) Data processor having a memory controller with cache memory
JP2004502224A (en) Integrated circuit with flash bridge and autoload
CN100533428C (en) Semiconductor device
JPH0877098A (en) Data processor with controlled burst memory access and its method
JP2009505180A (en) Storage device formed in a computer system having at least two processing units and at least one memory, and storage method thereby
JP2001202285A (en) Microprocessor, and its program instruction and data storing method
JP2000207281A (en) Processor and method for data processing
JP4071930B2 (en) Synchronous DRAM
JP2000207203A (en) Micro controller
JP2004192051A (en) Shared terminal controller
JP3422308B2 (en) Data processing device
JP2008176518A (en) Microcomputer
JP3206960B2 (en) Extended central processing unit
US7136965B2 (en) Microcomputer
WO2003088036A1 (en) System and method for instruction level multithreading
JPH0333951A (en) Microcomputer system
JPS6014435B2 (en) Storage device
JPH03214275A (en) Semiconductor integrated circuit
JPH0251724A (en) disk controller
JPH0877072A (en) Cache memory device
JP2003228546A (en) Direct memory access controller
JP2012234417A (en) Processor, multiprocessor system, and memory control method
JPH11143770A (en) Multi-bank dram controller
JPH0756807A (en) Memory bank automatic switching system
JP2003296105A (en) Data processing device

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20021001