JPH07191911A - Address converter and microprocessor computation method - Google Patents

Address converter and microprocessor computation method

Info

Publication number
JPH07191911A
JPH07191911A JP5333436A JP33343693A JPH07191911A JP H07191911 A JPH07191911 A JP H07191911A JP 5333436 A JP5333436 A JP 5333436A JP 33343693 A JP33343693 A JP 33343693A JP H07191911 A JPH07191911 A JP H07191911A
Authority
JP
Japan
Prior art keywords
address
physical
virtual
displacement
bits
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
JP5333436A
Other languages
Japanese (ja)
Inventor
Masato Motomura
真人 本村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP5333436A priority Critical patent/JPH07191911A/en
Publication of JPH07191911A publication Critical patent/JPH07191911A/en
Pending legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)
  • Memory System (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

PURPOSE:To provide the address converter and the address computing method which quickly execute, the address computation consisting of address calculation and address conversion. required for memory access in a microprocessor. CONSTITUTION:In this address converter, not only a physical address corresponding to a virtual address stored in a certain virtual address storage field 115 but also physical addresses corresponding to virtual addresses obtained by adding and subtracting one to and from this virtual address are stored in a physival address storage field 125, and one of these physical addresses is selected and outputted in accordance with input of physical address select signals 1 and 2 (103-1 and 103-2). This address computing method in the microprocessor uses this address converter and performs address conversion of the lower address and that of the upper address in parallel.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は情報処理システムの中核
をなすマイクロプロセッサに関し、特にマイクロプロセ
ッサが記憶装置にデータを読み書きする際に必要とされ
るアドレス算出方法に係わる。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microprocessor which is the core of an information processing system, and more particularly to an address calculation method required when the microprocessor reads / writes data from / to a storage device.

【0002】[0002]

【従来の技術】従来のマイクロプロセッサにおいては、
記憶装置(以下メモリと呼ぶ)からデータをロードする
(読み出す)場合、およびメモリにデータをストアする
(書き込む)場合に、アドレス計算とアドレス変換が必
要となる。以下、メモリに読み書きすることをメモリに
アクセスすると呼び、メモリにアクセスする際に用いら
れる、ロード命令、ストア命令などをメモリアクセス命
令と呼ぶ。またアドレス計算とアドレス変換とを併せて
アドレス算出と呼ぶ。
2. Description of the Related Art In a conventional microprocessor,
Address calculation and address conversion are required when loading (reading) data from a storage device (hereinafter referred to as memory) and when storing (writing) data in the memory. Hereinafter, reading and writing to the memory is referred to as accessing the memory, and load instructions, store instructions, and the like used when accessing the memory are referred to as memory access instructions. The address calculation and the address conversion are collectively called address calculation.

【0003】アドレス計算とは、メモリアクセス命令中
に与えられた情報からメモリの仮想アドレスを求めるた
めの計算である。図9は、ロード命令を例にとって、ア
ドレス計算方法を示した説明図である。図9のロード命
令では、ベースアドレスを含むレジスタとしてR5、す
なわちレジスタ5を指定している。また、ベースアドレ
スからのディスプレースメントを示す値として、100
を指定している。ロードを行なうメモリの仮想アドレス
は、レジスタ5の記憶内容と100の加算結果として求
められる。レジスタ4はロードされたデータを格納する
レジスタとして指定される。ここで64ビットアドレス
アーキテクチャを例にとると、ベースアドレスのビット
数は64ビットであり、ディスプレースメントのビット
数は16ビットとするのが普通である。ここで、ディス
プレースメントのビット数は、命令のビット数が多くの
場合32ビットであるため、この命令長の中に入るビッ
ト数という制約から決められている。
The address calculation is a calculation for obtaining the virtual address of the memory from the information given in the memory access instruction. FIG. 9 is an explanatory diagram showing an address calculation method using a load instruction as an example. In the load instruction of FIG. 9, R5, that is, register 5 is designated as the register containing the base address. Also, as a value indicating the displacement from the base address, 100
Is specified. The virtual address of the memory to be loaded is obtained as the storage result of the register 5 and the addition result of 100. Register 4 is designated as a register for storing the loaded data. Taking the 64-bit address architecture as an example, it is usual that the base address has 64 bits and the displacement bit has 16 bits. Here, the number of bits of the displacement is 32 bits in many cases, so that the number of bits of the displacement is determined by the constraint of the number of bits included in the instruction length.

【0004】このようにして求められた仮想アドレス
は、アドレス変換により物理アドレスに変換される。ア
ドレス変換はアドレス変換装置により行なわれる。アド
レス変換装置は、TLB(Translation Look aside Buf
fer )や、アドレス変換バッファなどと呼ばれることが
多い。従来技術のアドレス変換装置は、仮想アドレスの
上位部分のアドレス(以下簡単に上位アドレスと呼ぶ)
とこれに対応する物理アドレスの上位アドレスを対にし
て記憶しておく。仮想アドレスの上位アドレスの入力に
対して物理アドレスの上位アドレスを出力する。仮想ア
ドレスの下位部分のアドレス(以下簡単に下位アドレス
と呼ぶ)はそのまま物理アドレスの下位アドレスとして
使用される。ここで、64ビットアドレスアーキテクチ
ャの場合、仮想アドレスのビット数は64ビットであ
り、その内下位アドレスのビット数は、12ビットから
16ビット程度にとられることが多い。従って、仮想ア
ドレスの上位アドレスのビット数は52ビットから48
ビット程度にとられることが多い。また物理アドレスの
ビット数は、48ビット程度にとられることが多い。物
理アドレスの下位アドレスのビット数は、上の説明から
分かるように、仮想アドレスの下位アドレスのビット数
と同じである。物理アドレスの下位アドレスのビット数
は、アドレス変換の際の単位となるページの大きさを示
すので、ページの大きさは4Kバイトから64Kバイト
となる。
The virtual address thus obtained is converted into a physical address by address conversion. The address conversion is performed by the address conversion device. The address translation device is a TLB (Translation Look aside Buf).
fer), and often called the address translation buffer. The address translation device of the prior art uses an address of an upper part of a virtual address (hereinafter simply referred to as upper address).
And the upper address of the physical address corresponding to this are stored as a pair. The upper address of the physical address is output for the input of the upper address of the virtual address. The address of the lower part of the virtual address (hereinafter simply referred to as the lower address) is used as it is as the lower address of the physical address. Here, in the case of the 64-bit address architecture, the number of bits of the virtual address is 64 bits, and the number of bits of the lower address is often 12 to 16 bits. Therefore, the bit number of the upper address of the virtual address is 52 bits to 48 bits.
Often taken in bits. Further, the number of bits of the physical address is often set to about 48 bits. As can be seen from the above description, the number of bits of the lower address of the physical address is the same as the number of bits of the lower address of the virtual address. Since the number of bits of the lower address of the physical address indicates the size of the page which is a unit for address conversion, the size of the page is 4 Kbytes to 64 Kbytes.

【0005】図10は、上記のアドレス計算とアドレス
変換からなるアドレス算出方法に関して、従来のマイク
ロプロセッサでの処理手順を説明するために従来のマイ
クロプロセッサのパイプライン構成の一部を示したブロ
ック図である。図10に示したように、まずアドレス計
算が加算器1010で行なわれ、仮想アドレスが求めら
れる。このアドレス計算は1段のパイプラインステージ
を用いて行なわれる。このパイプラインステージは、一
般に実行ステージと呼ばれるものであり、例えば加算命
令、減算命令などのいわゆるALU(Arithmetic Logic
Unit )命令が処理されるパイプラインステージであ
る。加算器1010自体もALUがそのまま用いられる
ことが多い。次のパイプラインステージで、アドレス変
換装置1030によりアドレス変換が行なわれる。この
パイプラインステージは一般にメモリステージと呼ばれ
る。アドレス変換は仮想アドレスの上位アドレスに対し
て行なわれ、物理アドレスの上位アドレスが得られる。
これと並列に、仮想アドレスと物理アドレスの下位アド
レスが同一であることを利用して、下位アドレスにより
キャッシュメモリ1020へのアクセスが行なわれる。
ここでキャッシュメモリ1020とはメモリの一部をコ
ピーして記憶している小規模かつ高速なメモリである。
キャッシュメモリ1020にはデータと合わせて物理ア
ドレスの上位アドレスも記憶されており、この物理アド
レスの上位アドレスが読み出されて、変換結果の物理ア
ドレスの上位アドレスと一致しているかどうかが比較さ
れる。一致していれば、キャッシュメモリがヒットした
と判断され、データの読みとりもしくは書き込みが実行
される。
FIG. 10 is a block diagram showing a part of the pipeline structure of a conventional microprocessor for explaining the processing procedure in the conventional microprocessor regarding the address calculation method consisting of the above address calculation and address conversion. Is. As shown in FIG. 10, the address calculation is first performed by the adder 1010 to obtain the virtual address. This address calculation is performed using one pipeline stage. This pipeline stage is generally called an execution stage, and is a so-called ALU (Arithmetic Logic) such as an addition instruction and a subtraction instruction.
Unit) is a pipeline stage where instructions are processed. The ALU is often used as it is for the adder 1010 itself. In the next pipeline stage, address translation is performed by address translation device 1030. This pipeline stage is generally called a memory stage. The address conversion is performed on the upper address of the virtual address to obtain the upper address of the physical address.
In parallel with this, the fact that the lower addresses of the virtual address and the physical address are the same is used to access the cache memory 1020 by the lower address.
Here, the cache memory 1020 is a small-sized and high-speed memory in which a part of the memory is copied and stored.
The cache memory 1020 stores the upper address of the physical address together with the data, and the upper address of this physical address is read out and compared with whether or not it matches the upper address of the physical address of the conversion result. . If they match, it is determined that the cache memory has been hit, and data reading or writing is executed.

