JPH1165923A - Arithmetic processing unit and memory access method - Google Patents

Arithmetic processing unit and memory access method

Info

Publication number
JPH1165923A
JPH1165923A JP21962397A JP21962397A JPH1165923A JP H1165923 A JPH1165923 A JP H1165923A JP 21962397 A JP21962397 A JP 21962397A JP 21962397 A JP21962397 A JP 21962397A JP H1165923 A JPH1165923 A JP H1165923A
Authority
JP
Japan
Prior art keywords
data
register
stored
address
memory
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
JP21962397A
Other languages
Japanese (ja)
Inventor
Yoshihiko Imamura
義彦 今村
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.)
Sony Corp
Original Assignee
Sony Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sony Corp filed Critical Sony Corp
Priority to JP21962397A priority Critical patent/JPH1165923A/en
Publication of JPH1165923A publication Critical patent/JPH1165923A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To improve a processing capability by comparing a leading address with an address from a data pointer(DP) register, discriminating a page to be accessed from plural banks, and transferring data to a data register. SOLUTION: Banks 45 and 46 of an inside memory 47 store pages with prescribed data amounts stored in continuous addresses on a memory address space, and DP registers 30 and 31 store addresses on the memory address space. Data registers r0 and r1 transfer data between the inside memory 47 and an ALU 13 for operating an arithmetic processing. The leading addresses of the pages stored in the banks 45 and 46 are compared with addresses stored in DP registers 30 and 31, and whether or not pages to be accesses are present in the banks 45 and 46 is discriminated. When the pages to be accesses are present, the pages to be accessed are data-transferred from the banks 45 and 46 to the data register by using the addresses stored in the DP registers 30 and 31.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は演算処理装置および
メモリアクセス方法に関する。
The present invention relates to an arithmetic processing unit and a memory access method.

【0002】[0002]

【従来の技術】マイクロプロセッサを、一般的な設計思
想によって分類すると、例えば、RISC(Reduced Ins
truction Set Computer)型と、CISC(Complex Instr
uctionSet Computer)型とに分けられる。ところで、マ
イクロプロセッサ単体の性能を決めるプログラム実行時
間は下記式(1)で示される
2. Description of the Related Art Microprocessors can be classified according to a general design concept, for example, RISC (Reduced Insulated).
truction Set Computer) and CISC (Complex Instr
uctionSet Computer) type. By the way, the program execution time which determines the performance of the microprocessor alone is expressed by the following equation (1).

【0003】[0003]

【数1】 プログラム実行時間=実行命令数(IC)×1命令当たりの平均所要クロック サイクル数(CPI)×クロックサイクル時間(CCT) …(1)## EQU1 ## Program execution time = number of executed instructions (IC) × average number of required clock cycles per instruction (CPI) × clock cycle time (CCT) (1)

【0004】RISC型のマイクロプロセッサは、命令
パイプライン処理を駆使して、上記式(1)のCPIを
可能な限り1に近づけることを設計思想としている。そ
のため、RISC型のマイクロプロセッサでは、命令パ
イプライン処理に適するように命令の機能を単純化する
という観点から、命令を固定単一長とし、命令形式とし
てレジスタ−レジスタ形式(ロード/ストア型アーキテ
クチャ:演算命令のソースオペランドはレジスタオペラ
ンドのみ)を採用している。また、RISC型のマイク
ロプロセッサでは、命令パイプライン処理が滞らないよ
うにコンパイラによる静的コードスケジューリングを行
う。
The design concept of the RISC microprocessor is to make the CPI of the above equation (1) as close to 1 as possible by making full use of instruction pipeline processing. Therefore, in the RISC type microprocessor, from the viewpoint of simplifying the function of the instruction so as to be suitable for the instruction pipeline processing, the instruction has a fixed single length, and the instruction format is a register-register format (load / store architecture: The source operand of the operation instruction is a register operand only). In a RISC microprocessor, static code scheduling is performed by a compiler so that instruction pipeline processing is not delayed.

【0005】これに対して、CISC型のマイクロプロ
セッサは、命令の機能レベルを上げて上記式(1)のI
Cを削減することを設計思想としている。そのため、C
ISC型のマイクロプロセッサでは、命令を固定複数長
あるいは可変長とし、命令形式には、レジスタ−メモリ
形式と、メモリ−メモリ形式(演算命令のソースオペラ
ンドにメモリオペランドも可能)とが混在している。す
なわち、レジスタとメモリとの直接的な演算を可能とし
ている。
On the other hand, in the CISC type microprocessor, the function level of the instruction is increased to increase the I level of the above equation (1).
The design philosophy is to reduce C. Therefore, C
In an ISC-type microprocessor, instructions are of fixed length or variable length, and instruction formats include a register-memory format and a memory-memory format (a memory operand can be used as a source operand of an operation instruction). . That is, direct operation between the register and the memory is enabled.

【0006】ところで、メモリ上のデータをALU(Ari
thmetic Logic Unit) 演算の対象にした場合、RISC
型のマイクロプロセッサでは、メモリアクセスを行うた
めに、ロード命令とストア命令の2つが最低必要であ
る。これに対して、CISC型のマイクロプロセッサで
は、メモリアクセスのためのみの命令は必要ではない。
CISC型のマイクロプロセッサでは、メモリアドレス
を指定するための命令中のビットフィールドが多く必要
であり、前述したように可変長命令を採用することが多
い。しかしながら、可変長命令を用いると、デコード回
路が複雑かつ大規模になる傾向がある。そのため、CI
SC型のマイクロプロセッサでは、プログラム実行時間
を短縮するために、スーパースケーラ技術やアウトオブ
オーダ技術を用いてメモリ上のデータに対する演算を加
速させているのが現状である。
By the way, the data on the memory is transferred to ALU (Ari
thmetic Logic Unit)
In a microprocessor of the type, at least two of a load instruction and a store instruction are required to perform a memory access. On the other hand, in a CISC type microprocessor, an instruction only for memory access is not required.
In a CISC type microprocessor, many bit fields are required in an instruction for specifying a memory address, and a variable length instruction is often employed as described above. However, when a variable length instruction is used, the decoding circuit tends to be complicated and large. Therefore, CI
At present, in the SC type microprocessor, in order to reduce the program execution time, the operation on the data on the memory is accelerated using a superscaler technique or an out-of-order technique.

【0007】以下、従来のRISC型およびCISC型
のマイクロプロセッサにおけるメモリアクセス方法につ
いて説明する。図26は、従来のRISC型およびCI
SC型のマイクロプロセッサの汎用レジスタを説明する
ための図である。図26に示すように、従来のマイクロ
プロセッサには、例えば、16本の汎用レジスタセット
が備えられ、それら16本の汎用レジスタに、r0から
r15までの名前が付されていると仮定する。これらの
レジスタは、3オペランド演算命令セットのプロセッサ
アーキテクチャに実装する場合には、2個のリードポー
トと1個のライトポートとの合計3ポートが必要であ
る。
A memory access method in a conventional RISC type and CISC type microprocessor will be described below. FIG. 26 shows a conventional RISC type and CI
FIG. 2 is a diagram for explaining general-purpose registers of an SC type microprocessor. As shown in FIG. 26, it is assumed that the conventional microprocessor is provided with, for example, 16 general-purpose register sets, and the 16 general-purpose registers are given names r0 to r15. When these registers are implemented in a processor architecture of a three-operand operation instruction set, a total of three ports of two read ports and one write port are required.

【0008】3オペランド演算命令では、図27に示す
ように、ALU演算命令のレジスタ指定子を3個指定で
きる。なお、図27において、「;」の右側に
は、「;」の左側に記述された命令についてのコメント
文が記述されている。図27に示す命令は、「r2←r
3+r4」を実行する命令である。r0からr15まで
のレジスタは汎用として、値を一時的に保持する目的と
して使用される。また、ロード/ストア型アーキテクチ
ュアを採用しているプロセッサでは、メモリのロード/
ストアを実現するために汎用レジスタに対してロード/
ストア命令を実行する。直接、ALU演算器に代入する
ような命令はない。このタイプは、RISC型のプロセ
ッサに多く見られる。図28に示すように、メモリ上の
データを加工する場合、一旦、ロード命令「lw r
3,0(r10)」を実行する必要がある。これに対し
て、CISC型のプロセッサにはメモリ上のデータをA
LU演算命令のオペランドとして指定することができる
ものがある。しかし、その場合、汎用レジスタを使用せ
ずにメモリバッファを直接使用することになる。
In the three-operand operation instruction, as shown in FIG. 27, three register specifiers of the ALU operation instruction can be specified. In FIG. 27, on the right side of “;”, a comment sentence for the instruction described on the left side of “;” is described. The instruction shown in FIG. 27 is “r2 ← r
3 + r4 ”. The registers r0 to r15 are used for general purpose and for temporarily holding the values. In a processor employing a load / store type architecture, a memory load / store
Load / load to general purpose registers to implement store
Execute the store instruction. There is no instruction to directly substitute the ALU. This type is often found in RISC type processors. As shown in FIG. 28, when processing the data on the memory, the load instruction “lwr
3,0 (r10) ". On the other hand, the CISC type processor stores the data on the memory as A
Some can be specified as an operand of an LU operation instruction. However, in that case, the memory buffer is directly used without using the general-purpose register.

【0009】以下、従来のRISC型プロセッサのパイ
プライン処理について説明する。RISC型プロセッサ
では、5段あるいは8段パイプライン構造となっている
ものが多い。例えば、MIPS社のR3000(商標
名)は、図29に示すように、IF(Instruction Fetc
h) ステージ、DEC(Instruction Decode)ステージ、
ALUステージ、MEM(Memory)ステージおよびWB(W
rite Back)ステージの5段パイプラインを採用してい
る。このプロセッサでは、1段目のIFステージで命令
をフェッチし(読み込み)、2段目のDECステージで
命令をデコードする。なお、汎用レジスタをソースレジ
スタとして指定した命令であれば、DECステージで命
令をデコードした後に、汎用レジスタからデータを読み
出す。次に、3段目のALUステージで、ALU演算命
令を実行する。なお、フェッチした命令がALU命令で
ない場合は、ALUステージでは何も行わないので、デ
ータをALUの出力ポートにそのまま出力する。
Hereinafter, the pipeline processing of the conventional RISC type processor will be described. Many RISC processors have a five-stage or eight-stage pipeline structure. For example, as shown in FIG. 29, R3000 (trade name) of MIPS Co., Ltd.
h) Stage, DEC (Instruction Decode) stage,
ALU stage, MEM (Memory) stage and WB (W
rite Back) A five-stage pipeline is used. In this processor, an instruction is fetched (read) in the first IF stage and decoded in the second DEC stage. If the instruction specifies a general-purpose register as a source register, the instruction is decoded in the DEC stage, and then data is read from the general-purpose register. Next, an ALU operation instruction is executed in the third ALU stage. If the fetched instruction is not an ALU instruction, nothing is performed in the ALU stage, so that the data is output to the output port of the ALU as it is.

【0010】次に、4段目のMEMステージでは、フェ
ッチした命令がメモリアクセス命令であるときに、メモ
リアクセスのためのメモリアドレスをメモリユニットに
出力してメモリアクセスを実行する。次に、5段目で、
汎用レジスタをディスティネーションレジスタとして指
定した命令について、ALUの演算結果を汎用レジスタ
に書き戻す。メモリリード命令(ロード命令)であれ
ば、メモリユニットから値を受け取り汎用レジスタに書
き込む。図29に示すように、5段パイプラインを採用
したプロセッサでは、例えば、クロックサイクルXにお
いて、コードC1 のWBステージと、コードC2 のME
Mステージと、コードC3 のALUステージと、コード
4 のDECステージと、コードC5 のIFステージと
を多重化して行う。
Next, in the fourth MEM stage, when the fetched instruction is a memory access instruction, a memory address for memory access is output to the memory unit to execute the memory access. Next, at the fifth stage,
For an instruction that designates a general-purpose register as a destination register, the operation result of the ALU is written back to the general-purpose register. If it is a memory read instruction (load instruction), it receives a value from the memory unit and writes it to a general-purpose register. As shown in FIG. 29, the processor employing the 5-stage pipeline, for example, in a clock cycle X, and WB stages of the code C 1, code C 2 ME
And M stage, and ALU stage code C 3, and DEC stage code C 4, and the IF stage of the code C 5 performed by multiplexing.

【0011】ところで、前述したようにRISC型プロ
セッサでは、ロード/ストア型命令セットアーキテクチ
ュアを採用していることから、ALU演算命令とロード
/ストア命令とが分離して各々独立して存在している。
そのため、これらの命令を含めて任意の命令を多重化す
るためには、例えば、図29に示す5段パイプライン構
造にすることが都合がよい。すなわち、メモリアクセス
命令とその他の命令とを同時に実行することができる。
メモリアクセスのパスは1系統(1セット)のみ存在す
ることを前提としているので、メモリリードとメモリラ
イトとを同じMEMステージで同時に実行することはな
い。また、メモリアクセス命令とそれ以外の命令とを各
々単独で扱うと、使用しないパイプラインステージが生
じてしまう。例えば、レジスタ間転送命令では、MEM
ステージの機能は使用されない。また、メモリアクセス
命令では、ALUステージの機能を使用しない。なお、
メモリアクセスのためのアドレス生成演算は、ALU以
外の別のユニットで行われる。
Since the load / store type instruction set architecture is adopted in the RISC processor as described above, the ALU operation instruction and the load / store instruction are separated and exist independently of each other. .
Therefore, in order to multiplex arbitrary instructions including these instructions, for example, it is convenient to adopt a five-stage pipeline structure shown in FIG. That is, the memory access instruction and other instructions can be executed simultaneously.
Since it is assumed that there is only one system (one set) of memory access paths, a memory read and a memory write are not executed simultaneously in the same MEM stage. In addition, if a memory access instruction and other instructions are handled independently, an unused pipeline stage occurs. For example, in a transfer instruction between registers, MEM
Stage functionality is not used. In the memory access instruction, the function of the ALU stage is not used. In addition,
The address generation operation for memory access is performed in another unit other than the ALU.

【0012】図29に示す5段パイプライン処理では、
メモリ上のデータをALU演算の対象にした場合に、例
えば図30に示すようにプログラムを記述する。図30
に示すプログラムでは、先ず、命令「lw r2, 0
(r10)」によって、レジスタr10が示すメモリア
ドレス上のデータをレジスタr2にロードする。次に、
命令「addu r3,r2,r9」によって、レジス
タr2とレジスタr9の値を加算し、その結果をレジス
タr3に代入する。次に、命令「sw r3,0(r1
1)」によって、レジスタr3の値をレジスタr11が
示すメモリアドレスにストアする(書き戻す)。これら
の操作を3命令で記述している。各命令とも実行には最
低1クロックサイクルを必要とするので、3命令を実行
するには、3クロックサイクルを必要とする。実際に
は、メモリリード(ロード)したデータは、その直後の
命令で参照できないので、もう1クロックサイクル必要
である。
In the five-stage pipeline processing shown in FIG.
When the data on the memory is subjected to the ALU operation, a program is described, for example, as shown in FIG. FIG.
In the program shown in FIG. 1, first, the instruction “lw r2, 0
(R10) "loads the data on the memory address indicated by the register r10 into the register r2. next,
The instruction “addu r3, r2, r9” adds the values of the register r2 and the register r9, and assigns the result to the register r3. Next, the instruction “sw r3,0 (r1
1), the value of the register r3 is stored (rewritten) at the memory address indicated by the register r11. These operations are described by three instructions. Each instruction requires at least one clock cycle to execute, so executing three instructions requires three clock cycles. Actually, the memory read (loaded) data cannot be referred to by the instruction immediately after that, so another clock cycle is required.

【0013】[0013]

【発明が解決しようとする課題】しかしながら、画像処
理や音声処理などのメディア処理では、連続したメモリ
アドレス空間上のデータに対して所定のALU演算を繰
り返して行う必要がある。この場合には、図31に示す
ように、図30に示すプログラムに対して、メモリアド
レスを更新するための命令「addi r10,4」お
よび命令「addi r11,4」をさらに加える必要
がある。その結果、図31に示すプログラムを実行する
のに、最低5クロックサイクル必要になり、処理時間が
長期化してしまうという問題がある。なお、図31で
は、加算演算のソースデータのメモリ上の開始アドレス
をレジスタr10を用いて設定し、ディスティネーショ
ンデータの開始アドレスをレジスタr11を用いて設定
している。
However, in media processing such as image processing and audio processing, it is necessary to repeatedly perform a predetermined ALU operation on data in a continuous memory address space. In this case, as shown in FIG. 31, it is necessary to further add an instruction “addi r10, 4” and an instruction “addi r11, 4” for updating the memory address to the program shown in FIG. As a result, at least five clock cycles are required to execute the program shown in FIG. 31, and there is a problem that the processing time becomes longer. In FIG. 31, the start address of the source data of the addition operation on the memory is set using the register r10, and the start address of the destination data is set using the register r11.

【0014】また、上述した従来のマイクロプロセッサ
における5段パイプライン処理では、メモリアクセスは
MEMステージで実行され、メモリアクセスのパスが1
系統しか設けられていないため、メモリリードとメモリ
ライトとを同時に実行できない。したがって、メモリリ
ード命令とメモリライト命令とを独立して記述したプロ
グラムを作成する必要があり、そのことが処理時間の短
縮を図るときのボトルネックとなっていた。なお、マイ
クロプロセッサでは、限られたレジスタ資源を効率的に
使用することがシステム設計において非常に重要であ
る。
In the above-described five-stage pipeline processing in the conventional microprocessor, memory access is executed in the MEM stage, and the memory access path is one.
Since only the system is provided, memory read and memory write cannot be executed simultaneously. Therefore, it is necessary to create a program in which a memory read instruction and a memory write instruction are described independently, which has been a bottleneck when shortening the processing time. It is very important for a microprocessor to efficiently use limited register resources in system design.