【0006】[0006]

【発明が解決しようとする課題】このように、従来のマ
イクロプロセッサでは、メモリアクセス命令の実行にあ
たって、アドレス加算とアドレス変換を行なう必要があ
る。アドレス変換の入力となる仮想アドレスはアドレス
加算の結果として求められるので、アドレス加算とアド
レス変換は逐次的に実行される必要がある。このため、
メモリアクセス命令の実行に時間がかかるという問題が
あった。
As described above, in the conventional microprocessor, it is necessary to perform address addition and address conversion when executing the memory access instruction. Since the virtual address that is the input of the address conversion is obtained as the result of the address addition, the address addition and the address conversion need to be executed sequentially. For this reason,
There is a problem that it takes time to execute the memory access instruction.

【0007】特に、図10で説明したような典型的なマ
イクロプロセッサのパイプライン構成においては、アド
レス加算とアドレス変換とが別々のパイプラインステー
ジで処理される。このため、従来のマイクロプロセッサ
においてはメモリアクセス命令を処理するために、パイ
プラインステージ1段で処理されるALU命令よりも一
段多いパイプラインステージを必要とし、性能向上を防
げる一因となっていた。特にロード命令の場合は、読み
だしたデータをすぐ後で使用する場合が多く、この場合
にプロセッサのパイプラインが止まってしまうという問
題がある。本発明の目的はこのような問題点を解決し、
メモリアクセス命令をより高速に処理することを可能と
する、アドレス変換装置とマイクロプロセッサのアドレ
ス算出方法を提供することにある。
In particular, in the typical microprocessor pipeline structure as described with reference to FIG. 10, address addition and address conversion are processed in separate pipeline stages. Therefore, in the conventional microprocessor, in order to process the memory access instruction, one more pipeline stage than the ALU instruction processed in one pipeline stage is required, which is one of the causes for preventing the performance improvement. . In particular, in the case of a load instruction, the read data is often used immediately after, and in this case, there is a problem that the pipeline of the processor stops. The object of the present invention is to solve these problems,
It is an object of the present invention to provide an address conversion device and an address calculation method for a microprocessor, which enables a memory access instruction to be processed at a higher speed.

【0008】[0008]