【0015】本発明は上述した従来技術の問題点に鑑み
てなされ、処理能力の向上を図れる演算処理装置および
メモリアクセス方法を提供する。また、本発明は、レジ
スタ資源を効率的に利用でき、特に汎用レジスタの機能
を適切に発揮できる演算処理装置およびメモリアクセス
方法を提供する。
The present invention has been made in view of the above-mentioned problems of the prior art, and provides an arithmetic processing device and a memory access method capable of improving processing performance. In addition, the present invention provides an arithmetic processing device and a memory access method that can efficiently use register resources and, in particular, can appropriately exhibit the functions of general-purpose registers.

【0016】[0016]

【課題を解決するための手段】上述した目的を達成する
ために、本発明の演算処理装置は、メモリアドレス空間
上の連続したアドレスに記憶された所定のデータ量のペ
ージをそれぞれ記憶する複数のバンクを備えた内部メモ
リと、前記メモリアドレス空間上のアドレスを記憶する
データポインタレジスタと、演算処理を行う演算手段
と、前記内部メモリおよび前記演算手段との間でデータ
の転送を行うデータレジスタと、前記複数のバンクに記
憶されたページの前記メモリアドレス空間内の先頭アド
レスを記憶し、当該記憶された先頭アドレスと、前記デ
ータポインタレジスタに記憶されたアドレスとを比較
し、前記比較の結果に基づいて前記複数のバンクのいず
れかにアクセス対象となるページが存在するか否かを判
別するページ有無判別手段と、前記判別の結果、アクセ
ス対象となるページが前記複数のバンクのいずれかに存
在する場合に、アクセス対象となるページが記憶された
バンクと前記データレジスタとの間で、前記データポイ
ンタレジスタに記憶されたアドレスを用いてデータの転
送を行うように制御する制御手段とを有する。
In order to achieve the above-mentioned object, an arithmetic processing unit according to the present invention comprises a plurality of pages each storing a predetermined amount of data stored at consecutive addresses in a memory address space. An internal memory having a bank, a data pointer register for storing an address in the memory address space, an arithmetic unit for performing arithmetic processing, and a data register for transferring data between the internal memory and the arithmetic unit. Storing a start address in the memory address space of the page stored in the plurality of banks, comparing the stored start address with an address stored in the data pointer register, and comparing the result of the comparison with the address stored in the data pointer register. Page presence / absence determination for determining whether there is a page to be accessed in any of the plurality of banks based on the plurality of banks And when the page to be accessed is present in any of the plurality of banks as a result of the determination, the data pointer register is provided between the bank in which the page to be accessed is stored and the data register. And control means for performing control to transfer data using the address stored in the memory.

【0017】本発明の演算処理装置では、ページ有無判
別手段によって、内部メモリの複数のバンクのうち何れ
のバンクに、演算手段からのアクセス対象となるページ
が含まれているかが判別され、その判別結果に基づい
て、単体のデータレジスタが、複数のバンクのうち、ア
クセス対象のページを記憶するバンクを選択して接続さ
れる。
In the arithmetic processing device according to the present invention, the page presence / absence determining means determines which of the plurality of banks of the internal memory contains a page to be accessed by the arithmetic means, and the determination is made. Based on the result, a single data register is selected and connected to a bank that stores a page to be accessed from a plurality of banks.

【0018】また、本発明のメモリアクセス方法は、演
算手段からデータレジスタを介して、メモリアドレス空
間上の連続したアドレスに記憶された所定のデータ量の
ページをそれぞれ記憶する複数のバンクを備えた内部メ
モリにアクセスするメモリアクセス方法であって、前記
メモリアドレス空間上のアドレスをデータポインタレジ
スタに記憶し、前記複数のバンクに記憶されたページの
前記メモリアドレス空間内の先頭アドレスを記憶し、当
該記憶された先頭アドレスと、前記データポインタレジ
スタに記憶されたアドレスとを比較し、前記比較の結果
に基づいて、前記複数のバンクのいずれかにアクセス対
象となるページが存在するか否かを判別し、前記判別の
結果、アクセス対象となるページが前記複数のバンクの
いずれかに存在する場合に、アクセス対象となるページ
が記憶されたバンクとデータレジスタとの間で、前記デ
ータポインタレジスタに記憶されたアドレスを用いてデ
ータの転送を行う。
Further, the memory access method of the present invention includes a plurality of banks for respectively storing pages of a predetermined data amount stored at consecutive addresses in the memory address space from the arithmetic means via the data register. A memory access method for accessing an internal memory, wherein an address in the memory address space is stored in a data pointer register, and a head address in the memory address space of a page stored in the plurality of banks is stored. The stored head address is compared with the address stored in the data pointer register, and based on a result of the comparison, it is determined whether a page to be accessed exists in any of the plurality of banks. As a result of the determination, the page to be accessed exists in any of the plurality of banks. Case, between the bank and the data register page to be accessed is stored, and transfers data using the address stored in the data pointer register.

【0019】[0019]

【発明の実施の形態】以下、本発明の実施形態に係わる
マイクロプロセッサについて説明する。第1実施形態 図1は、本実施形態のマイクロプロセッサ1の構成図で
ある。マイクロプロセッサ1は、図1に示す汎用レジス
タモジュール11、マルチプレクサ(MUX)12,1
6、ALU(Arithmetic Logic Unit) 13、インストラ
クションページメモリ35、デコーダ36と、図2に示
すDPレジスタ30,31および内部メモリ47を有
し、これらを1チップ内に組み込んだ構成をしている。
なお、マイクロプロセッサ1では、デコーダ36におけ
るデコード結果に応じた制御信号S36に基づいて、以
下に示す処理が行われる。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, a microprocessor according to an embodiment of the present invention will be described. First Embodiment FIG. 1 is a configuration diagram of a microprocessor 1 of the present embodiment. The microprocessor 1 includes a general-purpose register module 11, a multiplexer (MUX) 12, 1 shown in FIG.
6, an ALU (Arithmetic Logic Unit) 13, an instruction page memory 35, a decoder 36, the DP registers 30 and 31 and the internal memory 47 shown in FIG. 2, and these are incorporated in one chip.
In the microprocessor 1, the following processing is performed based on the control signal S36 according to the decoding result of the decoder 36.

【0020】汎用レジスタモジュール11は、汎用的に
使用される例えば32ビットの16個のレジスタr0
15で構成されるレジスタセットである。汎用レジスタ
モジュール11を構成するレジスタの数は、命令セット
あるいはチップアーキテクチュアに大きく依存し、一般
的には、8個から32個の範囲で設定される。汎用レジ
スタモジュール11は、図1に示すように、7個のポー
トW,RA,RB,MA,MB,DA,DBを備えてい
る。ここで、ポートWは、ライトポートであり、ALU
13のポートAOUTから出力されたデータが、バス2
3およびポートWを介して、汎用レジスタモジュール1
1に書き込まれる。また、ポートMA,MBは、図2に
示すように、それぞれ内部メモリ47のメモリバンク4
5,46との間のポートであり、それぞれバス26,2
7を介して、メモリバンク45,46のポートとの間で
データ転送を行う。なお、ポートMA,MBを設けず
に、汎用レジスタモジュール11の外部で、ポートR
A,RB,Wを切り替えて、メモリバンク45,46と
の接続を実現するような構成にしてもよい。
The general-purpose register module 11 has, for example, 16 32-bit registers r 0 to r 0 used for general purposes.
It is composed of a register set in r 15. The number of registers constituting the general-purpose register module 11 largely depends on the instruction set or the chip architecture, and is generally set in the range of 8 to 32. As shown in FIG. 1, the general-purpose register module 11 has seven ports W, RA, RB, MA, MB, DA, and DB. Here, port W is a write port and ALU
The data output from port AOUT of bus 13 is
3 and the general-purpose register module 1 via the port W
Written to 1. The ports MA and MB are connected to the memory banks 4 of the internal memory 47, respectively, as shown in FIG.
Ports between the buses 26 and 2 respectively.
7, data is transferred to and from the ports of the memory banks 45 and 46. It should be noted that the port R is provided outside the general-purpose register module 11 without providing the ports MA and MB.
A, RB, W may be switched to realize a connection with the memory banks 45, 46.

【0021】また、ポートRA,RBは、リードポート
であり、ポートRA,RBおよびバス17,18を介し
て、汎用レジスタモジュール11から読み出されたデー
タがマルチプレクサ12に出力される。さらに、ポート
DA,DBは、それぞれマルチプレクサ16とデータレ
ジスタr0 ,r1 との間で、双方向通信を行うためのポ
ートである。
The ports RA and RB are read ports. Data read from the general-purpose register module 11 is output to the multiplexer 12 via the ports RA and RB and the buses 17 and 18. Further, the ports DA and DB are ports for performing bidirectional communication between the multiplexer 16 and the data registers r 0 and r 1 , respectively.

【0022】汎用レジスタモジュール11では、ポート
W,RA,RB,MA,MB,DA,DBを同時に使用
することができる。つまり、汎用レジスタモジュール1
1に対してのリード動作とライト動作とを独立して実行
できる。
In the general-purpose register module 11, the ports W, RA, RB, MA, MB, DA, and DB can be used simultaneously. That is, general-purpose register module 1
1 can be executed independently of the read operation and the write operation.

【0023】マイクロプロセッサ1では、データレジス
タr0 ,r1 を、それぞれバス26,27を介してメモ
リとの間で通信を行うためのインターフェイスとなるバ
ッファとして用いる。また、レジスタr2 〜r15は、一
般的な汎用レジスタとして使用される。マイクロプロセ
ッサ1では、例えば、ALU13において内部メモリ4
7に記憶されたデータを用いる場合には、そのデータを
バス26を介してデータレジスタr0 に読み出した後
に、データレジスタr0 にアクセスを行う。このとき、
内部メモリ47からバス27を介して、データレジスタ
1 にデータを読み出した後に、データレジスタr1
アクセスしてもよい。また、マイクロプロセッサ1で
は、データを内部メモリ47に書き込む場合に、データ
レジスタr0 あるいはr1 にデータを書き込んだ後に、
この書き込んだデータをバス26あるいは27を介して
内部メモリ47に転送する。
In the microprocessor 1, the data registers r 0 and r 1 are used as buffers serving as interfaces for communicating with the memories via the buses 26 and 27, respectively. The register r 2 ~r 15 is used as a general-purpose register. In the microprocessor 1, for example, the internal memory 4 in the ALU 13
In the case of using the data stored in 7, the data is read out to the data register r 0 via the bus 26, and then the data register r 0 is accessed. At this time,
From the internal memory 47 via the bus 27, after reading the data into the data register r 1, may access the data register r 1. Further, the microprocessor 1, when writing data in the internal memory 47, after writing data to the data register r 0 or r 1,
The written data is transferred to the internal memory 47 via the bus 26 or 27.

【0024】なお、データレジスタr0 ,r1 は、他の
レジスタr2 〜r15と実質的に同じ接続形態をしてお
り、レジスタr2 〜r15と同様に汎用レジスタとしても
使用できる。具体的には、例えば、マルチプレクサ16
がバス21および22とポートDA,DBとの接続を選
択しているときに、ポートDA,DBがそれぞれRA,
RBと同様の機能を果たし、バス21,22がバス1
7、18と同様の機能を果たす。また、マルチプレクサ
16が、バス23とポートDAあるいはDBとの接続を
選択しているときには、ポートDAあるいはDBがポー
トWと同様の機能を果たす。そのため、データレジスタ
0 ,r1 は、プログラム内でレジスタr2 〜r15を含
む汎用レジスタ群の一部として統一的に記述され、デコ
ーダ36においても同様に認識される。
[0024] The data register r 0, r 1 is the substantially the same topology and other registers r 2 ~r 15, can also be used as well as general-purpose registers and register r 2 ~r 15. Specifically, for example, the multiplexer 16
Selects the connection between the buses 21 and 22 and the ports DA and DB, the ports DA and DB
Performs the same function as RB, and buses 21 and 22
It performs the same function as 7 and 18. When the multiplexer 16 selects the connection between the bus 23 and the port DA or DB, the port DA or DB performs the same function as the port W. Therefore, the data registers r 0 and r 1 are uniformly described as a part of a general-purpose register group including the registers r 2 to r 15 in the program, and are similarly recognized by the decoder 36.

【0025】DP(Data Pointer)レジスタ30,31
は、それぞれ内部メモリ47のメモリバンク45,46
のメモリアドレス空間内のアドレスを記憶する。なお、
DPレジスタ30,31は、汎用レジスタモジュール1
1のレジスタr0 〜r15とは異なり、複数の制御レジス
タのうち一部を割り当てる。そのため、DPレジスタ3
0,31を、ALU演算命令のレジスタ指定子を用いて
直接的には指定することはできず、データ転送命令によ
って指定される。なお、DPレジスタ30,31に、内
部メモリ47上のアドレスを書き込むには、1命令分の
ステップを必要とするが、データレジスタr0 ,r1
介した内部メモリ47に対してのアクセス動作は、プロ
グラムには記述されておらず、プログラムに直接的に明
示された処理とは別に、バックグランドで行われる。す
なわち、内部メモリ47に対してのアクセス動作は、パ
イプライン処理と並行して行われる。
DP (Data Pointer) registers 30, 31
Are the memory banks 45 and 46 of the internal memory 47, respectively.
The address in the memory address space is stored. In addition,
The DP registers 30 and 31 correspond to the general-purpose register module 1
Unlike one register r 0 to r 15 , a part of a plurality of control registers is assigned. Therefore, DP register 3
0 and 31 cannot be directly specified using the register specifier of the ALU operation instruction, but are specified by a data transfer instruction. Writing an address on the internal memory 47 to the DP registers 30 and 31 requires one instruction step. However, an access operation to the internal memory 47 via the data registers r 0 and r 1 is required. Is not described in the program, and is performed in the background separately from the process directly specified in the program. That is, the access operation to the internal memory 47 is performed in parallel with the pipeline processing.

【0026】マイクロプロセッサ1では、例えば、図2
に示す内部メモリ47のメモリバンク45に記憶された
データを読み出す際に、当該読み出すデータのメモリバ
ンク45内でのアドレスをDPレジスタ30に書き込
む。これによって、DPレジスタ30に書き込まれたメ
モリバンク45内でのアドレスに記憶されたデータが、
バス26を介してメモリバンク45からデータレジスタ
0 に、ハードウェアによって自動的に読み出される。
その後、データレジスタr0 から、マルチプレクサ16
を介してALU13のポートAINあるいはBINにデ
ータが転送される。
In the microprocessor 1, for example, FIG.
When the data stored in the memory bank 45 of the internal memory 47 is read, the address of the read data in the memory bank 45 is written to the DP register 30. As a result, the data stored in the address in the memory bank 45 written in the DP register 30 becomes
The data is automatically read from the memory bank 45 to the data register r 0 via the bus 26 by hardware.
Thereafter, the multiplexer 16 is read from the data register r 0.
Is transferred to the port AIN or BIN of the ALU 13 via the.

【0027】また、同様に、マイクロプロセッサ1で
は、例えば、図2に示す内部メモリ47のメモリバンク
46に記憶されたデータを読み出す際に、当該読み出す
データのメモリバンク46内でのアドレスをDPレジス
タ31に書き込む。これによって、DPレジスタ31に
書き込まれたメモリバンク46内でのアドレスに記憶さ
れたデータが、バス26を介してメモリバンク46から
データレジスタr1 に、ハードウェアによって自動的に
読み出される。その後、データレジスタr1 から、マル
チプレクサ16を介してALU13のポートAINある
いはBINにデータが転送される。
Similarly, in the microprocessor 1, for example, when reading data stored in the memory bank 46 of the internal memory 47 shown in FIG. Write to 31. As a result, the data stored in the address in the memory bank 46 written in the DP register 31 is automatically read out from the memory bank 46 to the data register r 1 via the bus 26 by hardware. Thereafter, data is transferred from the data register r 1 to the port AIN or BIN of the ALU 13 via the multiplexer 16.

【0028】このように、マイクロプロセッサ1では、
DPレジスタ30,31に、メモリバンク45,46内
のアドレスを書き込むことで、それぞれデータレジスタ
0,r1 に、当該アドレスに記憶されたデータを自動
的に読み出す。
As described above, in the microprocessor 1,
By writing the addresses in the memory banks 45 and 46 to the DP registers 30 and 31, the data stored at the addresses are automatically read out to the data registers r 0 and r 1 respectively.

【0029】一方、内部メモリ47のメモリバンク45
および46内の所定のアドレスにデータを書き込む場合
に、当該アドレスをそれぞれDPレジスタ30,31に
書き込んだ後に、それぞれデータレジスタr0 およびr
1 に当該データを書き込む。その後、ハードウェアによ
って自動的に、データレジスタr0 ,r1 に記憶された
データが、DPレジスタ30,31に記憶されたメモリ
バンク45,46内のアドレスに書き込まれる。なお、
データレジスタr0 とメモリバンク45とのデータ転送
と、データレジスタr1 とメモリバンク46とのデータ
転送とは、マイクロプロセッサ1において、同一のパイ
プラインサイクルで行うことができる。
On the other hand, the memory bank 45 of the internal memory 47
When data is written to a predetermined address in data registers 46 and 46, after writing the address to DP registers 30 and 31, respectively, data registers r 0 and r
Write the relevant data to 1 . Thereafter, the data stored in the data registers r 0 and r 1 are automatically written by hardware into the addresses in the memory banks 45 and 46 stored in the DP registers 30 and 31. In addition,
Data transfer between the data register r 0 and the memory bank 45 and data transfer between the data register r 1 and the memory bank 46 can be performed in the same pipeline cycle in the microprocessor 1.