【課題を解決するための手段】仮想アドレスの入力に対
して、アドレス変換結果として前記仮想アドレスに対応
する物理アドレスを出力するアドレス変換装置であっ
て、任意の前記仮想アドレスVAに対して、前記仮想ア
ドレスVAに対応する前記物理アドレスPA(VA)
と、前記仮想アドレスVAに1を加算した前記仮想アド
レスに対応する前記物理アドレスPA(VA+1)と、
前記仮想アドレスから1を減算した前記仮想アドレスに
対応する前記物理アドレスPA(VA−1)とを併せて
格納し、アドレス変換時においては、外部より入力され
た入力仮想アドレスVA’と物理アドレス選択信号1及
び物理アドレス選択信号2に対して、前記入力仮想アド
レスVA’に対応する3つの前記物理アドレスPA(V
A’)、PA(VA’+1)、PA(VA’−1)を選
択し、前記物理アドレス選択信号1及び前記物理アドレ
ス選択信号2に応じて、選択された前記物理アドレスP
A(VA’)、PA(VA’+1)、PA(VA’−
1)の中から更に一つの前記物理アドレスを選択し、前
記アドレス変換結果として出力することを特徴としてい
る。
An address translation device for outputting a physical address corresponding to the virtual address as a result of address translation in response to an input of a virtual address, wherein: The physical address PA (VA) corresponding to the virtual address VA
And the physical address PA (VA + 1) corresponding to the virtual address obtained by adding 1 to the virtual address VA,
The physical address PA (VA-1) corresponding to the virtual address obtained by subtracting 1 from the virtual address is also stored together, and at the time of address translation, an input virtual address VA 'input from the outside and a physical address selection For the signal 1 and the physical address selection signal 2, the three physical addresses PA (V
A '), PA (VA' + 1), PA (VA'-1) are selected, and the physical address P selected according to the physical address selection signal 1 and the physical address selection signal 2 is selected.
A (VA '), PA (VA' + 1), PA (VA'-
One of the physical addresses is selected from among 1) and is output as the address conversion result.

【0009】本発明によるマイクロプロセッサのアドレ
ス算出方法は、記憶装置の任意の物理アドレスからデー
タを読み出すか、もしくは前記記憶装置の任意の前記物
理アドレスにデータを書き込むかにあたって、ベースア
ドレスを含むレジスタと前記ベースアドレスからのディ
スプレースメントとを指定し、前記ベースアドレスと前
記ディスプレースメントとを加算して仮想アドレスを求
めるアドレス加算と、前記仮想アドレスの上位アドレス
をアドレス変換装置に入力して前記物理アドレスの上位
アドレスに変換し、前記仮想アドレスの下位アドレスを
そのまま物理アドレスの下位アドレスとして使用するこ
とにより、前記記憶装置の前記物理アドレスを求めるア
ドレス変換とから構成されることを特徴とするマイクロ
プロセッサのアドレス算出方法において、前記アドレス
変換装置を用いることと、前記仮想アドレスの前記下位
アドレスのビット数を前記ディスプレースメントのビッ
ト数より一つ少ないかもしくはそれ以上の数とすること
と、前記ディスプレースメントのビット数が前記仮想ア
ドレスの前記下位アドレスのビット数より少ない場合は
前記ディスプレースメントの符合拡張を行ない、前記ベ
ースアドレスと前記ディスプレースメントの下位アドレ
スを前記仮想アドレスの前記下位アドレスと同じ位置と
ビット数を持つアドレスとしてそれぞれ定義し、前記ベ
ースアドレスの上位アドレスを前記仮想アドレスの前記
上位アドレスと同じ位置とビット数を持つアドレスとし
て定義し、前記アドレス加算においては、前記ベースア
ドレスの前記下位アドレスと前記ディスプレースメント
の前記下位アドレスとの加算を行なって前記仮想アドレ
スの前記下位アドレスと桁上げ信号とを生成すること
と、前記アドレス変換においては、前記ベースアドレス
の前記上位アドレスを前記入力仮想アドレスとして前記
アドレス変換装置に力し、前記ディスプレースメントの
符合ビットを前記物理アドレス選択信号1とし、前記桁
上げ信号を前記物理アドレス選択信号2として前記アド
レス変換装置に入力し、これらの入力に応じて、前記ア
ドレス変換装置が、前記ベースアドレスと前記ディスプ
レースメントの加算により求められる前記仮想アドレス
の前記上位アドレスに対応する前記物理アドレスの上位
アドレスを出力することとを特徴とする前記マイクロプ
ロセッサのアドレス算出方法を用いることを特徴とす
る。
A microprocessor address calculation method according to the present invention comprises a register including a base address for reading data from an arbitrary physical address of a storage device or writing data to the arbitrary physical address of the storage device. A displacement from the base address is designated, an address addition for adding the base address and the displacement to obtain a virtual address, and an upper address of the virtual address is input to an address translation device to input the physical address An add-on of a microprocessor, which comprises an address conversion for obtaining the physical address of the storage device by converting it to an upper address and using the lower address of the virtual address as it is as a lower address of the physical address. In the calculation method, the address translation device is used, the number of bits of the lower address of the virtual address is one less than or more than the number of bits of the displacement, and the displacement When the number of bits is smaller than the number of bits of the lower address of the virtual address, the sign extension of the displacement is performed, and the lower address of the base address and the displacement is at the same position and the same number of bits as the lower address of the virtual address. Respectively, the upper address of the base address is defined as an address having the same position and the same number of bits as the upper address of the virtual address, and in the address addition, the lower address of the base address and the lower address of the base address. De Generating the lower address and the carry signal of the virtual address by performing addition with the lower address of the displacement; and, in the address translation, using the upper address of the base address as the input virtual address. The address translation device is supplied with the sign bit of the displacement as the physical address selection signal 1 and the carry signal as the physical address selection signal 2 and is input to the address translation device. An address translation device outputs an upper address of the physical address corresponding to the upper address of the virtual address obtained by adding the base address and the displacement. It is characterized by using.

【0010】また、本発明では、前記アドレス加算と前
記アドレス変換とを並列に行なう。また、マイクロプロ
セッサにおける命令パイプラインの一つのパイプライン
ステージの中で、前記アドレス加算と前記アドレス変換
とを並列に行なう。もしくは、前記マイクロプロセッサ
における命令パイプラインの一つのパイプラインステー
ジの中で、前記アドレス加算と前記アドレス変換とを並
列に行ない、更に、前記パイプラインステージの中でキ
ャッシュメモリへのアクセスをも行なうか、もしくは、
前記マイクロプロセッサにおける命令パイプラインの一
つのパイプラインステージの中で、前記アドレス加算と
前記アドレス変換とを並列に行ない、更に前記パイプラ
インステージの中でキャッシュメモリへのアクセスのた
めのデコードをも行なうことを特徴としている。
Further, in the present invention, the address addition and the address conversion are performed in parallel. Further, the address addition and the address conversion are performed in parallel in one pipeline stage of the instruction pipeline in the microprocessor. Alternatively, whether the address addition and the address conversion are performed in parallel in one pipeline stage of the instruction pipeline in the microprocessor, and the cache memory is also accessed in the pipeline stage. Or
The address addition and the address conversion are performed in parallel in one pipeline stage of the instruction pipeline in the microprocessor, and the decoding for access to the cache memory is also performed in the pipeline stage. It is characterized by that.

【0011】[0011]

【作用】図8は本発明の作用を説明するための説明図で
ある。ディスプレースメントのビット数をnビット、ベ
ースアドレスの大きさをmビットとする。ディスプレー
スメントが正の場合を図8aに、負の場合を図8bにそ
れぞれ示した。図8aに示したように、ディスプレース
メントが正の場合は、実際の加算動作においては、ディ
スプレースメントはnビット目からmビット目までを全
て0に符合拡張されてベースアドレスと加算される。ま
た、図8bに示したように、ディスプレースメントが負
の場合は、実際の加算動作においては、ディスプレース
メントはnビット目からmビット目までを全て1に符合
拡張されてベースアドレスと加算される。
FIG. 8 is an explanatory view for explaining the operation of the present invention. The number of displacement bits is n bits, and the size of the base address is m bits. The positive displacement is shown in FIG. 8a, and the negative displacement is shown in FIG. 8b. As shown in FIG. 8A, when the displacement is positive, in the actual addition operation, the displacement is sign-extended to 0 from the nth bit to the mth bit and added to the base address. Further, as shown in FIG. 8B, when the displacement is negative, in the actual addition operation, the displacement is sign-extended to all 1s from the nth bit to the mth bit and added to the base address. .

【0012】ここで、仮想アドレスの上位アドレスをk
ビット目からmビット目まで、下位アドレスを1ビット
目から(k−1)ビット目までとする。但し、kはnと
等しいかもしくは大きい整数である。また、これに伴
い、ベースアドレスの上位アドレスを仮想アドレスの上
位アドレスと同じ位置と同じビット数を持つアドレス、
すなわちkビット目からnビット目までとする。また、
ベースアドレスとディスプレースメントの下位アドレス
をそれぞれ仮想アドレスの下位アドレスと同じ位置と同
じビットを持つアドレス、すなわち1ビット目から(k
−1)ビット目までとする。このように上位アドレスと
下位アドレスの大きさを定めることにより、以下に示す
ように上位アドレスのアドレス加算が簡単化される。
Here, the upper address of the virtual address is k
From the 1st bit to the mth bit, the lower address is from the 1st bit to the (k-1) th bit. However, k is an integer equal to or larger than n. Along with this, the upper address of the base address is the same as the upper address of the virtual address, and the address has the same number of bits.
That is, from the kth bit to the nth bit. Also,
The base address and the lower address of the displacement have the same position and the same bit as the lower address of the virtual address, that is, from the first bit to (k
-1) Up to the 1st bit. By determining the size of the upper address and the lower address in this way, the address addition of the upper address is simplified as shown below.

【0013】アドレス加算の結果求められる仮想アドレ
スの上位アドレスについて図8a、図8bの二つの場合
をそれぞれ説明する。図8aでは、仮想アドレスの上位
アドレスは仮想アドレスのベースアドレスの上位アドレ
スと、ディスプレースメントの符合拡張部もしくは符合
ビットと、下位アドレスの加算結果により生じる桁上げ
ビットとの加算により生成される。符合拡張部もしくは
符合ビットは全て0であるので、仮想アドレスの上位ア
ドレスは、ベースアドレスの上位アドレスと同じか、も
しくはベースアドレスの上位アドレスに1を加えたもの
になる。同様に、図8bでは、仮想アドレスの上位アド
レスは仮想アドレスのベースアドレスの上位アドレス
と、符合拡張部もしくは符合ビットと、下位アドレスの
加算結果により生じる桁上げビットとの加算により生成
される。符合拡張部もしくは符合ビットは全て1であ
り、この加算は1の減算に対応するので、仮想アドレス
の上位アドレスは、ベースアドレスの上位アドレスと同
じか、もしくはベースアドレスの上位アドレスから1を
引いたものになる。
The upper addresses of the virtual address obtained as a result of the address addition will be described in the two cases of FIGS. 8a and 8b. In FIG. 8a, the higher address of the virtual address is generated by adding the higher address of the base address of the virtual address, the sign extension or sign bit of the displacement, and the carry bit resulting from the addition of the lower addresses. Since the sign extension part or the sign bit is all 0, the upper address of the virtual address is the same as the upper address of the base address, or 1 plus the upper address of the base address. Similarly, in FIG. 8b, the higher address of the virtual address is generated by adding the higher address of the base address of the virtual address, the sign extension or sign bit, and the carry bit resulting from the addition of the lower address. Since the sign extension part or sign bit is all 1, and this addition corresponds to the subtraction of 1, the upper address of the virtual address is the same as the upper address of the base address, or 1 is subtracted from the upper address of the base address. It becomes a thing.

【0014】このように、仮想アドレスの下位アドレス
のビット数をディスプレースメントのビット数より一つ
少ない数が、それ以上の数とすることにより、上位アド
レス同士の加算を、ベースアドレスの上位アドレス+0
か、ベースアドレスの上位アドレス+1か、もしくはベ
ースアドレスの上位アドレス−1かの3種類に大幅に簡
単にすることが出来る。本発明は、このような作用を利
用したものである。
As described above, by setting the number of bits of the lower address of the virtual address to be one less than the number of bits of the displacement, the number of bits higher than that of the displacement allows the addition of the higher addresses to be the upper address of the base address + 0.
Alternatively, it is possible to greatly simplify the three types, that is, the upper address of the base address + 1 or the upper address of the base address -1. The present invention utilizes such an action.

【0015】[0015]

【実施例】図1本発明によるアドレス変換装置の1実施
例を示したブロック図である。図1において本発明のア
ドレス変換装置は、仮想アドレス入力端子101と、仮
想アドレス入力端子101から入力された仮想アドレス
を格納する仮想アドレス格納ブロック110と、物理ア
ドレス入力端子102と、物理アドレス入力端子102
から入力された物理アドレスを格納する物理アドレス格
納ブロック120と、物理アドレス格納ブロック120
から出力された物理アドレスを一時的に保持する物理ア
ドレスバッファ130と、物理アドレスバッファ130
内の物理アドレスの内の一つを選択するセレクタ140
と、セレクタ140を制御する物理アドレス選択信号1
および物理アドレス選択信号2を入力する物理アドレス
選択信号1入力端子103−1物理アドレス選択信号2
入力端子103−2と、セレクタ140に接続され、選
択された物理アドレスを変換物理アドレスとして出力す
る変換物理アドレス出力端子104とから構成される。
仮想アドレス格納ブロック110は、更に、複数の仮想
アドレス格納フィールド115から構成される。図1で
は、例として、仮想アドレス格納フィールド115が5
つある場合を例として示しているが、一般にはより多く
の数の仮想アドレス格納フィールド115から構成され
る。一つの仮想アドレス格納フィールド115が一つの
仮想アドレスを記憶する。同様に、物理アドレス格納ブ
ロック120は、複数の物理アドレス格納フィールド1
25から構成される。物理アドレス格納フィールド12
5は、一つの仮想アドレス格納フィールド115に対応
して一つずつ設けられ、それぞれが3つの物理アドレス
を格納する。図1に示したように、仮想アドレス格納フ
ィールド115−2に仮想アドレスVA1が格納されて
いたとすると、これに対応する物理アドレス格納フィー
ルド125−2は、VA1から1を減算した仮想アドレ
スに対応する物理アドレス、VA1に対応する物理アド
レス、VA1に1を加算した仮想アドレスに対応する物
理アドレスをそれぞれ記憶しておく。これらの物理アド
レスを、それぞれ順に、PA(VA1−1)、PA(V
A1)、PA(VA1+1)と表記する。
1 is a block diagram showing an embodiment of an address translation device according to the present invention. 1, the address translation device of the present invention includes a virtual address input terminal 101, a virtual address storage block 110 for storing a virtual address input from the virtual address input terminal 101, a physical address input terminal 102, and a physical address input terminal. 102
Physical address storage block 120 for storing the physical address input from
Physical address buffer 130 that temporarily holds the physical address output from
Selector 140 for selecting one of the physical addresses in
And a physical address selection signal 1 for controlling the selector 140
And physical address selection signal 1 input terminal 103-1 physical address selection signal 2
It comprises an input terminal 103-2 and a translated physical address output terminal 104 which is connected to the selector 140 and outputs the selected physical address as a translated physical address.
The virtual address storage block 110 is further composed of a plurality of virtual address storage fields 115. In FIG. 1, as an example, the virtual address storage field 115 has 5
Although one case is shown as an example, it is generally composed of a larger number of virtual address storage fields 115. One virtual address storage field 115 stores one virtual address. Similarly, the physical address storage block 120 includes a plurality of physical address storage fields 1
25. Physical address storage field 12
5 are provided one by one corresponding to one virtual address storage field 115, and each stores three physical addresses. As shown in FIG. 1, if the virtual address storage field 115-2 stores the virtual address VA1, the corresponding physical address storage field 125-2 corresponds to the virtual address obtained by subtracting 1 from VA1. The physical address, the physical address corresponding to VA1, and the physical address corresponding to the virtual address obtained by adding 1 to VA1 are stored. These physical addresses are assigned to PA (VA1-1) and PA (V
A1) and PA (VA1 + 1).

【0016】このように構成において、本発明のアドレ
ス変換装置は以下のようにアドレス変換を行なう。ま
ず、変換したい仮想アドレスを入力仮想アドレスとして
仮想アドレス入力端子101から入力する。入力された
入力仮想アドレスは全ての仮想アドレス格納フィールド
115に格納された仮想アドレスと比較される。入力仮
想アドレスと一致した仮想アドレスを格納している仮想
アドレス格納フィールド115に対応する物理アドレス
格納フィールド125から3つの物理アドレスが物理ア
ドレスバッファ130に読み出される。物理アドレス選
択信号1及び2(103−1,−2)に応じて、物理ア
ドレスバッファ130に一時的に保持された3つの物理
アドレスの内の一つがセレクタ140で選択され、変換
物理アドレスとして物理アドレス出力端子104から出
力される。
With such a configuration, the address translation device of the present invention performs address translation as follows. First, the virtual address to be converted is input from the virtual address input terminal 101 as an input virtual address. The input virtual address input is compared with the virtual addresses stored in all virtual address storage fields 115. Three physical addresses are read from the physical address storage field 125 corresponding to the virtual address storage field 115 storing the virtual address that matches the input virtual address to the physical address buffer 130. In response to the physical address selection signals 1 and 2 (103-1, -2), one of the three physical addresses temporarily held in the physical address buffer 130 is selected by the selector 140, and the physical address is selected as the translated physical address. It is output from the address output terminal 104.

【0017】図2は、物理アドレス選択信号1及び物理
アドレス選択信号2による物理アドレスの選択方法を示
した説明図である。図2では、入力仮想アドレスとして
VA1が入力されたと仮定している。物理アドレス選択
信号1が0、物理アドレス選択信号2が0のときは変換
物理アドレスとして、物理アドレスPA(VA1)が出
力される。同様に、物理アドレス選択信号1が0、物理
アドレス選択信号2が1のときは物理アドレスPA(V
A1+1)、物理アドレス選択信号1が1、物理アドレ
ス選択信号2が0のときはPA(VA−1)、物理アド
レス選択信号1が1、物理アドレス選択信号2が1のと
きはPA(VA1)が出力される。
FIG. 2 is an explanatory diagram showing a physical address selection method using the physical address selection signal 1 and the physical address selection signal 2. In FIG. 2, it is assumed that VA1 is input as the input virtual address. When the physical address selection signal 1 is 0 and the physical address selection signal 2 is 0, the physical address PA (VA1) is output as the translated physical address. Similarly, when the physical address selection signal 1 is 0 and the physical address selection signal 2 is 1, the physical address PA (V
A1 + 1), when the physical address selection signal 1 is 1, the physical address selection signal 2 is 0, PA (VA-1), when the physical address selection signal 1 is 1, and the physical address selection signal 2 is 1, PA (VA1) Is output.

【0018】図3は、図1の実施例によるアドレス変換
装置を用いたマイクロプロセッサのアドレス算出方法の
第1の実施例を示した説明図である。図3においては、
例として、ベースアドレス320のビット数を64ビッ
ト、ディスプレースメント330のビット数を16ビッ
トとしている。また、例として、仮想アドレスの下位ア
ドレスを15ビットとし、上位アドレスを49ビットと
している。従ってベースアドレス320の下位アドレス
325−2およびディスプレースメントの下位アドレス
335−2のビット数は15ビット、ベースアドレス3
20の上位アドレス325−1のビット数は49ビット
となる。ベースアドレスの下位アドレス325−2のビ
ット数は、ディスプレースメント330のビット数より
一つ少ない数である。
FIG. 3 is an explanatory view showing a first embodiment of the address calculation method of the microprocessor using the address conversion device according to the embodiment of FIG. In FIG.
As an example, the number of bits of the base address 320 is 64 bits, and the number of bits of the displacement 330 is 16 bits. Further, as an example, the lower address of the virtual address is 15 bits, and the upper address is 49 bits. Therefore, the number of bits of the lower address 325-2 of the base address 320 and the lower address 335-2 of the displacement is 15 bits, and the base address 3
The number of bits of the 20 high-order addresses 325-1 is 49 bits. The number of bits of the lower address 325-2 of the base address is one less than the number of bits of the displacement 330.

【0019】このようなベースアドレス320とディス
プレースメント330を用いて、まず、ベースアドレス
320の上位アドレス325−1を、入力仮想アドレス
としてアドレス変換装置340に入力する。また、ベー
スアドレス320の下位アドレス325−2と、ディス
プレースメント330の下位アドレス335−2とを加
算器310で加算する。加算結果を、物理アドレスの下
位アドレスとして下位物理アドレス出力端子302から
出力する。加算器310の桁上げ信号出力315は、物
理アドレス選択信号2としてアドレス変換装置340に
入力される。ディスプレースメント330の下位アドレ
ス335−2はディスプレースメント330から符合ビ
ット335−1を除いたものになっている。ディスプレ
ースメント330の符合ビット335−1は、物理アド
レス選択信号1としてアドレス変換装置340に入力さ
れる。アドレス変換装置340から出力される変換物理
アドレス341は、物理アドレスの上位アドレスとして
上位物理アドレス出力端子301から出力される。これ
らの物理アドレス選択信号1及び2により、ディスプレ
ースメント330の正負と、及びベースアドレス320
とディスプレースメント330の下位アドレス同士の加
算により生じる桁上げ信号に応じた正しい物理アドレス
がアドレス変換装置340により選択され出力される。
Using the base address 320 and the displacement 330, the upper address 325-1 of the base address 320 is first input to the address translation device 340 as an input virtual address. Further, the lower address 325-2 of the base address 320 and the lower address 335-2 of the displacement 330 are added by the adder 310. The addition result is output from the lower physical address output terminal 302 as a lower address of the physical address. The carry signal output 315 of the adder 310 is input to the address conversion device 340 as the physical address selection signal 2. The lower address 335-2 of the displacement 330 is the displacement 330 minus the sign bit 335-1. The sign bit 335-1 of the displacement 330 is input to the address conversion device 340 as the physical address selection signal 1. The translated physical address 341 output from the address translation device 340 is output from the upper physical address output terminal 301 as an upper address of the physical address. By these physical address selection signals 1 and 2, the positive and negative of the displacement 330 and the base address 320
The correct physical address according to the carry signal generated by the addition of the lower addresses of the displacement 330 and the displacement 330 is selected and output by the address conversion device 340.

【0020】図4は、図1の実施例によるアドレス変換
装置を用いたマイクロプロセッサのアドレス算出方法の
第2の実施例を示した説明図である。図4においては、
例として、ベースアドレス420のビット数を64ビッ
ト、ディスプレースメント430のビット数を16ビッ
トとしている。また、例として、仮想アドレスの下位ア
ドレスのビット数を18ビットとし、上位アドレスのビ
ット数を46ビットとしている。従ってベースアドレス
420の下位アドレス425−2およびディスプレース
メントの下位アドレス435−2のビット数は18ビッ
ト、ベースアドレス420の上位アドレス425−1の
ビット数は46ビットとなる。ディスプレースメント4
30のビット数が仮想アドレスの下位アドレスのビット
数よりも少ないため、ディスプレースメント430は符
合ビット435−1の値に応じて符合拡張されている。
ディスプレースメント430の下位アドレス435−2
は符合拡張部440も含んでいる。
FIG. 4 is an explanatory diagram showing a second embodiment of the address calculation method of the microprocessor using the address conversion device according to the embodiment of FIG. In FIG.
As an example, the number of bits of the base address 420 is 64 bits, and the number of bits of the displacement 430 is 16 bits. As an example, the lower address of the virtual address has 18 bits, and the upper address has 46 bits. Therefore, the lower address 425-2 of the base address 420 and the lower address 435-2 of the displacement have 18 bits, and the upper address 425-1 of the base address 420 has 46 bits. Displacement 4
Since the number of bits of 30 is smaller than the number of bits of the lower address of the virtual address, the displacement 430 is sign-extended according to the value of the sign bit 435-1.
Lower address 435-2 of displacement 430
Also includes a sign extension 440.

【0021】このようなベースアドレス420とディス
プレースメント430を用いて、まず、ベースアドレス
420の上位アドレス425−1を、入力仮想アドレス
として仮想アドレス変換装置440に入力する。また、
ベースアドレス420の下位アドレス425−2と、デ
ィスプレースメント430の下位アドレス435−2と
を加算器410で加算する。加算結果を、物理アドレス
の下位アドレスとして下位物理アドレス出力端子402
から出力する。加算器410の桁上げ信号出力415
は、物理アドレス選択信号2としてアドレス変換装置4
40に入力される。ディスプレースメント430の符合
ビット435−1は、物理アドレス選択信号1としてア
ドレス変換装置440に入力される。アドレス変換装置
440から出力される変換物理アドレスが、物理アドレ
スの上位アドレスとして上位物理アドレス出力端子40
1から出力される。
Using the base address 420 and the displacement 430, the upper address 425-1 of the base address 420 is input to the virtual address translation device 440 as an input virtual address. Also,
The lower address 425-2 of the base address 420 and the lower address 435-2 of the displacement 430 are added by the adder 410. The addition result is used as the lower address of the physical address, and the lower physical address output terminal 402
Output from. Carry signal output 415 of adder 410
Is an address translation device 4 as a physical address selection signal 2.
40 is input. The sign bit 435-1 of the displacement 430 is input to the address translation device 440 as the physical address selection signal 1. The translated physical address output from the address translation device 440 is output to the upper physical address output terminal 40 as an upper address of the physical address.
It is output from 1.

【0022】図3、図4に示した本発明によるマイクロ
プロセッサのアドレス算出方法の実施例において、アド
レス加算は下位アドレスに対してのみ実行される。ま
た、アドレス変換は上位アドレスに対してのみ実行され
る。下位アドレスのアドレス加算により、桁上げ信号が
生じ物理アドレス選択信号2としてアドレス変換装置3
40もしくは440に入力される必要があるが、これ
は、アドレス変換装置340もしくは440において、
入力仮想アドレスに対応する3つの物理アドレスが選択
された後に、上記の3つの物理アドレスの中から一つの
物理アドレスを選択するために用いられる。アドレス変
換に要する時間の大部分は、仮想アドレスに対応する物
理アドレスを選択するために費やされるので、上記の桁
上げ信号はアドレス変換の大部分が終了した時点で入力
されれば十分である。よって、図3、図4に示した本発
明によるアドレス算出方法の第1、第2の実施例におい
ては、アドレス計算とアドレス変換を並列に実行するこ
とが可能である。
In the embodiment of the method of calculating the address of the microprocessor according to the present invention shown in FIGS. 3 and 4, the address addition is executed only for the lower address. Further, the address conversion is executed only for the upper address. A carry signal is generated by the address addition of the lower address, and the address conversion device 3 is used as the physical address selection signal 2.
40 or 440, which is required by the address translator 340 or 440.
It is used to select one physical address from the above three physical addresses after three physical addresses corresponding to the input virtual address are selected. Since most of the time required for address translation is spent for selecting the physical address corresponding to the virtual address, it is sufficient if the carry signal is input at the time when most of the address translation is completed. Therefore, in the first and second embodiments of the address calculating method according to the present invention shown in FIGS. 3 and 4, the address calculation and the address conversion can be executed in parallel.

【0023】図5は、本発明によるマイクロプロセッサ
のアドレス算出方法の第3の実施例を実現するマイクロ
プロセッサのパイプライン構成を説明するためのブロッ
ク図である。図5の実施例では、下位アドレスに対する
アドレス加算を実行する加算器510と上位アドレスに
対するアドレス変換を実行するアドレス変換器520
が、マイクロプロセッサの命令パイプラインの一つのパ
イプラインステージの中で並列に動作する点が特徴であ
る。以下、本実施例の動作を説明する。
FIG. 5 is a block diagram for explaining a pipeline structure of a microprocessor which realizes a third embodiment of the address calculating method of the microprocessor according to the present invention. In the embodiment of FIG. 5, an adder 510 that performs address addition for lower addresses and an address translator 520 that performs address translation for higher addresses.
However, the feature is that they operate in parallel in one pipeline stage of the instruction pipeline of the microprocessor. The operation of this embodiment will be described below.

【0024】図5において、ベースアドレス入力端子5
01からベースアドレス551が入力され、ディスプレ
ースメント入力端子502からディスプレースメント5
52が入力される。ベースアドレス551の下位アドレ
ス511とディスプレースメント552の下位アドレス
512が加算器510で加算され、下位物理アドレス5
54として下位物理アドレス出力端子504から出力さ
れる。またベースアドレス551の上位アドレス521
が入力仮想アドレスとして、ディスプレースメント55
2の符合ビット523−1が物理アドレス選択信号1と
して、加算器510の桁上げ信号523−2が物理アド
レス選択信号2として、それぞれアドレス変換器520
に入力される。アドレス変換器520の出力である変換
物理アドレスは上位物理アドレス553として上位物理
アドレス出力端子503から出力される。
In FIG. 5, base address input terminal 5
The base address 551 is input from 01, and the displacement 5 is input from the displacement input terminal 502.
52 is input. The lower address 511 of the base address 551 and the lower address 512 of the displacement 552 are added by the adder 510 to obtain the lower physical address 5
It is output from the lower physical address output terminal 504 as 54. The upper address 521 of the base address 551
As the input virtual address, the displacement 55
The sign bit 523-1 of 2 is used as the physical address selection signal 1, the carry signal 523-2 of the adder 510 is used as the physical address selection signal 2, and the address converter 520 is used.
Entered in. The translated physical address output from the address translator 520 is output from the upper physical address output terminal 503 as the upper physical address 553.

【0025】図6は、本発明によるマイクロプロセッサ
のアドレス算出方法の第4の実施例を実現するマイクロ
プロセッサのパイプライン構成を説明するためのブロッ
ク図である。図6の実施例では、下位アドレスに対する
アドレス加算を実行する加算器610と上位アドレスに
対するアドレス変換を実行するアドレス変換器620が
マイクロプロセッサの命令パイプラインの一つのパイプ
ラインステージの中で並列に動作し、更に、同一パイプ
ラインステージの中で、キャッシュメモリ630へのア
クセスをも行なうことが特徴である。以下本実施例の動
作について、ロード命令の場合を例にとって説明する。
FIG. 6 is a block diagram for explaining a pipeline configuration of a microprocessor which realizes a fourth embodiment of the address calculating method of the microprocessor according to the present invention. In the embodiment of FIG. 6, an adder 610 that performs address addition for lower addresses and an address translator 620 that performs address translation for higher addresses operate in parallel in one pipeline stage of the microprocessor's instruction pipeline. In addition, the feature is that the cache memory 630 is also accessed in the same pipeline stage. The operation of this embodiment will be described below by taking a load instruction as an example.

【0026】図6において、ベースアドレス入力端子6
01からベースアドレス661が入力され、ディスプレ
ースメント入力端子602からディスプレースメント6
62が入力される。ベースアドレス661の下位アドレ
ス611とディスプレースメント652の下位アドレス
612が加算器610で加算され、下位物理アドレス6
13として出力される。またベースアドレス661の上
位アドレス621が入力仮想アドレスとして、ディスプ
レースメント662の符合ビット623−1が物理アド
レス選択信号1として、加算器610の桁上げ信号62
3−2が物理アドレス選択信号2として、それぞれアド
レス変換器620に入力される。アドレス変換器620
の出力である変換物理アドレスは上位物理アドレス62
4として出力される。下位物理アドレス613は、キャ
ッシュメモリ630のデコーダ631に入力され、デー
タ部632とタグ部633からそれぞれ下位物理アドレ
ス613に対応するデータと上位アドレスとを読み出
す。読み出された上位物理アドレスは、変換物理アドレ
ス624と比較器635で比較され、一致していれば、
データ部632から読み出されたデータはセレクタ63
4を介して読み出しデータ665として読み出しデータ
出力端子605から出力される。
In FIG. 6, the base address input terminal 6
The base address 661 is inputted from 01, and the displacement 6 is inputted from the displacement input terminal 602.
62 is input. The lower address 611 of the base address 661 and the lower address 612 of the displacement 652 are added by the adder 610 to obtain the lower physical address 6
It is output as 13. The upper address 621 of the base address 661 is used as an input virtual address, the sign bit 623-1 of the displacement 662 is used as the physical address selection signal 1, and the carry signal 62 of the adder 610 is used.
3-2 is input to the address converter 620 as the physical address selection signal 2. Address converter 620
The converted physical address that is the output of
It is output as 4. The lower physical address 613 is input to the decoder 631 of the cache memory 630, and the data and the upper address corresponding to the lower physical address 613 are read from the data unit 632 and the tag unit 633, respectively. The read higher physical address is compared with the converted physical address 624 by the comparator 635, and if they match,
The data read from the data section 632 is the selector 63.
The read data 665 is output from the read data output terminal 605 as read data 665.

【0027】図6のアドレス算出方法の実施例において
は、加算器610によるアドレス計算とキャッシュメモ
リ630へのアクセスとは、アドレス変換器620にお
けるアドレス変換と並列に実行することが可能である。
In the embodiment of the address calculation method of FIG. 6, the address calculation by the adder 610 and the access to the cache memory 630 can be executed in parallel with the address conversion in the address converter 620.

【0028】図7は、本発明によるマイクロプロセッサ
のアドレス算出方法の第5の実施例を実現するマイクロ
プロセッサのパイプライン構成を説明するためのブロッ
ク図である。図7の実施例では、下位アドレスに対する
アドレス加算を実行する加算器710と上位アドレスに
対するアドレス変換を実行するアドレス変換器720が
マイクロプロセッサの命令パイプラインの一つのパイプ
ラインシテージの中で並列に動作し、更に、同一パイプ
ラインステージの中で、キャッシュメモリへアクセスす
るためのデコーダ731も動作することが特徴である。
以下本実施例の動作を説明する。
FIG. 7 is a block diagram for explaining a pipeline structure of a microprocessor for realizing a fifth embodiment of the microprocessor address calculating method according to the present invention. In the embodiment of FIG. 7, an adder 710 that performs address addition for lower addresses and an address translator 720 that performs address conversion for higher addresses are arranged in parallel in one pipeline stage of the instruction pipeline of the microprocessor. It is characterized in that it operates, and further, the decoder 731 for accessing the cache memory also operates in the same pipeline stage.
The operation of this embodiment will be described below.

【0029】図7において、ベースアドレス力端子70
1からベースアドレス771が入力され、ディスプレー
スメント入力端子702からディスプレースメント77
2が入力される。ベースアドレス771の下位アドレス
711とディスプレースメント752の下位アドレス7
12が加算器710で加算され、下位物理アドレス71
3として出力される。またベースアドレス771の上位
アドレス721が入力仮想アドレスとして、ディスプレ
ースメント772の符合ビット723−1が物理アドレ
ス選択信号1として、加算器710の桁上げ信号723
−2が物理アドレス選択信号2として、それぞれアドレ
ス変換器720に入力される。アドレス変換器720の
出力である変換物理アドレスは上位物理アドレス724
として上位物理アドレス出力端子703から出力され
る。下位物理アドレス713は、キャッシュメモリのデ
コーダ731に入力され、デコード信号706が出力さ
れる。
In FIG. 7, base address force terminal 70
1, the base address 771 is input, and the displacement input terminal 702 inputs the displacement 77.
2 is input. Lower address 711 of base address 771 and lower address 7 of displacement 752
12 is added by the adder 710 to obtain the lower physical address 71
It is output as 3. The upper address 721 of the base address 771 is used as an input virtual address, the sign bit 723-1 of the displacement 772 is used as the physical address selection signal 1, and the carry signal 723 of the adder 710 is used.
-2 is input to the address converter 720 as the physical address selection signal 2. The translated physical address output from the address translator 720 is the upper physical address 724.
Is output from the higher physical address output terminal 703. The lower physical address 713 is input to the decoder 731 of the cache memory, and the decode signal 706 is output.

【0030】[0030]

【発明の効果】従来技術のマイクロプロセッサにおける
アドレス算出方法では、仮想アドレスの全ビットに対し
てアドレス加算を行なう必要があった。本発明によるア
ドレス変換装置とこれを用いたアドレス算出方法によ
り、アドレス加算の必要あるビット数が、仮想アドレス
の下位アドレスとして指定したビット数に減少する。加
算の処理はビット数が大きくなればなるほど時間が多く
かかるので、これによりアドレス加算時間を短縮するこ
とが可能である。また、加算器のハードウェアも小型化
することが可能である。
According to the address calculation method in the microprocessor of the prior art, it is necessary to add the addresses to all the bits of the virtual address. By the address translation device and the address calculation method using the same according to the present invention, the number of bits required for address addition is reduced to the number of bits designated as the lower address of the virtual address. Since the addition process takes more time as the number of bits increases, it is possible to shorten the address addition time. Also, the hardware of the adder can be downsized.

【0031】更に、本発明のアドレス算出方法において
は上位アドレスに対するアドレス変換と下位アドレスに
対するアドレス加算を並列に処理することが可能であ
る。これにより、アドレス算出時間を短縮することが可
能である。
Further, in the address calculating method of the present invention, it is possible to process the address conversion for the upper address and the address addition for the lower address in parallel. This makes it possible to shorten the address calculation time.

【0032】更に、本発明のアドレス算出方法において
は、一つのパイプラインステージの中でアドレス変換と
アドレス加算を並列に行なうことにより、キャッシュメ
モリへアクセスする前のパイプラインステージでアドレ
ス変換を行なってしまう方法をとることが可能である。
従来技術のアドレス算出方法では、アドレス変換とキャ
ッシュメモリへのアクセスが並列に行なわれていたため
に、物理アドレスでアクセスするダイレクトマップキャ
ッシュメモリの場合、ページサイズ以上のキャッシュメ
モリを実現できないという問題があった。本発明のアド
レス算出方法に基づく上記のようなパイプライン構成方
法により、このような問題を解決することが出来る。
Further, in the address calculating method of the present invention, the address conversion and the address addition are performed in parallel in one pipeline stage so that the address conversion is performed in the pipeline stage before accessing the cache memory. It is possible to take the method of closing.
In the conventional address calculation method, since the address conversion and the access to the cache memory are performed in parallel, in the case of the direct map cache memory that accesses by the physical address, there is a problem that a cache memory larger than the page size cannot be realized. It was Such a problem can be solved by the above pipeline construction method based on the address calculation method of the present invention.

【0033】更に、本発明のアドレス算出方法において
は、一つのパイプラインステージの中でアドレス変換と
アドレス加算を並列に行なうことに加え、キャッシュメ
モリへのアドレスも同一パイプラインステージ内で行な
ってしまう方法をとることも可能である。これにより、
アドレス算出とキャッシュメモリへのアクセスを1つの
パイプラインステージにまとめることができる。従来技
術では、アドレス算出とキャッシュメモリへのアクセス
とは別々のパイプラインステージで実行されていた。こ
のため、ALU命令などと比べて、メモリアクセス命令
の実行に1サイクル以上余計に時間がかかるという問題
が生じていた。これは仮想アドレスの全ビットの加算を
行なうためアドレス加算にパイプラインステージ一段分
の時間がかかっていたためである。本発明のアドレス算
出方法に基づく上記のようなパイプライン構成方法によ
り、このような問題を解決することが出来る。
Further, in the address calculating method of the present invention, in addition to performing address conversion and address addition in parallel in one pipeline stage, the address to the cache memory is also performed in the same pipeline stage. It is also possible to take a method. This allows
Address calculation and cache memory access can be combined into one pipeline stage. In the conventional technique, the address calculation and the access to the cache memory are executed in different pipeline stages. Therefore, compared to the ALU instruction and the like, there is a problem that it takes an extra time to execute the memory access instruction for one cycle or more. This is because the addition of all the bits of the virtual address takes time for one stage of the pipeline stage to add the address. Such a problem can be solved by the above pipeline construction method based on the address calculation method of the present invention.

【0034】最後に、本発明のアドレス算出方法におい
ては、一つのパイプラインステージの中でアドレス変換
とアドレス加算を並列に行なうことに加え、キャッシュ
メモリへアクセスするためのデコードを同一のパイプラ
インステージ内で行なってしまう方法をとることも可能
である。従来技術ではキャッシュメモリへアクセスする
パイプラインステージでデコードまでも行なっていた。
そのためこのパイプラインステージの処理時間の半分に
近い時間がデコードに費やされていた。本発明のアドレ
ス算出方法に基づく上記のようなパイプライン構成方法
により、同一のキャッシュメモリサイズであれば、パイ
プラインステージの実行時間を短縮できき、同一のパイ
プラインステージ実行時間であれば、キャッシュメモリ
サイズを大きくできるという利点がある。
Finally, in the address calculation method of the present invention, in addition to performing address conversion and address addition in parallel in one pipeline stage, decoding for accessing the cache memory is performed in the same pipeline stage. It is also possible to do it in-house. In the prior art, even the decoding is performed in the pipeline stage for accessing the cache memory.
Therefore, a time close to half of the processing time of this pipeline stage was spent for decoding. By the above pipeline configuration method based on the address calculation method of the present invention, the execution time of the pipeline stage can be shortened if the cache memory size is the same, and if the pipeline stage execution time is the same, the cache is executed. There is an advantage that the memory size can be increased.

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

【図1】本発明によるアドレス変換装置の1実施例を示
すブロック図である。
FIG. 1 is a block diagram showing an embodiment of an address translation device according to the present invention.

【図2】図1のアドレス変換装置の実施例の動作を説明
する説明図である。
FIG. 2 is an explanatory diagram explaining an operation of an embodiment of the address translation device of FIG.

【図3】本発明によるマイクロプロセッサのアドレス算
出方法の第1の実施例を示す説明図である。
FIG. 3 is an explanatory diagram showing a first embodiment of a method of calculating an address of a microprocessor according to the present invention.

【図4】本発明によるマイクロプロセッサのアドレス算
出方法の第2の実施例を示す説明図である。
FIG. 4 is an explanatory diagram showing a second embodiment of the microprocessor address calculation method according to the present invention.

【図5】本発明によるマイクロプロセッサのアドレス算
出方法の第3の実施例を実現するマイクロプロセッサの
パイプライン構成を示すブロック図である。
FIG. 5 is a block diagram showing a pipeline configuration of a microprocessor that implements a third embodiment of the microprocessor address calculation method according to the present invention.

【図6】本発明によるマイクロプロセッサのアドレス算
出方法の第4の実施例を実現するマイクロプロセッサの
パイプライン構成を示すブロック図である。
FIG. 6 is a block diagram showing a pipeline configuration of a microprocessor for realizing a fourth embodiment of the microprocessor address calculating method according to the present invention.

【図7】本発明によるマイクロプロセッサのアドレス算
出方法の第5の実施例を実現するマイクロプロセッサの
パイプライン構成を示すブロック図である。
FIG. 7 is a block diagram showing a pipeline configuration of a microprocessor that implements a fifth embodiment of the microprocessor address calculation method according to the present invention.

【図8】本発明の作用を示す説明図である。FIG. 8 is an explanatory diagram showing the operation of the present invention.

【図9】従来技術におけるメモリアクセス命令のアドレ
ス計算方法の概要を示す説明図である。
FIG. 9 is an explanatory diagram showing an outline of a method of calculating an address of a memory access instruction according to a conventional technique.

【図10】従来技術におけるアドレス算出方法の処理手
順を説明するためのマイクロプロセッサのパイプライン
構成を示すブロック図である。
FIG. 10 is a block diagram showing a pipeline configuration of a microprocessor for explaining a processing procedure of an address calculation method in a conventional technique.

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

101 仮想アドレス入力端子 102 物理アドレス入力端子 103−1 物理アドレス選択信号1入力端子 103−2 物理アドレス選択信号2入力端子 104 変換物理アドレス出力端子 110 仮想アドレス格納ブロック 115 仮想アドレス格納フィールド 120 物理アドレス格納ブロック 125 物理アドレス格納フィールド 130 物理アドレスバッファ 140 セレクタ 101 virtual address input terminal 102 physical address input terminal 103-1 physical address selection signal 1 input terminal 103-2 physical address selection signal 2 input terminal 104 translation physical address output terminal 110 virtual address storage block 115 virtual address storage field 120 physical address storage Block 125 physical address storage field 130 physical address buffer 140 selector

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】 仮想アドレスの入力に対して、アドレス
変換結果として前記仮想アドレスに対応する物理アドレ
スを出力するアドレス変換装置において、 任意の前記仮想アドレスVAに対して、前記仮想アドレ
スVAに対応する前記物理アドレスPA(VA)と、前
記仮想アドレスVAに1を加算した前記仮想アドレスに
対応する前記物理アドレスPA(VA+1)と、前記仮
想アドレスから1を減算した前記仮想アドレスに対応す
る前記物理アドレスPA(VA−1)とを併せて格納
し、アドレス変換時においては、外部より入力された入
力仮想アドレスVA’と物理アドレス選択信号1及び物
理アドレス選択信号2に対して、前記入力仮想アドレス
VA’に対応する3つの前記物理アドレスPA(V
A’)、PA(VA’+1)、PA(VA’−1)を選
択し、前記物理アドレス選択信号1及び前記物理アドレ
ス選択信号2に応じて、選択された前記物理アドレスP
A(VA’)、PA(VA’+1)、PA(VA’−
1)の中から更に一つの前記物理アドレスを選択し、前
記アドレス変換結果として出力することを特徴とする前
記アドレス変換装置。
1. An address translator that outputs a physical address corresponding to the virtual address as a result of address translation in response to input of a virtual address, wherein the virtual address VA corresponds to the arbitrary virtual address VA. The physical address PA (VA), the physical address PA (VA + 1) corresponding to the virtual address obtained by adding 1 to the virtual address VA, and the physical address corresponding to the virtual address obtained by subtracting 1 from the virtual address. PA (VA-1) is also stored together, and at the time of address conversion, the input virtual address VA is input with respect to the input virtual address VA ′ and the physical address selection signal 1 and the physical address selection signal 2 input from the outside. 'The three physical addresses PA (V
A '), PA (VA' + 1), PA (VA'-1) are selected, and the physical address P selected according to the physical address selection signal 1 and the physical address selection signal 2 is selected.
A (VA '), PA (VA' + 1), PA (VA'-
The address translation device, further selecting one of the physical addresses from 1) and outputting it as the address translation result.
【請求項2】 記憶装置の任意の物理アドレスからデー
タを読み出すか、もしくは前記記憶装置の任意の前記物
理アドレスにデータを書き込むかにあたって、 ベースアドレスを含むレジスタと前記ベースアドレスか
らのディスプレースメントとを指定し、前記ベースアド
レスと前記ディスプレースメントとを加算して仮想アド
レスを求めるアドレス加算と、 前記仮想アドレスの上位アドレスをアドレス変換装置に
入力して前記物理アドレスの上位アドレスに変換し、前
記仮想アドレスの下位アドレスをそのまま物理アドレス
の下位アドレスとして使用することにより、前記記憶装
置の前記物理アドレスを求めるアドレス変換とから構成
されることを特徴とするマイクロプロセッサのアドレス
算出方法において、 請求項1に記載の前記アドレス変換装置を用いること
と、 前記仮想アドレスの前記下位アドレスのビット数を前記
ディスプレースメントのビット数より一つ少ないかもし
くはそれ以上の数とすることと、 前記ディスプレースメントのビット数が前記仮想アドレ
スの前記下位アドレスのビット数より少ない場合は前記
ディスプレースメントの符合拡張を行ない、前記ベース
アドレスと前記ディスプレースメントの下位アドレスを
前記仮想アドレスの前記下位アドレスと同じ位置とビッ
ト数を持つアドレスとしてそれぞれ定義し、前記ベース
アドレスの上位アドレスを前記仮想アドレスの前記上位
アドレスと同じ位置とビット数を持つアドレスとして定
義し、 前記アドレス加算においては、前記ベースアドレスの前
記下位アドレスと前記ディスプレースメントの前記下位
アドレスとの加算を行なって前記仮想アドレスの前記下
位アドレスと桁上げ信号とを生成することと、 前記アドレス変換においては、前記ベースアドレスの前
記上位アドレスを前記入力仮想アドレスとして前記アド
レス変換装置に力し、前記ディスプレースメントの符合
ビットを前記物理アドレス選択信号1とし、前記桁上げ
信号を前記物理アドレス選択信号2として前記アドレス
変換装置に入力し、これらの入力に応じて、前記アドレ
ス変換装置が、前記ベースアドレスと前記ディスプレー
スメントの加算により求められる前記仮想アドレスの前
記上位アドレスに対応する前記物理アドレスの上位アド
レスを出力することとを特徴とするマイクロプロセッサ
のアドレス算出方法。
2. A register including a base address and a displacement from the base address are used when reading data from an arbitrary physical address of the storage device or writing data to the arbitrary physical address of the storage device. Address addition for designating and adding the base address and the displacement to obtain a virtual address, inputting an upper address of the virtual address to an address translation device and converting the upper address of the physical address to the virtual address The address calculation method for a microprocessor, comprising: address conversion for obtaining the physical address of the storage device by directly using the lower address of the physical address as the lower address of the physical address. Address of Using a translation device, the number of bits of the lower address of the virtual address is one less than or more than the number of bits of the displacement, and the number of bits of the displacement of the virtual address If the number of bits is smaller than the number of bits of the lower address, the sign extension of the displacement is performed, and the lower address of the base address and the displacement is defined as an address having the same position and the same number of bits as the lower address of the virtual address. , An upper address of the base address is defined as an address having the same position and the same number of bits as the upper address of the virtual address, and in the address addition, the lower address of the base address and the lower address of the displacement. To generate a lower address and a carry signal of the virtual address, and in the address translation, the upper address of the base address is input to the address translation device as the input virtual address. Then, the sign bit of the displacement is used as the physical address selection signal 1 and the carry signal is input as the physical address selection signal 2 to the address translation device, and the address translation device responds to these inputs, An address calculation method for a microprocessor, comprising: outputting an upper address of the physical address corresponding to the upper address of the virtual address obtained by adding the base address and the displacement.
【請求項3】 アドレス加算とアドレス変換とを並列に
行なうことを特徴とする請求項2に記載のマイクロプロ
セッサのアドレス算出方法。
3. The address calculation method for a microprocessor according to claim 2, wherein the address addition and the address conversion are performed in parallel.
【請求項4】 マイクロプロセッサにおける命令パイプ
ラインの一つのパイプラインステージの中で、前記アド
レス加算と前記アドレス変換とを並列に行なうことを特
徴とする請求項3に記載のマイクロプロセッサのアドレ
ス算出方法。
4. The method of calculating an address of a microprocessor according to claim 3, wherein the address addition and the address conversion are performed in parallel in one pipeline stage of an instruction pipeline in the microprocessor. .
【請求項5】 マイクロプロセッサにおける命令パイプ
ラインの一つのパイプラインステージの中で、前記アド
レス加算と前記アドレス変換とを並列に行ない、更に、
前記パイプラインステージの中でキャッシュメモリへの
アクセスをも行なうことを特徴とする請求項3に記載の
マイクロプロセッサアドレス算出方法。
5. The address addition and the address conversion are performed in parallel in one pipeline stage of an instruction pipeline in a microprocessor, and further,
4. The method of calculating a microprocessor address according to claim 3, wherein the cache memory is also accessed in the pipeline stage.
【請求項6】 マイクロプロセッサにおける命令パイプ
ラインの一つのパイプラインステージの中で、前記アド
レス加算と前記アドレス変換とを並列に行ない、更に、
前記パイプラインステージの中でキャッシュメモリへの
アクセスのためのデコードをも行なうことを特徴とする
請求項3に記載のマイクロプロセッサのアドレス算出方
法。
6. The address addition and the address conversion are performed in parallel in one pipeline stage of an instruction pipeline in a microprocessor, and further,
4. The address calculation method for a microprocessor according to claim 3, wherein decoding for accessing the cache memory is also performed in the pipeline stage.
JP5333436A 1993-12-27 1993-12-27 Address converter and microprocessor computation method Pending JPH07191911A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5333436A JPH07191911A (en) 1993-12-27 1993-12-27 Address converter and microprocessor computation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5333436A JPH07191911A (en) 1993-12-27 1993-12-27 Address converter and microprocessor computation method

Publications (1)

Publication Number Publication Date
JPH07191911A true JPH07191911A (en) 1995-07-28

Family

ID=18266088

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5333436A Pending JPH07191911A (en) 1993-12-27 1993-12-27 Address converter and microprocessor computation method

Country Status (1)

Country Link
JP (1) JPH07191911A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001042927A1 (en) * 1999-12-09 2001-06-14 Fujitsu Limited Memory access device and method using address translation history table
US6418520B1 (en) 1999-07-23 2002-07-09 Kabushiki Kaisha Toshiba Address converting circuit utilizing string comparison and carry information calculation
JP2006525607A (en) * 2003-04-30 2006-11-09 シリコン・グラフィックス・インコーポレイテッド System and method for performing address translation in a computer system

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5733478A (en) * 1980-07-31 1982-02-23 Nec Corp Information processor

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5733478A (en) * 1980-07-31 1982-02-23 Nec Corp Information processor

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6418520B1 (en) 1999-07-23 2002-07-09 Kabushiki Kaisha Toshiba Address converting circuit utilizing string comparison and carry information calculation
WO2001042927A1 (en) * 1999-12-09 2001-06-14 Fujitsu Limited Memory access device and method using address translation history table
US6993638B2 (en) 1999-12-09 2006-01-31 Fujitsu Limited Memory access device and method using address translation history table
JP2006525607A (en) * 2003-04-30 2006-11-09 シリコン・グラフィックス・インコーポレイテッド System and method for performing address translation in a computer system

Similar Documents

Publication Publication Date Title
US20020029333A1 (en) Methods and apparatus for branch prediction using hybrid history with index sharing
JP3182438B2 (en) Data processor
US5041968A (en) Reduced instruction set computer (RISC) type microprocessor executing instruction functions indicating data location for arithmetic operations and result location
US4739470A (en) Data processing system
US5761467A (en) System for committing execution results when branch conditions coincide with predetermined commit conditions specified in the instruction field
US11385894B2 (en) Processor circuit and data processing method
US5349671A (en) Microprocessor system generating instruction fetch addresses at high speed
JP3983482B2 (en) PC relative branching with high-speed displacement
US6263424B1 (en) Execution of data dependent arithmetic instructions in multi-pipeline processors
US6016541A (en) Instruction controlling system and method thereof
US20040255102A1 (en) Data processing apparatus and method for transferring data values between a register file and a memory
JPH07191911A (en) Address converter and microprocessor computation method
US8583897B2 (en) Register file with circuitry for setting register entries to a predetermined value
JPS60129839A (en) Information processor
US5829049A (en) Simultaneous execution of two memory reference instructions with only one address calculation
JPH0760384B2 (en) Instruction execution method and data processing device
JP2667851B2 (en) Information processing device
JP2685713B2 (en) Data processing device
JP3132566B2 (en) Instruction precedence controller
JPH0520066A (en) Parallel computer
JP2877468B2 (en) Electronic computer
US6289439B1 (en) Method, device and microprocessor for performing an XOR clear without executing an XOR instruction
JPH07200406A (en) Cache system
JP2591325B2 (en) Branch control device
JPH05173778A (en) Data processor

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 19980127