【0030】ところで、内部メモリ47に対してのメモ
リライト動作で、データレジスタr0 またはr1 の一方
を使用すると、若干のサイクルをロスすることがある。
これは、データレジスタr0 またはr1 に対してデータ
の自動読み出し動作が不要に行われてしまうためであ
る。これを防ぐために、使用目的に合わせてデータレジ
スタr0 ,r1 の少なくとも一方をライト動作専用モー
ドに設定しておけば、無駄なメモリリード(ロード)動
作を実行することを回避できる。メモリリードあるいは
メモリライトの特性として、画像処理などの分野では、
連続したメモリアドレスが参照される可能性が高い。つ
まり、メモリリード命令の次には再びメモリリード命令
を実行することが多い。しかも、このとき、連続したメ
モリアドレスをアクセスする可能性が高い。そのため、
DPレジスタ30,31には、例えば、内部メモリ47
の記憶されたデータにアクセスする度に、記憶されてい
るアドレスを、例えば、+1,−1,+4,−4,+8
あるいは−8だけ自動的にインクリメントする機能を備
え、画像処理を行うときの処理効率の向上を図ってい
る。
When one of the data registers r 0 and r 1 is used in a memory write operation to the internal memory 47, a slight cycle may be lost.
This is because the operation of automatically reading data from the data register r 0 or r 1 is unnecessary. To prevent this, if at least one of the data registers r 0 and r 1 is set to the write operation only mode in accordance with the purpose of use, useless memory read (load) operation can be avoided. As a characteristic of memory read or memory write, in fields such as image processing,
It is highly likely that consecutive memory addresses will be referenced. That is, the memory read instruction is often executed again after the memory read instruction. Moreover, at this time, there is a high possibility that consecutive memory addresses are accessed. for that reason,
The DP registers 30 and 31 have, for example, an internal memory 47.
Each time the stored data is accessed, the stored address is changed to, for example, +1, -1, +4, -4, +8
Alternatively, a function of automatically incrementing by -8 is provided to improve processing efficiency when performing image processing.

【0031】図2に示す内部メモリ47のメモリバンク
45,46は、それぞれアドレスが連続した外部メイン
メモリ50のメモリアドレス空間上のデータのコピーを
記憶している。メモリバンク45と46との間では、外
部メインメモリ50のメモリアドレス空間上のアドレス
が連続している必要はない。
The memory banks 45 and 46 of the internal memory 47 shown in FIG. 2 store copies of data in the memory address space of the external main memory 50 whose addresses are continuous. The addresses in the memory address space of the external main memory 50 do not need to be continuous between the memory banks 45 and 46.

【0032】ALU13は、入力ポートAIN,BIN
およびポートAOUTを備え、デコーダ36からの制御
信号S36に基づいて、入力ポートAIN,BINから
入力されたデータに対して算術演算あるいは論理演算を
実行し、演算結果のデータをポートAOUTからバス2
3に出力する。ALU13では、演算を1クロックサイ
クルで実行する。ここで、ALU13は、演算命令の種
類によっては、デコーダ36からの制御信号S36に基
づいて、入力ポートAINあるいはBINからALU1
3に入力されたデータを演算を行わずに、そのまま出力
ポートAOUTから出力することもある。
The ALU 13 has input ports AIN, BIN
And an arithmetic operation or a logical operation on data input from the input ports AIN and BIN based on a control signal S36 from the decoder 36, and transfers the operation result data from the port AOUT to the bus 2
Output to 3. The ALU 13 executes an operation in one clock cycle. Here, depending on the type of the operation instruction, the ALU 13 transmits the ALU1 from the input port AIN or BIN based on the control signal S36 from the decoder 36.
In some cases, the data input to 3 is output from the output port AOUT as it is without performing the operation.

【0033】以下、マイクロプロセッサ1におけるパイ
プライン処理動作について説明する。マイクロプロセッ
サ1では、図1に示す構成によって、以下に示すよう
に、命令実行時のデータパスを4段パイプライン構造に
する。図4は、マイクロプロセッサ1のパイプライン処
理を説明するための図である。図4に示すように、マイ
クロプロセッサ1は、IFステージ、DECステージ、
ALUステージおよびWB(Write Back)ステージの4段
パイプラインを採用している。すなわち、図4に示す4
段パイプラインには、図29に示す5段パイプラインの
MEMステージが存在しない。
Hereinafter, the pipeline processing operation in the microprocessor 1 will be described. In the microprocessor 1, with the configuration shown in FIG. 1, the data path at the time of instruction execution has a four-stage pipeline structure as shown below. FIG. 4 is a diagram for explaining the pipeline processing of the microprocessor 1. As shown in FIG. 4, the microprocessor 1 includes an IF stage, a DEC stage,
A 4-stage pipeline of an ALU stage and a WB (Write Back) stage is adopted. That is, 4 shown in FIG.
The stage pipeline does not have the MEM stage of the five-stage pipeline shown in FIG.

【0034】図4に示す4段パイプラインにおいて、I
Fステージ、DECステージおよびALUステージにお
ける処理は、前述した図29に示す5段パイプラインの
場合と同じである。図4に示す4段パイプラインでは、
IFステージ、DECステージ、ALUステージおよび
WBステージが多重化して行われる。具体的には、マイ
クロプロセッサ1では、1段目のIFステージで、図1
に示すプログラムカウンタ34によって指し示されるイ
ンストラクションメモリ35上のアドレスから、次に実
行する命令をフェッチする(読み込む)。次に、2段目
のDECステージで、IFステージでフェッチした命令
を図1に示すデコーダ36でデコードする。そして、こ
のデコード結果に応じた制御信号S36に基づいて、マ
ルチプレクサ12,16およびALU13などが制御さ
れる。
In the four-stage pipeline shown in FIG.
The processing in the F stage, DEC stage, and ALU stage is the same as in the case of the five-stage pipeline shown in FIG. 29 described above. In the four-stage pipeline shown in FIG.
The IF stage, the DEC stage, the ALU stage and the WB stage are multiplexed and performed. Specifically, in the microprocessor 1, the first IF stage
The instruction to be executed next is fetched (read) from the address on the instruction memory 35 indicated by the program counter 34 shown in FIG. Next, in the second DEC stage, the instruction fetched in the IF stage is decoded by the decoder 36 shown in FIG. The multiplexers 12, 16 and the ALU 13 are controlled based on the control signal S36 according to the decoding result.

【0035】なお、汎用レジスタモジュール11のレジ
スタr0 〜r15をソースレジスタとして指定した命令で
あれば、DECステージで命令をデコードした後に、デ
ータレジスタr0 〜r15からデータを、マルチプレクサ
12を介してALU13のポートAIN,BINに読み
出す。すなわち、マイクロプロセッサ1では、プログラ
ムに応じて、データレジスタr0 ,r1 を他の汎用のレ
ジスタr2 〜r15と同様にアクセスできる。このとき、
内部メモリ47に対してのメモリアクセスが必要な場合
には、図2に示すDPレジスタ30,31に、内部メモ
リ47上の所定のアドレスを記憶させた後に、データレ
ジスタr0 ,r1 にアクセスを行うことで、内部メモリ
47に対してのアクセスを実現する。すなわち、マイク
ロプロセッサ1では、データレジスタr0 ,r1 を介し
て、内部メモリ47へのメモリアクセスを実現する。
If the instruction specifies the registers r 0 to r 15 of the general-purpose register module 11 as a source register, the instruction is decoded in the DEC stage, and then the data from the data registers r 0 to r 15 is transmitted to the multiplexer 12. The data is read out to the ports AIN and BIN of the ALU 13 via the CPU. That is, in the microprocessor 1, in accordance with the program, can access data registers r 0, r 1 as well as other general purpose register r 2 ~r 15. At this time,
When a memory access to the internal memory 47 is necessary, a predetermined address on the internal memory 47 is stored in the DP registers 30 and 31 shown in FIG. 2, and then the data registers r 0 and r 1 are accessed. , The access to the internal memory 47 is realized. That is, the microprocessor 1 implements memory access to the internal memory 47 via the data registers r 0 and r 1 .

【0036】次に、3段目のALUステージで、ALU
演算命令を実行する。なお、フェッチした命令がALU
演算命令でない場合は、ALUステージでは何も行わ
ず、ポートAIN,BINから入力したデータをALU
13のポートAOUTからそのまま出力する。次に、4
段目のWBステージでは、データレジスタr0 ,r1
よびレジスタr2 〜r15の何れかを、ディスティネーシ
ョンレジスタとして指定した命令について、ALU13
の演算結果を、当該指定したレジスタに書き戻す。この
とき、データレジスタr0 ,r1 にデータを書き込むこ
とで、バス26,27を介して、間接的に内部メモリ4
7にデータを書き戻す。
Next, in the third ALU stage, the ALU
Execute the operation instruction. The fetched instruction is ALU
If it is not an operation instruction, nothing is performed in the ALU stage, and data input from ports AIN and BIN are
The signal is directly output from the port AOUT 13. Next, 4
In the second WB stage, the ALU 13 for an instruction in which one of the data registers r 0 and r 1 and the registers r 2 to r 15 is designated as a destination register
Is written back to the specified register. At this time, by writing data to the data registers r 0 and r 1 , the internal memory 4 is indirectly connected via the buses 26 and 27.
Write the data back to 7.

【0037】図4に示す4段パイプライン処理では、コ
ードC1 が図2に示す内部メモリ47に対してのメモリ
ライト操作を伴う命令であり、コードC3 が内部メモリ
47に対してのメモリリード操作を伴う命令である場合
に、図5に示すクロックサイクルYにおいて、コードC
1 のWBステージ41と、コードC3 のDECステージ
42とで、同時にメモリアクセスを行うことになる。こ
の場合に、マイクロプロセッサ1では、内部メモリ47
に対してのアクセスのバッファとなるデータレジスタr
0 ,r1 を設け、内部メモリ47に対しての2系統のア
クセス経路を設けているため、コードC1 とコードC3
とでアクセスを行う内部メモリ47のバンクが異なれ
ば、図5に示すように、コードC1 のWBステージ41
とコードC3 のDECステージ42とを多重化でき、パ
イプライ処理は乱れない(ストールしない)。
[0037] In four-stage pipeline processing shown in FIG. 4, the code C 1 is an instruction involving memory write operation to the internal memory 47 shown in FIG. 2, the memory code C 3 is to the internal memory 47 In the case of an instruction accompanied by a read operation, in the clock cycle Y shown in FIG.
1 of WB stage 41, in the DEC stage 42 of the code C 3, will perform a memory access at the same time. In this case, in the microprocessor 1, the internal memory 47
Data register r serving as a buffer for access to
0 and r 1 and two access paths to the internal memory 47 are provided, so that the code C 1 and the code C 3
If the bank of the internal memory 47 to be accessed is different between the WB stage 41 and the code C 1 , as shown in FIG.
And it can be multiplexed and DEC stage 42 of the code C 3, pipeline processing is not disturbed (not stall).

【0038】以下、マイクロプロセッサ1におけるプロ
グラムの記述に応じた内部メモリ47に対してのアクセ
ス動作例について説明する。2オペランド演算命令を用いた場合 以下、図6に示すように、オペコード(OP)と、〔ソ
ースレジスタ〕および〔ディスティネーションレジス
タ〕を指定する2個のオペランドとを備えた2オペラン
ド演算命令を用いて、プログラムを記述した場合におけ
る内部メモリ47に対してのアクセス動作について説明
する。
Hereinafter, an example of an access operation to the internal memory 47 according to the description of the program in the microprocessor 1 will be described. When a two-operand operation instruction is used, a two-operand operation instruction having an operation code (OP) and two operands specifying a [source register] and a [destination register] is used as shown in FIG. Next, an access operation to the internal memory 47 when a program is described will be described.

【0039】例えば、図7に示すように、2オペランド
演算命令において、データレジスタr0 をソースレジス
タとして指定した場合には、内部メモリ47上のDPレ
ジスタ30に記憶されたアドレスからデータをデータレ
ジスタr0 に読み出した後に、データレジスタr0 に記
憶されたデータと、レジスタr4 に記憶されたデータと
を加算して、その加算結果のデータをレジスタr4 に書
き込む。
For example, as shown in FIG. 7, when the data register r 0 is designated as the source register in the two-operand operation instruction, the data is stored in the data register from the address stored in the DP register 30 on the internal memory 47. After reading to r 0 , the data stored in the data register r 0 and the data stored in the register r 4 are added, and the resulting data is written to the register r 4 .

【0040】また、例えば、図8に示すように、2オペ
ランド演算命令において、データレジスタr1 をディス
ティネーションレジスタとして指定した場合には、内部
メモリ47上のDPレジスタ31に記憶されたアドレス
からデータをデータレジスタr1 に読み出した後に、デ
ータレジスタr1 に記憶されたデータと、レジスタr5
に記憶されたデータとを加算して、その加算結果のデー
タをレジスタr1 に書き込む。そして、内部メモリ47
上のDPレジスタ31に記憶されたアドレスに、データ
レジスタr1 に記憶されたデータを書き込む。
For example, as shown in FIG. 8, when the data register r 1 is specified as a destination register in a two-operand operation instruction, the data stored in the DP register 31 on the internal memory 47 is read from the address. the after reading the data register r 1, and data stored in the data register r 1, register r 5
By adding the data stored in the write data of the addition result in the register r 1. Then, the internal memory 47
The DP register 31 to the address stored in the above, and writes the data stored in the data register r 1.

【0041】また、例えば、図9に示すように、2オペ
ランド演算命令において、データレジスタr0 をソース
アドレスとして指定し、データレジスタr1 をディステ
ィネーションレジスタとして指定した場合には、内部メ
モリ47上のDPレジスタ30,31に記憶されたアド
レスからデータをそれぞれデータレジスタr0 ,r1
読み出した後に、データレジスタr0 に記憶されたデー
タと、データレジスタr1 に記憶されたデータとを加算
して、その加算結果のデータをレジスタr1 に書き込
む。そして、内部メモリ47上のDPレジスタ31に記
憶されたアドレスに、データレジスタr1 に記憶された
データを書き込む。
For example, as shown in FIG. 9, when the data register r 0 is specified as the source address and the data register r 1 is specified as the destination register in the two-operand operation instruction, After reading the data from the addresses stored in the DP registers 30 and 31 into the data registers r 0 and r 1 respectively, the data stored in the data register r 0 and the data stored in the data register r 1 are added. to write the data of the addition result in the register r 1. Then, the address stored in the DP register 31 in the internal memory 47, and writes the data stored in the data register r 1.

【0042】ところで、図8に示す演算命令を連続して
実行したときに、図4に示すマイクロプロセッサ1のパ
イプライン処理において、図10に示すように、2クロ
ックサイクルのパイプライン・ハザード(ストール)が
発生する。これは、図10に示すクロックサイクルT+
3で、データレジスタr1 に対してのライト動作とリー
ド動作とが競合するためである。すなわち、図8に示す
演算命令であるコードC1 が、クロックサイクルT+1
でDECステージに進んだときに、図1に示すデコーダ
36は、コードC1 がロード/ストア命令であることを
認識してレジスタr1 を内部でロックする。そして、コ
ードC1 がクロックサイクルT+3でWBステージに進
んだときに、このロックは解除される。すなわち、内部
メモリ47に対してのリード・モディファイ・ライト
は、ライトバックされるまでロックされる。このロック
されたレジスタを命令がアクセスすると、ロックが解除
するまでアクセスが待たされる。そして、クロックサイ
クルT+3でALU13の出力をデータレジスタr1
書き込み、ロックの解除を決定し、DPレジスタ31を
更新する。そして、クロックサイクルT+4で、コード
2 に応じて、内部メモリ47からデータレジスタr1
にデータを読み込み、その後、コードC1 の場合と同様
の処理を繰り返す。
By the way, when the operation instructions shown in FIG. 8 are successively executed, in the pipeline processing of the microprocessor 1 shown in FIG. 4, as shown in FIG. 10, a pipeline hazard (stall) of two clock cycles is generated. ) Occurs. This corresponds to clock cycle T + shown in FIG.
In No. 3, the write operation and the read operation on the data register r1 conflict with each other. That is, the code C 1 is an operation command shown in FIG. 8, a clock cycle T + 1
When proceeding to DEC stage in the decoder 36 shown in FIG. 1, the locking internally registers r 1 recognizes that the code C 1 is a load / store instruction. The code C 1 is in when it proceeds to the WB stage in clock cycle T + 3, the lock is released. That is, the read-modify-write to the internal memory 47 is locked until it is written back. When an instruction accesses the locked register, the access waits until the lock is released. Then, at clock cycle T + 3 writes the output of the ALU13 in the data register r 1, to determine the release of the lock, and updates the DP register 31. Then, at clock cycle T + 4, the data register r 1 is read from the internal memory 47 according to the code C 2.
Reads data, then repeats the same processing as the processing of the code C 1.

【0043】3オペランド演算命令を用いた場合 以下、図11に示すように、オペコード(OP)と、2
個の〔ソースレジスタ〕および〔ディスティネーション
レジスタ〕を指定する3個のオペランドとを備えた3オ
ペランド演算命令を用いて、プログラムを記述した場合
における内部メモリ47に対してのアクセス動作につい
て説明する。マイクロプロセッサ1では、例えば、従来
のマイクロプロセッサにおける図30に示すプログラム
を実行するときに、プログラムを図12に示すように記
述できる。図12において、命令「mov r0
2 」はデータレジスタr0 に記憶された内部メモリ4
7上のデータをレジスタr2 に転送することを示す。こ
のとき、命令「mov r0 ,r2 」を実行するのに先
立って、図2に示すDPレジスタ30にメモリバンク4
5内の読み込み対象のデータのアドレスが記憶され、ハ
ードウェアによって、当該アドレスに記憶されたデータ
が、バス26を介してデータレジスタr0 に転送されて
いる。そして、データレジスタr0 に記憶された内部メ
モリ47上のデータが、バス24、マルチプレクサ1
6,12およびバス23を介して、レジスタr2 に転送
される。
When a three-operand operation instruction is used , as shown in FIG.
An access operation to the internal memory 47 when a program is described using a three-operand operation instruction including three operands specifying [source registers] and [destination registers] will be described. In the microprocessor 1, for example, when the program shown in FIG. 30 in a conventional microprocessor is executed, the program can be described as shown in FIG. In FIG. 12, the instruction “mov r 0 ,
“r 2 ” is the internal memory 4 stored in the data register r 0.
Data on 7 indicates that transferred to the register r 2. At this time, prior to execution of the instruction “mov r 0 , r 2 ”, the memory bank 4 is stored in the DP register 30 shown in FIG.
Read address of the data of interest within 5 are stored by the hardware, the data stored in the address have been transferred to the data register r 0 through the bus 26. The data on the internal memory 47 stored in the data register r 0 is transferred to the bus 24 and the multiplexer 1.
The data is transferred to the register r 2 via the buses 6 and 12 and the bus 23.

【0044】また、「add r2 ,r9 ,r3 」はレ
ジスタr2 に記憶されたデータとレジスタr9 に記憶さ
れたデータとを加算してレジスタr3 に記憶することを
示す。これによって、ALU13のポートAINに対し
てレジスタr2 に記憶されたデータが出力され、ポート
BINに対してレジスタr9 に記憶されたデータが出力
され、ALU13において、これらの加算が行われ、加
算結果がポートAOUTからバス23を介して、汎用レ
ジスタモジュール11のレジスタr3 に書き込まれる。
“Add r 2 , r 9 , r 3 ” indicates that the data stored in the register r 2 and the data stored in the register r 9 are added and stored in the register r 3 . As a result, the data stored in the register r 2 is output to the port AIN of the ALU 13, the data stored in the register r 9 is output to the port BIN, and these additions are performed in the ALU 13. result via the bus 23 from the port AOUT, written into the register r 3 of the general register module 11.

【0045】さらに、「mov r3 ,r1 」は、レジ
スタr3 に記憶されたデータをデータレジスタr1 に転
送することを意味する。これによって、レジスタr3
記憶されたデータが、例えばバス17、マルチプレクサ
12、バス23、マルチプレクサ16およびバス25を
介して、データレジスタr1 に転送される。その後、ハ
ードウェアによって、DPレジスタ31に記憶された内
部メモリ47上のアドレスに対して、データレジスタr
1 に記憶されたデータがバス27を介して自動的に書き
込まれる。
Further, "mov r 3 , r 1 " means that the data stored in the register r 3 is transferred to the data register r 1 . Thus, the data stored in register r 3, for example a bus 17, a multiplexer 12, bus 23, via multiplexer 16 and bus 25, is transferred to the data register r 1. Thereafter, the hardware registers the data register r with the address on the internal memory 47 stored in the DP register 31.
The data stored in 1 is automatically written via the bus 27.

【0046】このように、マイクロプロセッサ1では、
図30に示すロード命令「lw」およびストア命令「s
w」の代わりに、図12に示すようにレジスタ間転送命
令「mov」を記述したプログラムを実行する。
As described above, in the microprocessor 1,
The load instruction “lw” and the store instruction “s” shown in FIG.
Instead of "w", a program describing an inter-register transfer instruction "mov" is executed as shown in FIG.

【0047】なお、図12に示すプログラムは、例え
ば、図13に示すようにも記述できる。図13に示すプ
ログラムでは、命令「add」のソースレジスタとして
データレジスタr0 およびレジスタr9 を指定してお
り、ディステイネイションアドレスとしてデータレジス
タr1 を指定している。但し、この場合に、DPレジス
タ30,31によって、内部メモリ47上の異なるバン
ク内のアドレスが指し示されている必要がある。図13
に示すプログラムは、マイクロプロセッサ1によって1
クロックサイクルで実行される。
The program shown in FIG. 12 can be described, for example, as shown in FIG. In the program shown in FIG. 13, the data register r 0 and the register r 9 are specified as the source register of the instruction “add”, and the data register r 1 is specified as the destination address. However, in this case, it is necessary that the DP registers 30 and 31 point to addresses in different banks on the internal memory 47. FIG.
The program shown in FIG.
Executed in clock cycles.

【0048】また、マイクロプロセッサ1では、内部メ
モリ47上の連続したメモリアドレスに記憶されたデー
タを加工する場合には、例えば、図14に示すようにプ
ログラムを記述する。図14に示すプログラムを実行す
ると、図2に示すDPレジスタ30,31に記憶されて
いるアドレスに対して順次に、例えば「+4」を加算し
て更新することで、データレジスタr0 ,r1 を介し
て、内部メモリ47における「+4」間隔のアドレスに
対して順次にアクセスが行われる。図13において、
「add r0 ,r9 ,r1 」は、データレジスタr0
に記憶されたデータと、レジスタr9 に記憶されたデー
タとを加算して、その加算結果のデータをデータレジス
タr1 に記憶することを示している。図14に示すプロ
グラムに応じた処理では、内部メモリ47上の8個のデ
ータを加工する。なお、図14に示すプログラムは、ル
ープを用いて記述してもよい。
In the microprocessor 1, when processing data stored at consecutive memory addresses on the internal memory 47, for example, a program is described as shown in FIG. When the program shown in FIG. 14 is executed, the addresses stored in the DP registers 30 and 31 shown in FIG. 2 are sequentially updated by adding, for example, “+4”, thereby updating the data registers r 0 and r 1. , Accesses are sequentially made to addresses at intervals of “+4” in the internal memory 47. In FIG.
“Add r 0 , r 9 , r 1 ” is the data register r 0
The stored data, by adding the data stored in the register r 9, show that for storing data of the addition result in the data register r 1 is in. In the processing according to the program shown in FIG. 14, eight data on the internal memory 47 are processed. The program shown in FIG. 14 may be described using a loop.

【0049】マイクロプロセッサ1では、例えば、図3
に示す汎用レジスタモジュール11のレジスタr14をデ
ータレジスタとして扱い、レジスタr14に対応したDP
レジスタを更に設けることで、メモリアクセスのパスを
3系統にすることができる。この場合に、図15に示す
ように、プログラムを記述することで、加算命令「ad
d」の3個の全てのオペランドにおいて、データレジス
タr0 ,r14,r1 を指定することができる。
In the microprocessor 1, for example, FIG.
DP of treatment, corresponding to the register r 14 registers r 14 of general register module 11 shown in the data register
By additionally providing a register, three paths for memory access can be provided. In this case, as shown in FIG. 15, by describing a program, the addition instruction “ad
Data registers r 0 , r 14 , and r 1 can be specified in all three operands “d”.

【0050】以上説明したように、マイクロプロセッサ
1によれば、汎用レジスタモジュール11を構成する複
数の汎用レジスタの一部を、データレジスタr0 ,r1
として用いることで、プログラムにおいて、内部メモリ
47に対してのメモリアクセスのためのメモリリード命
令およびメモリライト命令を、別途記述する必要がな
い。すなわち、命令セットを、メモリアクセスが必要な
場合も含めて、汎用レジスタに記憶されたデータ相互間
で行う演算として統一して記述できる。すなわち、マイ
クロプロセッサ1によれば、内部メモリ47に対しての
アクセスは、汎用レジスタに対してのアクセスの延長と
して扱われ、ソフトウェアからは、データレジスタ
0 ,r1 をメモリウィンドウとして使用できる。
As described above, according to the microprocessor 1, a part of the plurality of general-purpose registers constituting the general-purpose register module 11 is replaced with the data registers r 0 and r 1.
Therefore, it is not necessary to separately describe a memory read instruction and a memory write instruction for accessing the internal memory 47 in the program. In other words, the instruction set can be described as an operation performed between the data stored in the general-purpose registers, even when a memory access is required. That is, according to the microprocessor 1, the access to the internal memory 47 is treated as an extension of the access to the general-purpose register, and the data registers r 0 and r 1 can be used as a memory window from software.

【0051】また、マイクロプロセッサ1では、アクセ
スする内部メモリ47のアドレスおよびアクセスする順
番が予め決められている場合には、DPレジスタ30,
31のアドレス更新機能を用いて、DPレジスタ30,
31に記憶されているアドレスを自動的に更新すること
で、メモリアクセスのための手順を、プログラム内で毎
回明示して記述する必要がない。
In the microprocessor 1, if the address of the internal memory 47 to be accessed and the access order are determined in advance, the DP register 30,
31, the DP register 30,
By automatically updating the address stored in 31, there is no need to explicitly describe the procedure for memory access every time in a program.

【0052】そのため、内部メモリ47のメモリアドレ
ス空間内の連続したアドレスに記憶された複数のデータ
を順にアクセスして加工する場合に、アクセスするデー
タのアドレスを毎回指定する必要がなく、プログラムに
はALU演算命令のみを記述すればよい。このとき、デ
ータレジスタr0 ,r1 に対して、DPレジスタ30,
31が自動的に更新された直後に、内部メモリ47から
データを読み出すことで、ALU演算命令を実行する度
に、ALU13がメモリアクセスの完了を待たされるこ
とを回避できる。すなわち、ALU13がプログラムに
応じてALU演算を実行する時点で、内部メモリ47か
らデータレジスタr0 ,r1 に既にデータが既に読み込
まれている状態にすることができる。その結果、マイク
ロプロセッサ1における演算処理において、命令の多重
化を効率的に実現し、例えば、パイプライン処理におい
て、ALU演算命令を毎クロックサイクル実行できる。
また、ユーザによるプログラムの記述を簡単化できる。
Therefore, when sequentially accessing and processing a plurality of data stored at consecutive addresses in the memory address space of the internal memory 47, it is not necessary to specify the address of the data to be accessed each time. Only the ALU operation instruction needs to be described. At this time, with respect to the data registers r 0, r 1, DP register 30,
By reading data from the internal memory 47 immediately after the 31 is automatically updated, it is possible to avoid waiting for the ALU 13 to complete the memory access every time the ALU operation instruction is executed. That is, at the time when the ALU 13 executes the ALU operation according to the program, the data can be already read from the internal memory 47 to the data registers r 0 and r 1 . As a result, in the arithmetic processing in the microprocessor 1, multiplexing of instructions can be efficiently realized, and for example, in pipeline processing, an ALU arithmetic instruction can be executed every clock cycle.
Further, the description of the program by the user can be simplified.

【0053】また、マイクロプロセッサ1によれば、2
個のDPレジスタ30,31を設け、内部メモリ47上
のデータに対して直接的にALU演算命令を実行するこ
とで、例えば、内部メモリ47上のデータを読み出して
加工した後に、内部メモリ47に書き戻す処理を1命令
で記述できる。しかも、この命令において、内部メモリ
47から読み出すデータのバンクと、内部メモリ47に
書き込むデータのバンクとが異なる場合に、命令を1ク
ロックサイクル内に実行できる。なお、DPレジスタ3
0,31が共に内部メモリ47の全てのアドレスを指定
できる場合には、内部メモリ47から読み出すデータの
アドレスと、内部メモリ47に書き込むデータのアドレ
スとが異なれば、命令を1クロックサイクル内に実行で
きる。例えば、プログラムにおいて、メモリアクセスを
伴う演算処理を、例えば図13に示すように1命令で記
述し、1クロックサイクル内で実行できる。
According to the microprocessor 1, 2
By providing the DP registers 30 and 31 and executing the ALU operation instruction directly on the data on the internal memory 47, for example, after reading and processing the data on the internal memory 47, The rewriting process can be described by one instruction. Moreover, in this instruction, if the bank of data read from the internal memory 47 is different from the bank of data written to the internal memory 47, the instruction can be executed within one clock cycle. Note that DP register 3
If both 0 and 31 can specify all the addresses of the internal memory 47, the instruction is executed within one clock cycle if the address of the data read from the internal memory 47 is different from the address of the data written to the internal memory 47. it can. For example, in a program, arithmetic processing involving memory access can be described by, for example, one instruction as shown in FIG. 13 and executed within one clock cycle.

【0054】また、マイクロプロセッサ1では、内部メ
モリ47にデータを書き戻す命令(ディスティネーショ
ンレジスタとしてデータレジスタr0 またはr1 を指定
するデータ転送命令)を連続して実行する場合に、DP
レジスタ30,31の自動読み出し機能を停止し、無駄
なメモリリードを無くすことができる。これにより、メ
モリライトを連続して実行することができ、命令の多重
化を実現できる。
[0054] Further, the microprocessor 1, when performing write back data to the internal memory 47 instructions (data transfer instruction specifying the data register r 0 or r 1 as the destination register) successively, DP
The automatic read function of the registers 30 and 31 is stopped, and unnecessary memory read can be eliminated. As a result, memory writes can be executed continuously, and multiplexing of instructions can be realized.

【0055】また、マイクロプロセッサ1では、データ
レジスタr0 ,r1 およびDPレジスタ30,31を用
いたメモリ構成にしたことで、図23に示す従来の5段
パイプライン構造におけるMEMステージが不要とな
り、図4に示すように、4段パイプライン構造にするこ
とができる。すなわち、データレジスタr0 ,r1 を用
いて内部メモリ47に書き込み動作を行うことから、内
部メモリ47に対しての書き込み動作を、WBステージ
において行われるレジスタ書き込み動作によって行うこ
とができる。従って、パイプライン処理に、メモリアク
セス処理のステージを独立して設ける必要がない。その
結果、マイクロプロセッサ1では、プロセッサ全体の制
御回路が簡単になり、外部割り込みを含む例外処理に対
しても柔軟な対応を行うことができる。
In the microprocessor 1, the memory configuration using the data registers r 0 and r 1 and the DP registers 30 and 31 eliminates the need for the MEM stage in the conventional five-stage pipeline structure shown in FIG. As shown in FIG. 4, a four-stage pipeline structure can be adopted. That is, since the write operation is performed on the internal memory 47 using the data registers r 0 and r 1 , the write operation on the internal memory 47 can be performed by the register write operation performed in the WB stage. Therefore, it is not necessary to provide a memory access processing stage independently in the pipeline processing. As a result, in the microprocessor 1, the control circuit of the entire processor is simplified, and it is possible to flexibly cope with exception processing including an external interrupt.

【0056】第2実施形態 本実施形態のマイクロプロセッサは、内部メモリのバン
ク数、データレジスタおよびDPレジスタの数、およ
び、図1に示すマルチプレクサ12,16の代わりにマ
ルチプレクサ82を備えている点を除いて、基本的に、
前述した第1実施形態のマイクロプロセッサ1と同じ構
成をしている。図16は、本実施形態のマイクロプロセ
ッサ81の内部メモリ87の周辺の構成図である。図1
6に示すように、マイクロプロセッサ81は、内部メモ
リ87、DPレジスタ91,92,93、データレジス
タr0 ,r1 −R,r1 −W、マルチプレクサ82およ
びバス101〜106を備えている。
Second Embodiment The microprocessor according to the second embodiment is characterized in that the number of banks of the internal memory, the number of data registers and DP registers, and that a multiplexer 82 is provided instead of the multiplexers 12 and 16 shown in FIG. Except, basically,
It has the same configuration as the microprocessor 1 of the first embodiment described above. FIG. 16 is a configuration diagram around the internal memory 87 of the microprocessor 81 of the present embodiment. FIG.
As shown in 6, the microprocessor 81 includes an internal memory 87, DP register 91, 92 and 93, the data register r 0, r 1 -R, r 1 -W, a multiplexer 82 and bus 101-106.

【0057】また、マイクロプロセッサ81は、図1に
示すマイクロプロセッサ1と同様に、ALU13、プロ
グラムカウンタ34、インストラクションページメモリ
35、デコーダ36、バス17,18,19,20,2
3を備えている。また、マイクロプロセッサ81では、
図1に示すレジスタr1 の代わりに、レジスタr1 −R
およびレジスタr1 −Wを備えている。すなわち、マイ
クロプロセッサ81には、図16に示すデータレジスタ
0 ,r1 −R,r1 −Wの他に、レジスタr2 〜r15
が備えられている。なお、マイクロプロセッサ81で
は、プログラムの記述において論理的に、物理的なデー
タレジスタr1 −Rとデータレジスタr1 −Wとを、単
体のデータレジスタr1 として扱う。
The microprocessor 81 includes an ALU 13, a program counter 34, an instruction page memory 35, a decoder 36, and buses 17, 18, 19, 20, and 2, similarly to the microprocessor 1 shown in FIG.
3 is provided. In the microprocessor 81,
Instead of the register r 1 shown in FIG. 1, the register r 1 -R
And a register r 1 -W. That is, the microprocessor 81 has registers r 2 to r 15 in addition to the data registers r 0 , r 1 -R, and r 1 -W shown in FIG.
Is provided. The microprocessor 81 logically handles the physical data registers r 1 -R and the data registers r 1 -W as a single data register r 1 in the description of the program.

【0058】マイクロプロセッサ81では、DPレジス
タ91に記憶された内部メモリ87のメモリバンク11
0内のアドレスからデータを読み出して、データレジス
タr0 に記憶する。また、データレジスタr1 −Rは、
内部メモリ87のメモリバンク111からのデータ読み
出し動作専用であり、プログラムに記述された2オペラ
ンド演算命令においてディスティネーションレジスタと
して論理的なデータレジスタr1 のアドレスが指定され
ている場合に、DPレジスタ92に記憶されたメモリバ
ンク111内のアドレスから読み出されたデータを記憶
する。また、データレジスタr1 −Wは、内部メモリ8
7のメモリバンク112に対してのデータ書き込み動作
専用であり、プログラムに記述された2オペランド演算
命令においてディスティネーションレジスタとして論理
的なデータレジスタr1 のアドレスが指定されている場
合に、そのデータレジスタr1 −Wの記憶データを、D
Pレジスタ93に記憶されたメモリバンク112内のア
ドレスに書き込む。なお、論理的なデータレジスタr1
のアドレスの指定は、論理アドレスを直接指定する他、
例えば、論理レジスタ名を介して論理アドレスを間接的
に指定してもよい。
In the microprocessor 81, the memory bank 11 of the internal memory 87 stored in the DP register 91
Data is read from the address in 0 and stored in the data register r0. The data register r 1 -R is
A data read operation only from the memory bank 111 of internal memory 87, when the address of the logical data register r 1 is designated in the second operand arithmetic instructions written in the program as the destination register, DP register 92 The data read from the address in the memory bank 111 stored in the memory cell is stored. Further, the data register r 1 -W stores the internal memory 8
7 is a data write operation only with respect to the memory bank 112, if specified address of a logical data register r 1 as the destination register in the two-operand arithmetic instructions written in the program, the data register r 1 -W is stored in D
Write to the address in the memory bank 112 stored in the P register 93. Note that the logical data register r 1
In addition to specifying the logical address directly,
For example, a logical address may be indirectly specified via a logical register name.

【0059】以下、マイクロプロセッサ81の動作につ
いて説明する。マイクロプロセッサ81では、例えば、
図6に示すフォーマットを持つ2オペランド演算命令を
実行する。マイクロプロセッサ81では、例えば、図1
7に示すように、データレジスタr1 がディスティネー
ションアドレスに指定されている命令を実行する場合
に、先ず、DPレジスタ92に加算対象データが記憶さ
れたメモリバンク111内のアドレスを書き込むこと
で、ハードウェアによって、バス102を介してデータ
レジスタr1 −Rに当該加算対象データを読み出す。次
に、図1に示すALU13において、レジスタr5 に記
憶されたデータと、データレジスタr1 −Rに記憶され
たデータとの加算演算を行い、加算結果のデータをバス
106を介してデータレジスタr1 −W0 に記憶する。
また、加算結果のデータを書き戻すメモリバンク112
内のアドレスをDPレジスタ93に書き込む。これによ
って、データレジスタr1 −W0 に記憶された加算結果
のデータが、ハードウェアによって、バス103を介し
てメモリバンク112に書き戻される。
Hereinafter, the operation of the microprocessor 81 will be described. In the microprocessor 81, for example,
A two-operand operation instruction having the format shown in FIG. 6 is executed. In the microprocessor 81, for example, FIG.
As shown in FIG. 7, when the data register r 1 executes the instruction specified by the destination address, first, the address in the memory bank 111 in which the data to be added is stored is written to the DP register 92, The data to be added is read out to the data register r 1 -R via the bus 102 by hardware. Next, the ALU13 shown in FIG. 1, the data stored in the register r 5, performs addition operation between data stored in the data register r 1 -R, data register data of the addition result through the bus 106 Store it in r 1 -W 0 .
The memory bank 112 to which the data of the addition result is written back
Is written into the DP register 93. As a result, the data of the addition result stored in the data register r 1 -W 0 is written back to the memory bank 112 via the bus 103 by hardware.

【0060】以下、マイクロプロセッサ81において、
内部メモリ87上の連続したメモリアドレスに記憶され
たデータを加工する場合について説明する。マイクロプ
ロセッサ81において、例えば、図18に示すプログラ
ムを図4に示す4段パイプライン処理で実行するとき、
図19(A)に示すようになる。図18に示すコードC
1 〜C6 の各コードは、図19(A)に示すパイプライ
ン処理において、IFステージで命令「add r0
1 」のフェッチが行われ、DECステージで、DPレ
ジスタ91に記憶されたメモリバンク110上のアドレ
スからデータレジスタr0 に読み出された一方の加算対
象データが、データレジスタr0 からALU13のポー
トAINに出力される。それと共に、DPレジスタ92
に記憶されたメモリバンク111上のアドレスからデー
タレジスタr1 −Rに読み出された他方の加算対象デー
タがデータレジスタr1 −RからALU13のポートB
INに出力される。次に、ALUステージで、ALU1
3において双方の加算対象データを用いた加算が行わ
れ、WBステージで、ALU13の加算結果がポートA
OUTからデータレジスタr1 −Wに書き込まれる。そ
の後、DPレジスタ93に記憶されたメモリバンク11
2上のアドレスに、データレジスタr1 −Wの記憶デー
タが書き戻される。
Hereinafter, in the microprocessor 81,
A case where data stored at consecutive memory addresses on the internal memory 87 is processed will be described. In the microprocessor 81, for example, when the program shown in FIG. 18 is executed by the four-stage pipeline processing shown in FIG.
The result is as shown in FIG. Code C shown in FIG.
Each code 1 -C 6, in the pipeline processing shown in FIG. 19 (A), the instruction in the IF stage "the add r 0,
Fetching r 1 "is performed, in DEC stage, one of the addition-target data from the stored address on the memory bank 110 has been read into the data register r 0 in the DP register 91, the data register r 0 of ALU13 Output to port AIN. At the same time, the DP register 92
The other addition target data read out from the address on the memory bank 111 stored in the memory register 111 to the data register r 1 -R is transmitted from the data register r 1 -R to the port B of the ALU 13.
Output to IN. Next, at the ALU stage, ALU1
3, the addition using both the addition target data is performed, and the addition result of the ALU 13 is
OUT is written to the data register r 1 -W. Thereafter, the memory bank 11 stored in the DP register 93
The data stored in the data register r 1 -W is written back to the address on 2.

【0061】このとき、図19(A)に示すように、ク
ロックサイクルTで、コードC1 のIFステージが行わ
れる。また、図19(B)に示すように、クロックサイ
クルT+1〜T+6で、コードC1 〜C6 によるデータ
レジスタr0 に対してのメモリリード動作(デコードス
テージ)が順に行われる。また、図19(C)に示すよ
うに、クロックサイクルT+1〜T+6で、コードC1
〜C6 によるデータレジスタr1 −Rに対してのメモリ
リード動作(デコードステージ)が順に行われる。さら
に、図19(D)に示すように、クロックサイクルT+
3〜T+8で、コードC1 〜C6 によるデータレジスタ
1 −Wに対してのメモリライト動作(WBステージ)
が順に行われる。すなわち、マイクロプロセッサ81で
は、前述したように、データレジスタr1 −R,r1
Wr0 を設けたことで、データレジスタr1 に対しての
メモリリード動作とメモリライト動作とを同時に行うこ
とができる。その結果、図18に示すコードC1 〜C6
を、それぞれ1クロックサイクルで実行できる。
At this time, as shown in FIG. 19A, the IF stage of the code C 1 is performed in the clock cycle T. Further, as shown in FIG. 19 (B), in a clock cycle T + 1 to T + 6, a memory read operation for the data registers r 0 by the code C 1 -C 6 (decode stage) is carried out in order. Further, as shown in FIG. 19C, the code C 1 in clock cycles T + 1 to T + 6.
The memory read operation (decode stage) for the data register r 1 -R by C 6 is sequentially performed. Further, as shown in FIG. 19D, the clock cycle T +
From 3 to T + 8, a memory write operation to the data register r 1 -W by the codes C 1 to C 6 (WB stage)
Are performed in order. That is, in the microprocessor 81, as described above, the data registers r 1 -R, r 1-
By providing Wr 0 , a memory read operation and a memory write operation for data register r 1 can be performed simultaneously. As a result, the codes C 1 to C 6 shown in FIG.
Can be executed in one clock cycle.

【0062】以上説明したように、マイクロプロセッサ
81によれば、論理的なデータレジスタr1 をディステ
ィネーションアドレスに指定してリードモディファイラ
イトを行う2オペランド演算命令を繰り返し連続して行
う場合であっても、各演算命令を1クロックサイクルで
実行できる。また、マイクロプロセッサ81によれば、
2オペランド演算命令を用いて同一のクロックサイクル
で内部メモリ87上の異なる3個のデータにアクセスを
行い、実質的に3オペランド演算と同等の演算を実現で
きる。
[0062] As described above, according to the microprocessor 81, a case where the specified logical data register r 1 to the destination address performed continuously repeated 2 operand operation instruction for performing the read-modify-write Also, each operation instruction can be executed in one clock cycle. According to the microprocessor 81,
By using a two-operand operation instruction, three different data on the internal memory 87 are accessed in the same clock cycle, and an operation substantially equivalent to a three-operand operation can be realized.

【0063】第3実施形態 上述した第1実施形態および第2実施形態のマイクロプ
ロセッサでは、複数のデータレジスタと内部メモリの複
数のバンクとを、それぞれ1対1に固定して対応させた
場合について説明した。従って、これらのマイクロプロ
セッサでは、内部メモリのバンク数に対応した数のデー
タレジスタおよびDPレジスタを設ける必要がある。従
って、内部メモリのバンク数が多い場合には多数のデー
タレジスタおよびDPレジスタを備える必要がある。本
実施形態のマイクロプロセッサは、前述したマイクロプ
ロセッサ1において、単数のデータレジスタを介して、
内部メモリの複数のバンクをアクセス可能な構成をして
いる。
Third Embodiment In the above-described microprocessors of the first and second embodiments, a case where a plurality of data registers and a plurality of banks of the internal memory are fixedly associated with each other in one-to-one correspondence. explained. Therefore, in these microprocessors, it is necessary to provide data registers and DP registers in a number corresponding to the number of banks of the internal memory. Therefore, when the number of banks of the internal memory is large, it is necessary to provide a large number of data registers and DP registers. The microprocessor according to the present embodiment differs from the microprocessor 1 described above in that the microprocessor 1 has a single data register.
The configuration is such that a plurality of banks of the internal memory can be accessed.

【0064】図20は本実施形態のマイクロプロセッサ
121のALU13の周辺の構成図、図21はマイクロ
プロセッサ121の内部メモリ147の周辺の構成図で
ある。なお、図20および図21において、図1および
図2に示した構成要素と同じ構成要素には同じ符号を付
してある。マイクロプロセッサ121は、図20に示す
汎用レジスタモジュール123、マルチプレクサ12
5,127、ALU13、プログラムカウンタ34、イ
ンストラクションページメモリ35およびデコーダ36
と、図21に示す内部メモリ147、DPレジスタ14
9、メインメモリ150、バンク選択モジュール15
1、ローカルバス153および制御回路180とを、例
えば1チップ内に組み込んだ構成をしている。マイクロ
プロセッサ121は、データレジスタr0 と内部メモリ
147のバンク161〜164との関係以外は、例えば
4段パイプライン処理を含めて、基本的に、前述した第
1実施形態のマイクロプロセッサ1と同じである。
FIG. 20 is a configuration diagram around the ALU 13 of the microprocessor 121 of this embodiment, and FIG. 21 is a configuration diagram around the internal memory 147 of the microprocessor 121. In FIGS. 20 and 21, the same components as those shown in FIGS. 1 and 2 are denoted by the same reference numerals. The microprocessor 121 includes a general-purpose register module 123 and a multiplexer 12 shown in FIG.
5, 127, ALU 13, program counter 34, instruction page memory 35, and decoder 36
And the internal memory 147 and the DP register 14 shown in FIG.
9, main memory 150, bank selection module 15
1. A configuration in which the local bus 153 and the control circuit 180 are incorporated in, for example, one chip. The microprocessor 121 is basically the same as the microprocessor 1 of the above-described first embodiment, including, for example, four-stage pipeline processing, except for the relationship between the data register r 0 and the banks 161 to 164 of the internal memory 147. It is.

【0065】汎用レジスタモジュール123は、図1に
示す汎用レジスタモジュール11からデータレジスタr
1 およびバス25,27を除いた構成をしている。マル
チプレクサ125は、図1に示すバス25,22に対し
ての選択機能を備えていない点を除いて、図1に示すマ
ルチプレクサ16と同じである。また、マルチプレクサ
127は、図1に示すバス22に対しての選択機能を備
えていない点を除いて、図1に示すマルチプレクサ12
と同じである。
The general-purpose register module 123 is a data register r from the general-purpose register module 11 shown in FIG.
1 and buses 25 and 27 are excluded. The multiplexer 125 is the same as the multiplexer 16 shown in FIG. 1, except that the multiplexer 125 does not have a selection function for the buses 25 and 22 shown in FIG. The multiplexer 127 does not have the function of selecting the bus 22 shown in FIG. 1 except that the multiplexer 127 shown in FIG.
Is the same as

【0066】DPレジスタ149は、マイクロプロセッ
サ121がアクセスを行うメモリアドレス空間の全域の
アドレスを記憶可能な記憶容量を備え、メモリリード時
には、データレジスタr0 に読み出すデータのメモリア
ドレス空間内のアドレスを記憶し、メモリライト時に
は、データレジスタr0 に記憶されたデータの書き込み
先であるメモリアドレス空間内のアドレスを記憶する。
[0066] DP register 149 has a storage capacity capable of storing the address of the whole area of the memory address space the microprocessor 121 makes an access, at the time of memory read, the address of the memory address space of the data to be read into the data register r 0 stored, during memory write, stores the address of the memory address space is a write destination of data stored in the data register r 0.

【0067】DPレジスタ149は、図22に示すよう
に、32ビットのフィールドを有し、32ビットのアド
レスを記憶する。その結果、メモリアドレス空間とし
て、4Gバイトまでのアドレスを持つものを用いること
ができる。DPレジスタ149の32ビットフィールド
は、ページセレクトフィールド200、ページオフセッ
トフィールド201およびフィールド202からなる。
ページセレクトフィールド200は、ビット「9」〜
「31」によって構成され、メインメモリ150のメモ
リアドレス空間におけるページ(メモリブロック)の開
始アドレス(オフセット)を指定する。本実施形態で
は、1ページの容量を512バイトとしている。また、
ページオフセットフィールド201は、ビット「2」〜
「8」によって構成され、ページ内のオフセットを示し
ている。ここで、ページ内では、4バイト単位でメモリ
アクセスが行われる。また、フィールド202は、ビッ
ト「0」,「1」によって構成され、アドレスを指定す
るためには使用されない。
As shown in FIG. 22, DP register 149 has a 32-bit field and stores a 32-bit address. As a result, a memory address space having an address of up to 4 Gbytes can be used. The 32-bit field of the DP register 149 includes a page select field 200, a page offset field 201, and a field 202.
The page select field 200 includes bits “9” to
The start address (offset) of a page (memory block) in the memory address space of the main memory 150 is specified by “31”. In this embodiment, the capacity of one page is 512 bytes. Also,
The page offset field 201 includes bits “2” to
It is composed of "8" and indicates an offset within the page. Here, in the page, memory access is performed in units of 4 bytes. The field 202 is constituted by bits “0” and “1”, and is not used to specify an address.

【0068】内部メモリ147は、図21に示すよう
に、4個のバンク161,162,163,164に分
割されている。バンク161,162,163,164
は、ローカルバス152を介して、DPレジスタ149
に接続されている。ここで、ローカルバス152は、D
Pレジスタ149のうち、後述する図22に示すページ
オフセットフィールド201のみに接続され、7ビット
のバス幅を有する。また、バンク161,162,16
3,164は、ローカルバス153を介して、データレ
ジスタr0 に接続されている。
The internal memory 147 is divided into four banks 161, 162, 163 and 164, as shown in FIG. Banks 161, 162, 163, 164
Is connected to the DP register 149 via the local bus 152.
It is connected to the. Here, the local bus 152
Of the P register 149, it is connected only to a page offset field 201 shown in FIG. 22, which will be described later, and has a bus width of 7 bits. Banks 161, 162, 16
3,164, via the local bus 153, and is connected to the data register r 0.

【0069】バンク161〜164は、それぞれ1ペー
ジ分の容量を持ち、後述するように、選択回路179か
らの選択信号S1791 〜S1794 に応じてメインメ
モリ150から読み込んだページを記憶する。バンク1
61〜164に読み込まれるメインメモリ150上のデ
ータ(ページ)は、互いに重なり合うことはない。これ
は、選択回路179が、DPレジスタ149に記憶され
たアドレスに対応するページがバンク161〜164に
記憶されている場合には、そのページに対してメモリア
クセスを行い、その同じページをメインメモリ150か
ら読み出す作業を行わないためである。従って、バンク
161〜164のうち、2以上のバンクに同一のメモリ
アドレスのデータが記憶されることはない。
[0069] Bank 161 to 164 each have a capacity of one page, as described below, and stores the pages read from the main memory 150 in response to the selection signal S179 1 ~S179 4 from the selection circuit 179. Bank 1
The data (pages) on the main memory 150 that are read into 61 to 164 do not overlap each other. In other words, when a page corresponding to the address stored in the DP register 149 is stored in the banks 161 to 164, the selection circuit 179 performs memory access to the page and stores the same page in the main memory. This is because the operation of reading from the 150 is not performed. Therefore, data of the same memory address is not stored in two or more of the banks 161 to 164.

【0070】バンク161〜164は、データレジスタ
0 に対する読み出し動作を行う際に、それぞれイネー
ブル指示を示す選択信号S1791 〜S1794 を入力
すると、DPレジスタ149に記憶されたアドレスのペ
ージオフセットフィールド201によって示されるペー
ジ内のアドレスから4バイトのデータを読み出し、この
読み出したデータをローカルバス153を介してデータ
レジスタr0 に転送する。データレジスタr0 は、この
転送されたデータを記憶する。
When the banks 161 to 164 input the selection signals S179 1 to S179 4 each indicating an enable instruction when performing a read operation on the data register r 0 , the page offset field 201 of the address stored in the DP register 149 is input. 4 bytes of data are read from the address in the page indicated by, and the read data is transferred to the data register r 0 via the local bus 153. The data register r 0 stores the transferred data.

【0071】バンク161〜164は、データレジスタ
0 からの書き込み動作において、それぞれイネーブル
指示を示す選択信号S1791 〜S1794 を入力する
と、データレジスタr0 に記憶された4バイトのデータ
をローカルバス153を介して入力し、DPレジスタ1
49に記憶されたアドレスのページオフセットフィール
ド201によって示されるページ内のアドレスに記憶す
る。
In the write operation from the data register r 0 , the banks 161 to 164 input the selection signals S 179 1 to S 179 4 each indicating an enable instruction, and transfer the 4-byte data stored in the data register r 0 to the local bus. 153 and the DP register 1
49 is stored at the address within the page indicated by the page offset field 201 of the address stored in 49.

【0072】内部メモリ147は、ローカルバス153
を介してメインメモリ150に接続されている。メイン
メモリ150は、マイクロプロセッサ121のチップ内
に組み込んでも、あるいは、チップ外に設けてもよい。
The internal memory 147 has a local bus 153
Through the main memory 150. The main memory 150 may be built in the chip of the microprocessor 121 or provided outside the chip.

【0073】バンク選択モジュール151は、図21に
示すように、DPC(Data PointerCache)レジスタ17
0,171,172,173、比較器174,175,
176,177および選択回路179を有する。DPC
レジスタ170,171,172,173は、それぞれ
バンク161,162,163,164に記憶されてい
るページのメインメモリ150上の先頭アドレスを記憶
する。この先頭アドレスは、図22に示すDPレジスタ
149に記憶されるアドレスのページセレクトフィール
ド200に対応している。ここで、比較器174〜17
7においては、DPレジスタ149に記憶されたアドレ
スのうちページセレクトフィールド200のみを比較す
れば良いため、DPCレジスタ170,171,17
2,173は、ページセレクトフィールド200に記憶
される32ビットのアドレスのうち、ページセレクトフ
ィールド200に対応するアドレスを記憶する23ビッ
トを備えていればよい。
As shown in FIG. 21, the bank selection module 151 includes a DPC (Data PointerCache) register 17.
0,171,172,173, comparators 174,175,
176, 177 and a selection circuit 179. DPC
The registers 170, 171, 172, and 173 store the head addresses of the pages stored in the banks 161, 162, 163, and 164 on the main memory 150, respectively. This start address corresponds to the page select field 200 of the address stored in the DP register 149 shown in FIG. Here, the comparators 174 to 17
7, since only the page select field 200 of the addresses stored in the DP register 149 needs to be compared, the DPC registers 170, 171, 17
2,173 only needs to include 23 bits for storing an address corresponding to the page select field 200 among the 32-bit addresses stored in the page select field 200.

【0074】DPCレジスタ170,171,172,
173に記憶されたアドレスは、それぞれバンク16
1,162,163,164に記憶されたページと、メ
インメモリ150に記憶されたページとが入れ替えられ
たときに、DPレジスタ149に記憶されたアドレスの
ページセレクトフィールド200によって更新される。
DPC registers 170, 171, 172,
The addresses stored in 173 are stored in the respective banks 16
When the pages stored in 1, 162, 163, 164 and the pages stored in the main memory 150 are replaced, the page is updated by the page select field 200 of the address stored in the DP register 149.

【0075】比較器174,175,176,177
は、それぞれDPCレジスタ170,171,172,
173に記憶されたメインメモリ150上のページの開
始アドレスと、DPレジスタ149のページセレクタフ
ィールドに記憶されたアドレスとを比較し、その比較結
果を、比較データS174,S175,S176,S1
77として選択回路179のポートin0,in1,i
n2,in3にそれぞれ出力する。なお、比較器17
4,175,176,177における比較処理は、DP
レジスタ149に記憶されたアドレスが更新される度に
行われる。
The comparators 174, 175, 176, 177
Are the DPC registers 170, 171, 172,
173, and compares the start address of the page on the main memory 150 with the address stored in the page selector field of the DP register 149, and compares the comparison result with the comparison data S174, S175, S176, S1.
77 as the ports in0, in1, i of the selection circuit 179
Output to n2 and in3 respectively. Note that the comparator 17
The comparison process in 4,175,176,177 is DP
This is performed every time the address stored in the register 149 is updated.

【0076】選択回路179は、比較データS174,
S175,S176,S177のそれぞれに基づいて、
比較結果が一致を示している場合にはイネーブルを指示
し、比較結果が一致していない場合にはディスイネーブ
ルを指示する選択信号S1791 ,S1792 ,S17
3 ,S1794 をバンク161,162,163,1
64にそれぞれ継続して出力する。なお、選択回路17
9は、比較データS174〜S177が変化したとき
に、それぞれ選択信号S1791 〜S1794 を、イネ
ーブル指示とディスイネーブル指示との間で切り換え
る。
The selection circuit 179 outputs the comparison data S 174,
Based on each of S175, S176, and S177,
Select signals S179 1 , S179 2 , and S17 instructing enable when the comparison result indicates a match, and disabling when the comparison result does not match.
9 3 , S179 4 into banks 161, 162, 163, 1
64 are continuously output. The selection circuit 17
No. 9 switches the selection signals S179 1 to S179 4 between an enable instruction and a disable instruction when the comparison data S174 to S177 change.

【0077】また、選択回路179は、比較データS1
74,S175,S176,S177の全てが不一致で
あることを示す場合には、ページフォルトを示す指示信
号S1795 を制御回路180に出力する。制御回路1
80は、ページフォルトを示す指示信号S1795 を入
力すると、DPレジスタ149に記憶されているアドレ
スのページセレクタフィールドによって示されるメイン
メモリ150上の開始アドレスからページを読み出し、
このページをローカルバス153を介して内部メモリ1
47に読み込む。この内部メモリ147に読み込まれた
新たなページは、内部メモリ147のバンク161〜1
64に記憶された4枚のページのうち、最も先にアクセ
スされたページと入れ替えられる。すなわち、LRU(L
east Recently Used) 方式を採用する。なお、ページ入
れ替えのアルゴリズムは、LRUに限定されず、種々の
方法を採ることができる。ここで、ページフォルトの検
出は、キャッシュシステムを用いたマイクロプロセッサ
におけるキャッシュヒットの判断と同様に、回路上のク
リティカルパスになることが多い。ここで、クリティカ
ルパスは、LSIの最高動作周波数を決定する要因であ
る。
The selection circuit 179 outputs the comparison data S1
74, S175, S176, if all of S177 indicates that a mismatch, and outputs an instruction signal S179 5 showing a page fault to the control circuit 180. Control circuit 1
80 inputs the instruction signal S179 5 showing a page fault, reads a page from the start address of the main memory 150 indicated by the page selector field of the address stored in the DP register 149,
This page is stored in the internal memory 1 via the local bus 153.
Read into 47. The new pages read into the internal memory 147 are stored in the banks 161 to 1 of the internal memory 147.
Of the four pages stored in 64, the page that is accessed first is replaced. That is, LRU (L
east Recently Used) method. Note that the page replacement algorithm is not limited to LRU, and various methods can be adopted. Here, the detection of a page fault often becomes a critical path on a circuit, similarly to the determination of a cache hit in a microprocessor using a cache system. Here, the critical path is a factor that determines the highest operating frequency of the LSI.

【0078】次に、上述したマイクロプロセッサ121
のメモリアクセス動作について説明する。図23は、マ
イクロプロセッサ121のメモリアクセス動作を説明す
るためのフローチャートである。先ず、図20に示すイ
ンストラクションページメモリ35上のプログラムカウ
ンタ34が指し示すアドレスから命令がフェッチされ、
デコーダ36においてデコードされる。このとき、デコ
ードされた命令が、メインメモリ150のメモリアドレ
ス空間上のデータを用いた演算命令である場合には、当
該データのメインメモリ150のメモリアドレス空間内
のアドレスが、図21に示すDPレジスタ149に記憶
される(ステップS1)。
Next, the microprocessor 121
Will be described. FIG. 23 is a flowchart illustrating a memory access operation of microprocessor 121. First, an instruction is fetched from the address indicated by the program counter 34 on the instruction page memory 35 shown in FIG.
The data is decoded in the decoder 36. At this time, if the decoded instruction is an operation instruction using data in the memory address space of the main memory 150, the address of the data in the memory address space of the main memory 150 is changed to the DP shown in FIG. It is stored in the register 149 (step S1).

【0079】次に、比較器174〜177において、そ
れぞれDPレジスタ149に記憶されたアドレスのペー
ジセレクトフィールド200と、DPCレジスタ170
〜173に記憶されたアドレスとが比較され、それらの
比較データS174〜S177が選択回路179に出力
される(ステップS2)。
Next, in the comparators 174 to 177, the page select field 200 of the address stored in the DP register 149 and the DPC register 170
173 are compared with each other, and the comparison data S174 to S177 are output to the selection circuit 179 (step S2).

【0080】次に、選択回路179において、比較デー
タS174〜S177の何れかが、アドレスの一致を示
しているか否かが判断され(ステップS3)、一致して
いることを示す比較データがある場合には、その比較デ
ータS174〜S177に対応するバンク161〜16
4に対して、イネーブルを示す指示信号S1791 〜1
794 を出力する。これによって、イネーブルを示す指
示信号S1791 〜1794 を入力したバンク161〜
164において、DPレジスタ149に記憶されたアド
レスのページオフセットフィールド201に示されるペ
ージ内のアドレスからデータが読み出され、この読み出
されたデータが、ローカルバス153を介して、データ
レジスタr0 に転送され記憶される(ステップS4)。
Next, in the selection circuit 179, it is determined whether or not any of the comparison data S174 to S177 indicates an address match (step S3). Include banks 161 to 16 corresponding to the comparison data S174 to S177.
4, instruction signals S179 1 to 1 indicating enable.
79 4 to output. As a result, the banks 161 to 161 to which the instruction signals S179 1 to 179 4 indicating enable are input are provided.
At 164, data is read from the address in the page indicated by the page offset field 201 of the address stored in the DP register 149, and the read data is transferred to the data register r 0 via the local bus 153. The data is transferred and stored (step S4).

【0081】一方、選択回路179において、比較デー
タS174〜S177の全てが、不一致であることを示
していると判断された場合には(ステップS3)、前述
したLRUのアルゴリズムを用いて、メインメモリ15
0から対応するページをローカルバス153を介して内
部メモリ147に読み出すことを決定する(ステップS
5)。
On the other hand, if the selection circuit 179 determines that all of the comparison data S174 to S177 indicate mismatch (step S3), the main memory is written using the LRU algorithm described above. Fifteen
From 0, it is determined that the corresponding page is to be read out to the internal memory 147 via the local bus 153 (step S).
5).

【0082】そして、LRUのアルゴリズムによって入
れ替え対象となった内部メモリ147のバンク161〜
164に記憶されたページ内にダーティビットが存在す
るか否かが判断され(ステップS6)、ダーディビット
が存在する場合には、当該ページをメインメモリ150
にライトバックする(ステップS8)。ここで、ダーテ
ィビットは、例えば、マイクロプロセッサ121によっ
て、当該ページに書き込みが行われた場合に付される。
The banks 161 to 161 of the internal memory 147 which have been replaced by the LRU algorithm
It is determined whether or not the dirty bit exists in the page stored in the memory 164 (step S6).
(Step S8). Here, the dirty bit is added when, for example, the microprocessor 121 has written to the page.

【0083】次に、ステップS5において、入れ替え対
象となった内部メモリ147のバンク161〜164
に、DPレジスタ149に記憶されたアドレスによって
指し示されるページをメインメモリ150からローカル
バス153を介して読み込み、ページの入れ替えを行う
(ステップS7)。このとき、DPレジスタ149に記
憶されたアドレスのページセレクトフィールド200に
よって、入れ替えを行ったバンク161〜164に対応
するDPCレジスタ170〜173に記憶されたアドレ
スを更新する。
Next, in step S5, the banks 161 to 164 of the internal memory 147 to be replaced are set.
Next, the page pointed to by the address stored in the DP register 149 is read from the main memory 150 via the local bus 153, and the pages are replaced (step S7). At this time, the address stored in the DPC registers 170 to 173 corresponding to the replaced banks 161 to 164 is updated by the page select field 200 of the address stored in the DP register 149.

【0084】一方、入れ替えの対象となったバンク16
1〜164に記憶されたページ内にダーティビットが存
在しない場合にも、当該入れ替えの対象となったページ
を、メインメモリ150から読み込んだページと入れ替
えるが、メインメモリ150へのライトバックは行わな
い(ステップS7)。
On the other hand, the bank 16
Even when the dirty bits do not exist in the pages stored in Nos. 1 to 164, the replacement target page is replaced with the page read from the main memory 150, but the write back to the main memory 150 is not performed. (Step S7).

【0085】図24は、図20および図21に示すマイ
クロプロセッサ121におけるメモリアクセスのタイミ
ング図である。図24(A)に示すように、最初の5サ
イクルではバンク161に対してのアクセスおよびその
手続き(オペレーション)を行い、次の5サイクルでは
バンク162に対してのアクセスおよびその手続きを行
い、次の3サイクルではバンク163に対してのアクセ
スおよびその手続きを行う。なお、図24(A)におい
て、「X」はDPレジスタ149に記憶されたアドレス
の更新を行うオペレーションを示し、「Y」はデータレ
ジスタr0 に対しての読み出し動作あるいは書き込み動
作を行うオペレーションを示している。ここで、バンク
161〜164は、既に有効なデータを保持しているも
のとする。
FIG. 24 is a timing chart of memory access in microprocessor 121 shown in FIGS. 20 and 21. As shown in FIG. 24A, access to bank 161 and its procedure (operation) are performed in the first five cycles, and access and procedure to bank 162 are performed in the next five cycles. In the three cycles, access to the bank 163 and its procedure are performed. Note that in FIG. 24 (A), "X" indicates an operation for updating the address stored in the DP register 149, "Y" operations to perform a read operation or a write operation to the data register r 0 Is shown. Here, it is assumed that the banks 161 to 164 already hold valid data.

【0086】図24(B)は、バンク161に対しての
アクセス動作を行う際にDPレジスタ149に記憶され
るアドレスのタイミングを示し、アドレス「A0」,
「A1」,「A2」,「A3」,「A4」,「A5」
は、図22に示すページセレクトフィールド200に対
応するアドレスが全て同一である。図24(C)は、バ
ンク161に対して読み出し動作あるいは書き込み動作
が行われるデータを示している。図24(C)に示すデ
ータは、データレジスタr0 に記憶される。
FIG. 24B shows the timing of the address stored in the DP register 149 when performing an access operation to the bank 161. The address "A0",
"A1", "A2", "A3", "A4", "A5"
Have the same address for the page select field 200 shown in FIG. FIG. 24C illustrates data on which a read operation or a write operation is performed on the bank 161. The data shown in FIG. 24C is stored in the data register r0.

【0087】また、図24(D)は、バンク162に対
してのアクセス動作を行う際にDPレジスタ149に記
憶されるアドレスのタイミングを示し、アドレス「B
0」,「B1」,「B2」,「B3」,「B4」,「B
5」は、図22に示すページセレクトフィールド200
に対応するアドレスが全て同一である。図24(E)
は、バンク162に対して読み出し動作あるいは書き込
み動作が行われるデータを示している。図24(E)に
示すデータは、データレジスタr0 に記憶される。
FIG. 24D shows the timing of the address stored in the DP register 149 when the access operation to the bank 162 is performed.
0 "," B1 "," B2 "," B3 "," B4 "," B
5 "is the page select field 200 shown in FIG.
Are all the same. FIG. 24 (E)
Indicates data for which a read operation or a write operation is performed on the bank 162. The data shown in FIG. 24E is stored in the data register r0.

【0088】また、図24(F)は、バンク163に対
してのアクセス動作を行う際にDPレジスタ149に記
憶されるアドレスのタイミングを示し、アドレス「C
0」,「C1」,「C2」,「C3」は、図22に示す
ページセレクトフィールド200に対応するアドレスが
全て同一である。図24(G)は、バンク163に対し
て読み出し動作あるいは書き込み動作が行われるデータ
を示している。図24(G)に示すデータは、データレ
ジスタr0 に記憶される。
FIG. 24F shows the timing of the address stored in the DP register 149 when the access operation to the bank 163 is performed.
"0", "C1", "C2", and "C3" all have the same address corresponding to the page select field 200 shown in FIG. FIG. 24G illustrates data on which a read operation or a write operation is performed on the bank 163. Data shown in FIG. 24 (G) is stored in the data register r 0.

【0089】さらに、図24(H)は、バンク164に
対してのアクセス動作を行う際にDPレジスタ149に
記憶されるアドレスのタイミングを示し、図24(I)
は、バンク164に対して読み出し動作あるいは書き込
み動作が行われるデータを示している。
FIG. 24H shows the timing of the address stored in the DP register 149 when the bank 164 is accessed, and FIG.
Indicates data for which a read operation or a write operation is performed on the bank 164.

【0090】図24(A),(B),(C)に示すよう
に、1サイクル目では、バンク161を選択するために
DPレジスタ149にアドレス「A0」を書き込む。こ
れによって、データレジスタr0 に、バンク161内の
アドレス「A0」のページオフセットフィールド201
によって示されるアドレスからデータが読み出され、図
24(C)に示すように、バンク161のデータポート
からデータ「d0」が出力され、このデータ「d0」が
データレジスタr0 に記憶される。その後、マイクロプ
ロセッサ121において、前述した第1実施形態のマイ
クロプロセッサ1において述べたように、DPレジスタ
149のアドレスが自動的に更新され、バンク内の連続
したアドレスが順次にアクセスされる。
As shown in FIGS. 24A, 24B and 24C, in the first cycle, the address “A0” is written to the DP register 149 in order to select the bank 161. As a result, the page offset field 201 of the address “A0” in the bank 161 is stored in the data register r 0.
Data is read out from the address indicated by, as shown in FIG. 24 (C), is output data "d0" from the data port of the bank 161, the data "d0" is stored in the data register r 0. Thereafter, in the microprocessor 121, as described in the microprocessor 1 of the first embodiment, the address of the DP register 149 is automatically updated, and successive addresses in the bank are sequentially accessed.

【0091】データレジスタr0 には、DPレジスタ1
49に記憶されたアドレスを更新した次のサイクルで、
特に指定のない限りデータの先読みを実行する。従っ
て、2サイクル目では、アドレス「A0」が更新されて
「A1」となる。これによって、バンク161のアドレ
ス「A1」からデータ「d1」が読み出され、バンク1
61のデータポートから出力される。この2サイクル目
では、バンク161が選択されているため、データレジ
スタr0 に記憶されたデータ「d0」が、図20に示す
ALU13の入力ポートに出力された直後に、バンク1
61のデータポートからデータ「d1」が出力される。
The data register r 0 contains the DP register 1
In the next cycle after updating the address stored in 49,
Prefetch data unless otherwise specified. Therefore, in the second cycle, the address “A0” is updated to “A1”. As a result, the data “d1” is read from the address “A1” of the bank 161 and the data of the bank 1 is read.
It is output from 61 data ports. In the second cycle, since the bank 161 is selected, immediately after the data “d0” stored in the data register r 0 is output to the input port of the ALU 13 shown in FIG.
Data “d1” is output from the 61 data ports.

【0092】以下、同様な処理が行われ、図24(J)
に示すように、データレジスタr0には、データ「d
0」〜「d12」が順次に記憶される。
Thereafter, similar processing is performed, and FIG.
As shown in the figure, the data “d” is stored in the data register r 0.
"0" to "d12" are sequentially stored.

【0093】以上説明したように、マイクロプロセッサ
121によれば、バンク選択モジュール151を設ける
ことで、4個のバンク161〜164に対して、単数の
DPレジスタ149を用いてアクセスできる。なお、バ
ンク選択モジュール151のDPCレジスタ170〜1
73は、ユーザは通常の方法ではアクセスできず、ユー
ザが管理する必要がない。
As described above, according to the microprocessor 121, by providing the bank selection module 151, the four banks 161 to 164 can be accessed using the single DP register 149. The DPC registers 170 to 1 of the bank selection module 151
At 73, the user cannot access in a normal manner, and does not need to be managed by the user.

【0094】ところで、第1実施形態および第2実施形
態のように、内部メモリのバンク毎に固定したデータレ
ジスタを設けると、汎用レジスタの数に制限がある場合
には、汎用レジスタとして使用できるレジスタの数が減
ってしまい、処理能力の向上が抑えられる可能性があ
る。これに対して、マイクロプロセッサ121では、単
数のデータレジスタr0 が4個の全てのバンク161〜
164とデータ転送を行うことができるため、汎用レジ
スタモジュール123に設けられた16個のレジスタの
うちの一つのみをデータレジスタr0 として設ければよ
い。その結果、汎用レジスタとして使用できるレジスタ
の数を増やすことができ、第1実施形態および第2実施
形態に比べて、処理能力をさらに向上できる。マイクロ
プロセッサ121は、特に、内部メモリのバンク数が多
い場合に有効である。
By the way, if a fixed data register is provided for each bank of the internal memory as in the first and second embodiments, if the number of general-purpose registers is limited, a register that can be used as a general-purpose register is used. May be reduced, and an increase in processing capacity may be suppressed. In contrast, in the microprocessor 121, all banks data register r 0 is the four single 161 to
Since data transfer with 164 can be performed, only one of the 16 registers provided in the general-purpose register module 123 needs to be provided as the data register r 0 . As a result, the number of registers that can be used as general-purpose registers can be increased, and the processing capability can be further improved as compared with the first embodiment and the second embodiment. The microprocessor 121 is particularly effective when the number of banks of the internal memory is large.

【0095】また、マイクロプロセッサ121によれ
ば、DPCレジスタ170〜173に、DPレジスタ1
49に記憶されたアドレスのページセレクトフィールド
200に対応する部分のみを記憶するため、DPレジス
タ149に記憶されたアドレスの全体を記憶する場合に
比べて、DPCレジスタ170〜173および比較器1
74〜177の回路を縮小化できる。また、比較器17
4〜177の比較処理を高速に行うことができる。
According to the microprocessor 121, the DPC registers 170 to 173 store the DP register 1
Since only the portion of the address stored in the DP 49 corresponding to the page select field 200 is stored, the DPC registers 170 to 173 and the comparator 1 are compared with the case where the entire address stored in the DP register 149 is stored.
Circuits 74 to 177 can be reduced in size. Also, the comparator 17
4 to 177 can be performed at high speed.

【0096】また、マイクロプロセッサ121によれ
ば、バンク数分の比較器174〜177を設けて比較処
理を並列化することで、DPレジスタ149に記憶され
たアドレスの更新時と同一のサイクルで、バンク161
〜164から所望のデータを読み出すことができる。
Further, according to the microprocessor 121, the comparators 174 to 177 for the number of banks are provided to parallelize the comparison processing, so that in the same cycle as when the address stored in the DP register 149 is updated, Bank 161
Desired data can be read from.

【0097】また、マイクロプロセッサ121によれ
ば、DPレジスタ149に記憶するアドレスを図22に
示すような、ページセレクトフィールド200とページ
オフセットフィールド201とで構成されるフォーマッ
トにしたことで、バンク選択モジュール151によって
同一のページがバンク161〜164のうち複数のバン
クに記憶されることを簡単な構成で回避でき、内部メモ
リ147を効率的に使用できる。また、DPレジスタ1
49のページオフセットフィールド201のみを内部メ
モリ147に接続すればよく、ローカルバス152のバ
ス幅を小さくできる。
Further, according to the microprocessor 121, the address stored in the DP register 149 has a format including the page select field 200 and the page offset field 201 as shown in FIG. With 151, the same page can be prevented from being stored in a plurality of banks among the banks 161 to 164 with a simple configuration, and the internal memory 147 can be used efficiently. Also, DP register 1
Only the 49 page offset fields 201 need be connected to the internal memory 147, and the bus width of the local bus 152 can be reduced.

【0098】さらに、マイクロプロセッサ121によれ
ば、DPレジスタ149に記憶されているアドレスのう
ち、必要なフィールドのみをDPCレジスタ170およ
びバンク161〜164に転送しているため、アドレス
線の本数を抑制できる。なお、一般的に、アドレス線は
速いアクセス速度を得るために、配線が短く、容量が少
ない方が良い。また、アドレスとして用いる配線の本数
も少ないほうがよい。アクセスに伴う電力と、電源配線
容量の効果も無視できないからである。なお、マイクロ
プロセッサ121は、前述した第1実施形態のマイクロ
プロセッサ1の効果も同様に得ることができる。
Further, according to the microprocessor 121, only necessary fields among the addresses stored in the DP register 149 are transferred to the DPC register 170 and the banks 161 to 164, so that the number of address lines is suppressed. it can. In general, in order to obtain a high access speed, it is preferable that the address line be short and have a small capacity. Further, it is preferable that the number of wirings used as addresses is small. This is because the effects of the power associated with the access and the power supply wiring capacitance cannot be ignored. Note that the microprocessor 121 can also obtain the same effects as those of the microprocessor 1 of the first embodiment.

【0099】本発明は上述した実施形態には限定されな
い。例えば、上述したマイクロプロセッサ121では、
ローカルバス153を介して、DPレジスタ149およ
びメインメモリ150とバンク161〜164との間の
データ伝送を行う場合について例示したが、マイクロプ
ロセッサ121において、例えば、図25に示すよう
に、ローカルバス153a,153bを用いて、このデ
ータ伝送を実現してもよい。
The present invention is not limited to the above embodiment. For example, in the microprocessor 121 described above,
Although the case where data transmission between the DP register 149 and the main memory 150 and the banks 161 to 164 is performed via the local bus 153 has been described as an example, in the microprocessor 121, for example, as shown in FIG. , 153b may be used to realize this data transmission.

【0100】この場合には、図25に示すように、ロー
カルバス153aにデータレジスタr0 を接続し、ロー
カルバス153bにメインメモリ150を接続する。ま
た、バンク161〜164を、それぞれマルチプレクサ
301〜304を介して、ローカルバス153aおよび
153bに接続する。マルチプレクサ301〜304
は、それぞれバンク161〜164を、ローカルバス1
53aおよび153bの何れか一方と選択的に接続す
る。制御回路300は、制御信号S300aをバンク1
61〜164に出力し、データレジスタr0 との間のデ
ータの読み出しおよび書き込みを制御する。また、制御
回路300は、制御信号S300bをバンク161〜1
64に出力し、メインメモリ150との間のページ入れ
替え処理を制御する。
In this case, as shown in FIG. 25, the data register r 0 is connected to the local bus 153a, and the main memory 150 is connected to the local bus 153b. The banks 161 to 164 are connected to local buses 153a and 153b via multiplexers 301 to 304, respectively. Multiplexers 301-304
Respectively connects the banks 161 to 164 with the local bus 1
Selectively connect to one of 53a and 153b. The control circuit 300 transmits the control signal S300a to the bank 1
Output to 61-164, controls the reading and writing of data between the data register r 0. Further, the control circuit 300 transmits the control signal S300b to the banks 161-1.
64 to control the page exchange processing with the main memory 150.

【0101】図25に示すような構成を採用すること
で、バンク161〜164のうち一のバンクとデータレ
ジスタr0 との間のデータ転送と、その他のバンクとメ
インメモリ150との間のページ入れ替え処理とを並行
して行う(多重化する)ことができる。そのため、ペー
ジフォルトに伴うページ入れ替え処理に要する時間を隠
蔽することができる。
[0102] By adopting the configuration as shown in FIG. 25, pages between the data transfer and the other bank and the main memory 150 of between one bank and data registers r 0 of the bank 161 to 164 The replacement process can be performed (multiplexed) in parallel. Therefore, it is possible to hide the time required for the page replacement process due to the page fault.

【0102】また、マイクロプロセッサ121では、汎
用レジスタモジュール11に単数のDPレジスタ149
を設ける場合について例示したが、本発明は、複数のD
Pレジスタを設け、そのうち少なくとも一つが複数のバ
ンクと接続可能な構成にしてもよい。
In the microprocessor 121, a single DP register 149 is stored in the general-purpose register module 11.
Is provided, but the present invention provides a plurality of D
A configuration may be adopted in which a P register is provided, at least one of which can be connected to a plurality of banks.

【0103】また、マイクロプロセッサ121では、D
Pレジスタ149に記憶されたアドレスが更新される度
に、比較器174〜177で比較処理を行う場合につい
て例示したが、例えば、選択回路179あるいは制御回
路180によって、DPレジスタ149に記憶されたペ
ージセレクトフィールド200が更新されたか否かを監
視し、ページセレクトフィールド200が更新された場
合にのみ、比較器174〜177における比較処理を行
うように制御してもよい。このように制御を行うこと
で、比較器174〜177における比較処理の実行頻度
を飛躍的に減少でき、低電力化を図ることができる。
In the microprocessor 121, D
The case where the comparison process is performed by the comparators 174 to 177 every time the address stored in the P register 149 is updated has been described. For example, the page stored in the DP register 149 is controlled by the selection circuit 179 or the control circuit 180. Whether or not the select field 200 has been updated may be monitored, and only when the page select field 200 is updated, the comparators 174 to 177 may be controlled to perform the comparison process. By performing control in this manner, the frequency of execution of the comparison processing in the comparators 174 to 177 can be significantly reduced, and power consumption can be reduced.

【0104】また、上述したマイクロプロセッサ121
では、内部メモリ147に4個のバンクを設けた場合に
ついて例示したが、本発明では、内部メモリに設けるバ
ンクの数は2以上であれば任意である。また、上述した
マイクロプロセッサ121では、DPCレジスタ170
〜173にDPレジスタ149のページセレクトフィー
ルド200のみを記憶する場合を例示したが、DPCレ
ジスタ170〜173に、DPレジスタ149に記憶さ
れるアドレスの全体、あるいは、ページセレクトフィー
ルド200およびページオフセットフィールド201の
みを記憶するようにしてもよい。
Also, the microprocessor 121
In the above, the case where four banks are provided in the internal memory 147 has been exemplified, but in the present invention, the number of banks provided in the internal memory is arbitrary as long as it is two or more. Also, in the microprocessor 121 described above, the DPC register 170
173 stores only the page select field 200 of the DP register 149, but the DPC registers 170 to 173 store the entire address stored in the DP register 149 or the page select field 200 and the page offset field 201. Only the information may be stored.

【0105】また、マイクロプロセッサ1では、汎用レ
ジスタモジュール11のうち、2個の汎用レジスタをデ
ータレジスタr0 ,r1 として用いた場合について例示
したが、データレジスタの数は、1以上であれば任意で
ある。また、データレジスタr0 ,r1 の使用方法は、
内部メモリ47との間のインターフェイスとして用いる
他、例えば、複数のマイクロプロセッサを搭載した並列
処理プロセッサにおけるマイクロプロセッサ相互間で通
信を行う際のFIFO(First In First Out)メモリと
して用いてもよい。また、データレジスタr0,r
1 は、ローカルメモリあるいはスタックメモリとして用
いてもよい。
In the microprocessor 1, the case where two general-purpose registers among the general-purpose register modules 11 are used as the data registers r 0 and r 1 has been exemplified. However, if the number of data registers is one or more, Optional. The usage of the data registers r 0 and r 1 is as follows.
Instead of being used as an interface with the internal memory 47, for example, it may be used as a FIFO (First In First Out) memory when performing communication between microprocessors in a parallel processor equipped with a plurality of microprocessors. Further, data registers r 0 , r
1 may be used as a local memory or a stack memory.

【0106】また、マイクロプロセッサ1では、図1に
示すように、マルチプレクサ12とマルチプレクサ16
とを独立に設けたが、マルチプレクサ16の機能をマル
チプレクサ12に組み込んでもよい。
Further, in the microprocessor 1, as shown in FIG.
The functions of the multiplexer 16 may be incorporated in the multiplexer 12.

【0107】また、マイクロプロセッサ1では、図2に
示すように、内部メモリ47を2バンクに分けて構成し
たが、内部メモリ47を3バンク以上にバンク分けした
構成、あるいは、バンク分けしていない構成にしてもよ
い。
Further, in the microprocessor 1, as shown in FIG. 2, the internal memory 47 is divided into two banks, but the internal memory 47 is divided into three or more banks, or the banks are not divided. It may be configured.

【0108】また、マイクロプロセッサ1では、図1に
示すように、汎用レジスタモジュール11に、複数の汎
用レジスタの一部として、データレジスタr0 ,r1
設けたが、汎用レジスタモジュール11の外部に、デー
タレジスタr0 ,r1 を設け、汎用レジスタとは別に扱
うようにしてもよい。
Further, in the microprocessor 1, as shown in FIG. 1, the general-purpose register module 11 is provided with data registers r 0 and r 1 as a part of a plurality of general-purpose registers. May be provided with data registers r 0 and r 1 so as to be handled separately from general-purpose registers.

【0109】また、図16に示すメモリ構造を持つマイ
クロプロセッサ81において、内部メモリ87の代わり
に3本のFIFOメモリを備え、データレジスタr1
Rに入力用のFIFOメモリを接続し、データレジスタ
1 −Wに出力用のFIFOメモリを接続した構成にし
てもよい。
In the microprocessor 81 having the memory structure shown in FIG. 16, three FIFO memories are provided instead of the internal memory 87, and the data register r 1-
A configuration may be adopted in which an input FIFO memory is connected to R and an output FIFO memory is connected to the data register r 1 -W.

【0110】[0110]

【発明の効果】以上説明したように、本発明の演算処理
装置およびメモリアクセス方法によれば、単数のデータ
レジスタを介して、演算手段と、内部メモリの複数のバ
ンクとの間で、データ転送を行うことができ、レジスタ
資源を効果的に利用できる。その結果、データレジスタ
として汎用レジスタを用いている場合にも、汎用レジス
タの機能を適切に発揮させることができる。また、本発
明の演算処理装置およびメモリアクセス方法によれば、
内部メモリに対してのアクセスをデータレジスタを用い
て実現することで、内部メモリに対してのアクセスをレ
ジスタに対してのアクセスと同様に扱うことができる。
その結果、ユーザのプログラム作成時の負担を軽減でき
る。
As described above, according to the arithmetic processing device and the memory access method of the present invention, data transfer between arithmetic means and a plurality of banks of the internal memory via a single data register. And the register resources can be used effectively. As a result, even when a general-purpose register is used as the data register, the function of the general-purpose register can be properly exhibited. According to the arithmetic processing device and the memory access method of the present invention,
By realizing access to the internal memory using the data register, access to the internal memory can be treated in the same way as access to the register.
As a result, the burden on the user when creating a program can be reduced.

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

【図1】図1は、本発明の第1実施形態に係わるマイク
ロプロセッサの構成図である。
FIG. 1 is a configuration diagram of a microprocessor according to a first embodiment of the present invention.

【図2】図2は、図1に示すマイクロプロセッサのデー
タレジスタ、DPレジスタおよび内部メモリを説明する
ための図である。
FIG. 2 is a diagram for explaining a data register, a DP register, and an internal memory of the microprocessor shown in FIG. 1;

【図3】図3は、図1に示す汎用レジスタモジュールの
構成を説明するための図である。
FIG. 3 is a diagram for explaining a configuration of a general-purpose register module shown in FIG. 1;

【図4】図4は、図1に示すマイクロプロセッサの4段
パイプラン処理を説明するための図である。
FIG. 4 is a diagram for explaining a four-stage pipeline process of the microprocessor shown in FIG. 1;

【図5】図5は、図1に示すマイクロプロセッサのパイ
プラン処理を説明するための図である。
FIG. 5 is a diagram for explaining the pipeline process of the microprocessor shown in FIG. 1;

【図6】図6は、図1に示すマイクロプロセッサにおい
て用いられる2オペランド演算命令のフォーマットを説
明するための図である。
FIG. 6 is a view for explaining a format of a two-operand operation instruction used in the microprocessor shown in FIG. 1;

【図7】図7は、図6に示す演算命令において、ソース
レジスタにデータレジスタを指定した場合の演算命令を
説明するための図である。
FIG. 7 is a diagram for explaining an operation instruction when a data register is specified as a source register in the operation instruction shown in FIG. 6;

【図8】図8は、図6に示す演算命令において、ディス
ティネーションレジスタにデータレジスタを指定した場
合の演算命令を説明するための図である。
FIG. 8 is a diagram for explaining an operation instruction when a data register is designated as a destination register in the operation instruction shown in FIG. 6;

【図9】図9は、図6に示す演算命令において、ソース
レジスタおよびディスティネーションレジスタの双方に
データレジスタを指定した場合の演算命令を説明するた
めの図である。
FIG. 9 is a diagram for explaining an operation instruction when a data register is designated as both a source register and a destination register in the operation instruction shown in FIG. 6;

【図10】図10は、図8に示す演算命令を連続して行
う場合に生じるパイプライン処理のストールを説明する
ための図である。
FIG. 10 is a diagram for explaining a stall in pipeline processing that occurs when the operation instructions shown in FIG. 8 are continuously performed.

【図11】図11は、図1に示すマイクロプロセッサに
おいて用いられる3オペランド演算命令のフォーマット
を説明するための図である。
FIG. 11 is a diagram for explaining a format of a three-operand operation instruction used in the microprocessor shown in FIG. 1;

【図12】図1に示すマイクロプロセッサにおいて、従
来のマイクロプロセッサにおける図30に示すプログラ
ムと同様の処理を記述したプログラムを説明するための
図である。
12 is a diagram for describing a program in the microprocessor shown in FIG. 1 that describes processing similar to the program shown in FIG. 30 in a conventional microprocessor.

【図13】図13は、図1に示すマイクロプロセッサに
おいて、図12に示すプログラムと同様の処理を、ソー
スレジスタおよびディステイネイションアドレスとして
データレジスタを指定して記述したプログラムを説明す
るための図である。
13 is a view for explaining a program in which the same processing as the program shown in FIG. 12 is described in the microprocessor shown in FIG. 1 by designating a data register as a source register and a destination address; It is.

【図14】図14は、図1に示すマイクロプロセッサに
おいて、内部メモリ上の連続したメモリアドレスに記憶
されたデータを加工する処理を示すプログラムを説明す
るための図である。
FIG. 14 is a diagram for explaining a program showing a process of processing data stored at consecutive memory addresses on an internal memory in the microprocessor shown in FIG. 1;

【図15】図15は、図1に示すマイクロプロセッサに
おいて、メモリアクセスのパスを3系統にして、加算命
令の3個の全てのオペランドにデータレジスタを指定し
た命令を含むプログラムを説明するための図である。
FIG. 15 is a diagram for explaining a program including an instruction in which a data register is specified in all three operands of an addition instruction in the microprocessor shown in FIG. FIG.

【図16】図16は、本発明の第2実施形態に係わるマ
イクロプロセッサの内部メモリの周辺の構成図である。
FIG. 16 is a configuration diagram around an internal memory of a microprocessor according to a second embodiment of the present invention.

【図17】図17は、2オペランド演算命令において、
ディスティネーションアドレスとしてデータレジスタを
指定した場合の例を説明するための図である。
FIG. 17 shows two-operand operation instructions.
FIG. 4 is a diagram for describing an example in which a data register is specified as a destination address.

【図18】図18は、本発明の第2実施形態に係わるマ
イクロプロセッサにおいて、内部メモリ上の連続したメ
モリアドレスに記憶されたデータを加工するプログラム
を説明するための図である。
FIG. 18 is a diagram for explaining a program for processing data stored in continuous memory addresses on an internal memory in the microprocessor according to the second embodiment of the present invention.

【図19】図19は、図18に示すプログラムを図4に
示す4段パイプライン処理で実行した場合を説明するた
めの図である。
FIG. 19 is a diagram for explaining a case where the program shown in FIG. 18 is executed by the four-stage pipeline processing shown in FIG. 4;

【図20】図20は、本発明の第3実施形態のマイクロ
プロセッサのALUの周辺の構成図である。
FIG. 20 is a configuration diagram around an ALU of a microprocessor according to a third embodiment of the present invention;

【図21】図21は、図20に示すマイクロプロセッサ
の内部メモリの周辺の構成図である。
FIG. 21 is a configuration diagram around an internal memory of the microprocessor shown in FIG. 20;

【図22】図22は、図21に示すDPレジスタの構成
を説明するための図である。
FIG. 22 is a diagram for explaining a configuration of a DP register shown in FIG. 21;

【図23】図23は、図20および図21に示すマイク
ロプロセッサのメモリアクセス動作を説明するためのフ
ローチャートである。
FIG. 23 is a flowchart illustrating a memory access operation of the microprocessor shown in FIGS. 20 and 21;

【図24】図24は、図20および図21に示すマイク
ロプロセッサにおけるメモリアクセスのタイミング図で
ある。
FIG. 24 is a timing chart of memory access in the microprocessor shown in FIGS. 20 and 21;

【図25】図25は、図21に示すマイクロプロセッサ
の内部メモリの周辺の変形例の構成図である。
FIG. 25 is a configuration diagram of a modification around the internal memory of the microprocessor shown in FIG. 21;

【図26】図26は、従来のRISC型およびCISC
型のマイクロプロセッサの汎用レジスタを説明するため
の図である。
FIG. 26 shows a conventional RISC type and CISC type.
FIG. 4 is a diagram for explaining general-purpose registers of a type microprocessor.

【図27】図27は、従来のマイクロプロセッサおける
3個のレジスタ指定子を持つALU演算命令を説明する
ための図である。
FIG. 27 is a diagram for explaining an ALU operation instruction having three register specifiers in a conventional microprocessor.

【図28】図28は、従来のマイクロプロセッサにおけ
るメモリ上のデータを加工する命令を説明するための図
である。
FIG. 28 is a diagram for explaining an instruction for processing data on a memory in a conventional microprocessor.

【図29】図29は、従来のマイクロプロセッサの5段
パイプラン処理を説明するための図である。
FIG. 29 is a diagram for explaining a five-stage pipeline process of a conventional microprocessor.

【図30】図30は、図29に示す5段パイプライン処
理において、メモリ上のデータをALU演算の対象にし
た処理のプログラムを説明するための図である。
FIG. 30 is a diagram for explaining a program for processing in which data on a memory is subjected to an ALU operation in the five-stage pipeline processing shown in FIG. 29;

【図31】図31は、従来のマイクロプロセッサにおい
て、メモリアドレス空間上の一定の距離を隔てたアドレ
スに繰り返してアクセスする処理のプログラムを説明す
るための図である。
FIG. 31 is a diagram for explaining a program of a process of repeatedly accessing addresses at a predetermined distance in a memory address space in a conventional microprocessor.

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

1…マイクロプロセッサ、11,123…汎用レジスタ
モジュール、12,16,125,127…マルチプレ
クサ、13…ALU、21,22,23,24,25,
26,27…バス、30,31,149…DPレジス
タ、35…インストラクションページメモリ、36…デ
コーダ、45、46…バンク、47,147…内部メモ
リ、50…外部メインメモリ、150…メインメモリ、
151…バンク選択モジュール、152,153…ロー
カルバス、161〜164…バンク、170〜173…
DPCレジスタ、174〜177…比較器、179…選
択回路、180…制御回路
DESCRIPTION OF SYMBOLS 1 ... Microprocessor, 11, 123 ... General-purpose register module, 12, 16, 125, 127 ... Multiplexer, 13 ... ALU, 21, 22, 23, 24, 25,
26, 27 bus, 30, 31, 149 DP register, 35 instruction page memory, 36 decoder, 45, 46 bank, 47, 147 internal memory, 50 external main memory, 150 main memory,
151: Bank selection module, 152, 153: Local bus, 161-164: Bank, 170-173 ...
DPC register, 174 to 177 comparator, 179 selection circuit, 180 control circuit

Claims (11)

【特許請求の範囲】[Claims] 【請求項1】メモリアドレス空間上の連続したアドレス
に記憶された所定のデータ量のページをそれぞれ記憶す
る複数のバンクを備えた内部メモリと、 前記メモリアドレス空間上のアドレスを記憶するデータ
ポインタレジスタと、 演算処理を行う演算手段と、 前記内部メモリおよび前記演算手段との間でデータの転
送を行うデータレジスタと、 前記複数のバンクに記憶されたページの前記メモリアド
レス空間内の先頭アドレスを記憶し、当該記憶された先
頭アドレスと、前記データポインタレジスタに記憶され
たアドレスとを比較し、前記比較の結果に基づいて前記
複数のバンクのいずれかにアクセス対象となるページが
存在するか否かを判別するページ有無判別手段と、 前記判別の結果、アクセス対象となるページが前記複数
のバンクのいずれかに存在する場合に、アクセス対象と
なるページが記憶されたバンクと前記データレジスタと
の間で、前記データポインタレジスタに記憶されたアド
レスを用いてデータの転送を行うように制御する制御手
段とを有する演算処理装置。
1. An internal memory having a plurality of banks for storing pages of a predetermined data amount stored at consecutive addresses in a memory address space, and a data pointer register for storing addresses in the memory address space. Arithmetic means for performing arithmetic processing; a data register for transferring data between the internal memory and the arithmetic means; and storing a head address in a memory address space of a page stored in the plurality of banks. Comparing the stored start address with the address stored in the data pointer register, and determining whether there is a page to be accessed in any of the plurality of banks based on a result of the comparison. Page presence / absence determination means for determining whether the plurality of banks are to be accessed as a result of the determination. Control means for controlling transfer of data between a bank in which a page to be accessed is stored and the data register by using an address stored in the data pointer register, if any An arithmetic processing unit having:
【請求項2】前記メモリアドレス空間を持つメインメモ
リをさらに有し、 前記制御手段は、前記判別の結果、アクセス対象となる
ページが前記複数のバンクのいずれにも存在しない場合
に、前記メインメモリからアクセス対象となるページを
読み出し、前記複数のバンクに記憶されているページと
入れ替える請求項1に記載の演算処理装置。
2. The apparatus according to claim 2, further comprising a main memory having the memory address space, wherein the control unit determines that the page to be accessed does not exist in any of the plurality of banks as a result of the determination. 2. The arithmetic processing device according to claim 1, wherein a page to be accessed is read from the plurality of pages and replaced with a page stored in the plurality of banks.
【請求項3】前記ページ有無判別手段は、 前記複数のバンクに記憶されたページの前記メモリアド
レス空間内の先頭アドレスをそれぞれ記憶する複数の先
頭アドレス記憶手段と、 前記複数の先頭アドレス記憶手段に記憶された先頭アド
レスと、前記データポインタレジスタに記憶されたアド
レスとを、それぞれ比較する複数の比較手段と、 前記複数の比較手段の比較結果に基づいて、前記複数の
バンクのいずれかにアクセス対象となるページが存在す
るか否かを判別する判別手段と有し、 前記制御手段は、前記判別手段の判別結果に基づいて、
前記先頭アドレスと前記データポインタレジスタに記憶
されたアドレスとが比較の結果一致した比較手段に対応
するバンクと、前記データレジスタとの間で、前記デー
タポインタレジスタに記憶されたアドレスを用いてデー
タの転送を行うように制御する請求項1に記載の演算処
理装置。
A plurality of first address storage means for storing first addresses of the pages stored in the plurality of banks in the memory address space; and a plurality of the first address storage means. A plurality of comparing means for respectively comparing the stored head address and the address stored in the data pointer register; and accessing any one of the plurality of banks based on a comparison result of the plurality of comparing means. And determining means for determining whether or not a page to be present exists, wherein the control means, based on a determination result of the determining means,
Using the address stored in the data pointer register between the bank corresponding to the comparing means in which the start address and the address stored in the data pointer register match as a result of the comparison, using the address stored in the data pointer register. The arithmetic processing device according to claim 1, wherein control is performed so as to perform transfer.
【請求項4】前記ページ有無判別手段は、 前記データポインタレジスタに記憶されたアドレスが更
新される度に、前記複数のバンクのいずれかにアクセス
対象となるページが存在するか否かを判別する請求項1
に記載の演算処理装置。
4. The page presence / absence determination means determines whether or not a page to be accessed exists in any of the plurality of banks each time an address stored in the data pointer register is updated. Claim 1
An arithmetic processing unit according to item 1.
【請求項5】前記データポインタレジスタに記憶される
前記メモリアドレス空間上のアドレスは、前記メモリア
ドレス空間内でのページのオフセットアドレスと、当該
ページ内でのデータのオフセットアドレスとを有し、 前記ページ有無判別手段は、 前記複数のバンクに記憶されたページの前記メモリアド
レス空間内でのページのオフセットアドレスを記憶し、 前記記憶されたページのオフセットアドレスと、前記デ
ータポインタレジスタに記憶されたアドレスに含まれる
ページのオフセットアドレスとを比較する請求項1に記
載の演算処理装置。
5. An address in the memory address space stored in the data pointer register includes an offset address of a page in the memory address space and an offset address of data in the page. The page presence / absence determining means stores an offset address of the page in the memory address space of the page stored in the plurality of banks, and an offset address of the stored page and an address stored in the data pointer register. 2. The arithmetic processing device according to claim 1, wherein the arithmetic processing device compares the offset address of the page included in the data.
【請求項6】前記ページ有無判別手段は、 前記データポインタレジスタに記憶されたアドレスに含
まれる前記ページのオフセットアドレスが更新されたと
きにのみ、前記比較を行う請求項5に記載の演算処理装
置。
6. The arithmetic processing device according to claim 5, wherein said page presence / absence determination means performs said comparison only when an offset address of said page included in an address stored in said data pointer register is updated. .
【請求項7】前記内部メモリの複数のバンクには、前記
メモリアドレス空間上に記憶されたデータが重複しない
ように記憶されている請求項1に記載の演算処理装置。
7. The arithmetic processing device according to claim 1, wherein data stored in said memory address space is stored in a plurality of banks of said internal memory so as not to be duplicated.
【請求項8】前記複数のバンクにおける前記データポイ
ンタレジスタに記憶されたアドレスから読み出したデー
タを、前記データレジスタに転送して記憶し、当該デー
タレジスタに記憶したデータを前記演算手段に転送して
メモリリード動作を行う請求項1に記載の演算処理装
置。
8. The data read from the address stored in the data pointer register in the plurality of banks is transferred to the data register and stored, and the data stored in the data register is transferred to the arithmetic means. The arithmetic processing device according to claim 1, which performs a memory read operation.
【請求項9】前記データポインタレジスタに記憶された
前記複数のバンクにおけるアドレスに、前記データレジ
スタにデータを書き込んでメモリライト動作を行う請求
項1に記載の演算処理装置。
9. The arithmetic processing device according to claim 1, wherein data is written to said data register at an address in said plurality of banks stored in said data pointer register to perform a memory write operation.
【請求項10】複数の汎用レジスタの一部を、前記デー
タレジスタとして用いる請求項1に記載の演算処理装
置。
10. The arithmetic processing device according to claim 1, wherein a part of a plurality of general-purpose registers is used as said data register.
【請求項11】演算手段からデータレジスタを介して、
メモリアドレス空間上の連続したアドレスに記憶された
所定のデータ量のページをそれぞれ記憶する複数のバン
クを備えた内部メモリにアクセスするメモリアクセス方
法であって、 前記メモリアドレス空間上のアドレスをデータポインタ
レジスタに記憶し、 前記複数のバンクに記憶されたページの前記メモリアド
レス空間内の先頭アドレスを記憶し、 当該記憶された先頭アドレスと、前記データポインタレ
ジスタに記憶されたアドレスとを比較し、 前記比較の結果に基づいて、前記複数のバンクのいずれ
かにアクセス対象となるページが存在するか否かを判別
し、 前記判別の結果、アクセス対象となるページが前記複数
のバンクのいずれかに存在する場合に、アクセス対象と
なるページが記憶されたバンクとデータレジスタとの間
で、前記データポインタレジスタに記憶されたアドレス
を用いてデータの転送を行うメモリアクセス方法。
11. An arithmetic unit via a data register,
A memory access method for accessing an internal memory having a plurality of banks for storing pages of a predetermined data amount stored at consecutive addresses on a memory address space, comprising: Storing the first address in the memory address space of the page stored in the plurality of banks in the memory address space; comparing the stored first address with the address stored in the data pointer register; Based on the result of the comparison, it is determined whether a page to be accessed exists in any of the plurality of banks. As a result of the determination, the page to be accessed exists in any of the banks. Between the bank where the page to be accessed is stored and the data register, Memory access method for transferring data using the address stored in the data pointer register.
JP21962397A 1997-08-14 1997-08-14 Arithmetic processing unit and memory access method Pending JPH1165923A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP21962397A JPH1165923A (en) 1997-08-14 1997-08-14 Arithmetic processing unit and memory access method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP21962397A JPH1165923A (en) 1997-08-14 1997-08-14 Arithmetic processing unit and memory access method

Publications (1)

Publication Number Publication Date
JPH1165923A true JPH1165923A (en) 1999-03-09

Family

ID=16738438

Family Applications (1)

Application Number Title Priority Date Filing Date
JP21962397A Pending JPH1165923A (en) 1997-08-14 1997-08-14 Arithmetic processing unit and memory access method

Country Status (1)

Country Link
JP (1) JPH1165923A (en)

Similar Documents

Publication Publication Date Title
JP3864160B2 (en) RISC microprocessor architecture with multiple type register set
JP4829541B2 (en) Digital data processing apparatus with multi-level register file
EP0782071B1 (en) Data processor
JP3842474B2 (en) Data processing device
EP1550032B1 (en) Method and apparatus for thread-based memory access in a multithreaded processor
JPH11312122A (en) On-chip program memory system which is user constructable
US7308320B2 (en) Processor core for using external extended arithmetic unit efficiently and processor incorporating the same
US7228401B2 (en) Interfacing a processor to a coprocessor in which the processor selectively broadcasts to or selectively alters an execution mode of the coprocessor
JP4230504B2 (en) Data processor
JP2015201216A (en) Method and system to combine multiple register units within microprocessor
JPH0553803A (en) Processor
JP2004171573A (en) Coprocessor extension architecture built by using novel splint-instruction transaction model
JPH05143443A (en) Data processor
US6405303B1 (en) Massively parallel decoding and execution of variable-length instructions
JP3790626B2 (en) Method and apparatus for fetching and issuing dual word or multiple instructions
JP2006517322A (en) Method and apparatus for hazard detection and management in pipelined digital processors
US6725355B1 (en) Arithmetic processing architecture having a portion of general-purpose registers directly coupled to a plurality of memory banks
US6161171A (en) Apparatus for pipelining sequential instructions in synchronism with an operation clock
US20020188817A1 (en) Store buffer pipeline
US6119220A (en) Method of and apparatus for supplying multiple instruction strings whose addresses are discontinued by branch instructions
US6260136B1 (en) Substitute register for use in a high speed data processor
JPH1165923A (en) Arithmetic processing unit and memory access method
EP1050800A1 (en) A pipelined execution unit
US6704855B1 (en) Method and apparatus for reducing encoding needs and ports to shared resources in a processor
JPH1165841A (en) Arithmetic processor and its method