JP2005108262A - Data processor - Google Patents

Data processor Download PDF

Info

Publication number
JP2005108262A
JP2005108262A JP2005000091A JP2005000091A JP2005108262A JP 2005108262 A JP2005108262 A JP 2005108262A JP 2005000091 A JP2005000091 A JP 2005000091A JP 2005000091 A JP2005000091 A JP 2005000091A JP 2005108262 A JP2005108262 A JP 2005108262A
Authority
JP
Japan
Prior art keywords
address
logical
virtual
processing unit
central processing
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
JP2005000091A
Other languages
Japanese (ja)
Inventor
Shinichi Yoshioka
真一 吉岡
Ikuya Kawasaki
郁也 川崎
Saneaki Tamaki
実明 玉城
Susumu Narita
進 成田
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.)
Renesas Technology Corp
Original Assignee
Renesas Technology 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 Renesas Technology Corp filed Critical Renesas Technology Corp
Priority to JP2005000091A priority Critical patent/JP2005108262A/en
Publication of JP2005108262A publication Critical patent/JP2005108262A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To give flexibility to a replacement object of an address translation counterpart in an address translation mechanism. <P>SOLUTION: This data processor for supporting a virtual memory has a buffer memory (1) consisting of four-way set associative type cache memory provided with storage areas for storing correspondence information between logical page numbers (VPN) and physical page numbers (PPN), respectively, having a plurality of banks (11 to 14) having their index addresses shared, when storage information should be replaced from among the plurality of banks by the occurrence of cache mistakes, etc., a set to be replaced is optionally specified by execution of software by a central processor. For example, two-bit information for optionally specifying the bank is set in a register (MMUCR. RC). Signals (BSK1 to BSL4) for selecting one of the four banks are formed by decoding of a value set in the register. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、アドレス変換機構を有するデータ処理装置に関し、特に、アドレス変換機構として、セットアソシアティブ方式のキャッシュメモリを利用したデータ処理装置に係り、更に述べるならば、そのアドレス変換手法の多様化を企図したものであり、例えばマイクロコンピュータに適用して有効な技術に関する。   The present invention relates to a data processing apparatus having an address conversion mechanism, and more particularly to a data processing apparatus that uses a set associative cache memory as the address conversion mechanism, and further intends to diversify the address conversion method. For example, the present invention relates to a technique effective when applied to a microcomputer.

ユーザが実メモリを意識せずに、オペレーティングシステム(以下OSとも記す)がメモリ管理を行う分野では、データ処理装置がアドレス変換機構をサポートする必要がある。アドレス変換機構とは、仮想記憶を実現するために、中央処理装置(CPU)により形成された論理アドレスを物理アドレスに変換する機構である。このアドレス変換機構を高速に実行するために、論理アドレスと物理アドレスとの変換対を保持するアドレス変換バッファ(Translation lookaside buffer、以下単にTLBとも記す)を、中央処理装置とともにデータ処理装置に内蔵する技術が採用される。アドレス変換バッファは、例えば、最近使用された論理アドレスと物理アドレスとの変換対を保持する連想記憶構造のバッファメモリとして構成される。連想記憶構造のバッファメモリとしては、各メモリセルに比較のための回路構成を備えたCAM(Content Addressable Memory)から成るフルアソシアティブメモリ、汎用のランダムアクセスメモリを利用して比較的高いヒット率を実現できるセットアソシアティブ形式の連想メモリなどを利用することができる。尚、連想記憶形式のアドレス変換バッファについて記載された文献の例としてはにから発行された第287頁及び第288頁がある。   In a field where an operating system (hereinafter also referred to as OS) performs memory management without the user being aware of real memory, the data processing device needs to support an address translation mechanism. The address conversion mechanism is a mechanism for converting a logical address formed by a central processing unit (CPU) into a physical address in order to realize virtual storage. In order to execute this address translation mechanism at high speed, an address translation buffer (translation lookaside buffer, hereinafter simply referred to as TLB) holding a translation pair between a logical address and a physical address is built in the data processing apparatus together with the central processing unit. Technology is adopted. The address translation buffer is configured, for example, as a buffer memory having an associative memory structure that holds a translation pair of a recently used logical address and physical address. A buffer memory with an associative memory structure achieves a relatively high hit rate using a fully associative memory consisting of CAM (Content Addressable Memory) with a circuit configuration for comparison in each memory cell and a general-purpose random access memory. A set associative type associative memory can be used. Examples of documents describing the address conversion buffer in the associative memory format include pages 287 and 288 issued from Japan.

「超高速MOSデバイス」,日本,株式会社培風館,昭和61年2月10日,p.287−288“Ultra-high-speed MOS device”, Japan, Baifukan Co., Ltd., February 10, 1986, p. 287-288

本発明者は、このようなアドレス変換バッファにつき、ユーザの要求仕様に応えることができ、良好な使い勝手を実現するという点について検討したところ以下のような問題点を見出した。     The present inventor has examined the point that such an address translation buffer can meet the user's required specifications and realizes good usability, and has found the following problems.

(1)仮想記憶をサポートするアドレス変換機構においては、論理アドレス空間を論理ページと呼ばれる単位に分割して、そのページ単位に物理アドレスへのアドレス変換を行う。一方、システムに、実際に実装される実メモリ(物理メモリ)の全記憶容量が少ないような場合には、論理ページのサイズを比較的小さくして、各プロセスによるメモリの利用効率を向上させたいという要求などがある。例えば、実行されるべきタスクが、比較的小さなサイズのプログラムで構成される場合、そのタスクに割り当てられる論理ページのサイズが比較的大きいと、これに対応して、そのタスクを実行するための物理ページのサイズも比較的大きくなってしまう。そのため、必要以上の記憶空間が、タスクに割り当てられることになり、メモリの利用効率が低下する。特に、実メモリの記憶容量が比較的小さい場合には、論理ページのサイズを小さくして、実メモリの利用効率が低下するのを防ぐことが望まれる。このような要求に、適宜対応できるようにするには、論理ページのサイズを可変にすることが望ましい。ところが、論理ページのサイズを可変にすると、一定の論理空間において論理ページを規定するための情報のビット数が変化される。その結果、アドレス変換バッファから情報を連想的に検索するための比較対象情報のビット数やビット位置が、論理ページサイズによって変化されなければならない。これに対処するために、アドレス変換バッファにCAMから成るフルアソシアティブ形式を採用することが考えられる。このようにすれば、各メモリセルが比較回路を備えていることから特別な考慮を要することなく、比較的簡単に、論理ページの可変化を実現できる。しかしながら、各メモリセルが比較回路を備えているためセットアソシアティブ形式のアドレス変換バッファに比べてチップ専有面積と消費電力が共に倍増するという欠点が有る。   (1) In an address translation mechanism that supports virtual memory, a logical address space is divided into units called logical pages, and address translation to physical addresses is performed in units of pages. On the other hand, when the total storage capacity of the actual memory (physical memory) actually mounted in the system is small, the logical page size should be made relatively small to improve the memory utilization efficiency by each process. There is a request. For example, when a task to be executed is configured by a program having a relatively small size, if the size of a logical page allocated to the task is relatively large, the physical for executing the task is correspondingly corresponding to this. The page size is also relatively large. Therefore, more storage space than necessary is allocated to the task, and the memory utilization efficiency is reduced. In particular, when the storage capacity of the real memory is relatively small, it is desired to reduce the size of the logical page to prevent the use efficiency of the real memory from decreasing. In order to be able to respond appropriately to such a request, it is desirable to make the size of the logical page variable. However, when the size of the logical page is made variable, the number of bits of information for defining the logical page in a certain logical space is changed. As a result, the number of bits and the bit position of comparison target information for associatively retrieving information from the address translation buffer must be changed according to the logical page size. In order to cope with this, it is conceivable to adopt a full associative format composed of CAM for the address translation buffer. In this way, since each memory cell includes a comparison circuit, the logical page can be changed relatively easily without requiring special consideration. However, since each memory cell is provided with a comparison circuit, there is a drawback that both the chip-occupied area and the power consumption are doubled as compared with a set-associative address translation buffer.

(2)セットアソシアティブ形式のアドレス変換バッファにおいては、複数セット存在するバンクの数、即ちウェイ数を増やせば一つのインデックスアドレスに対して保持できるエントリ数を増やして、ヒット率を向上させることができる。例えば4ウェイ・セットアソシアティブ形式の場合には、一つのインデックスアドレスに対して最大4個のエントリを保持できる。しかしながら、複数のプロセスの夫々が論理空間の全域にわたるアドレス変換情報を有し、プロセス番号によって論理アドレスを修飾或いは拡張する多重仮想記憶を行う場合、比較的多くのプロセスが並列的に起動されると、夫々のプロセスが同一論理ページを利用する頻度が多くなる。各々のプロセスは、プロセス番号が互いに異なるため、一つのインデックスアドレスによって指示されるところの互いに異なるエントリに保持されることになる。そのため、プロセスの数が、ウエイの数を越えると、セットアソシアティブ形式であっても、ヒット率は相対的に低下することになる。したがって、多重仮想記憶において多くのプロセスが並列的に起動される利用形態においては、ヒット率の低下を抑えることができるように、その利用形態に応じてインデックス方法を選択可能にすることの必要性が見出された。   (2) In a set associative address translation buffer, if the number of banks in a plurality of sets, that is, the number of ways is increased, the number of entries that can be held for one index address can be increased and the hit rate can be improved. . For example, in the case of the 4-way set associative format, a maximum of 4 entries can be held for one index address. However, when each of a plurality of processes has address translation information over the entire logical space and performs multiple virtual storage in which a logical address is modified or expanded by a process number, a relatively large number of processes are started in parallel. Each process uses the same logical page more frequently. Since the processes have different process numbers, the processes are held in different entries indicated by one index address. Therefore, when the number of processes exceeds the number of ways, the hit rate is relatively lowered even in the set associative format. Therefore, in a usage mode in which many processes are started in parallel in multiple virtual memory, it is necessary to be able to select an indexing method according to the usage mode so as to suppress a decrease in the hit rate. Was found.

(3)目的とする変換対がアドレス変換バッファに格納されていない場合には、当該キャッシュミスに係る変換対(所望の変換対)が新たなエントリとしてアドレス変換バッファに追加される。このとき、インデックスされたエントリにおける変換対の全てが有効な変換対である場合には、変換対の置き換えが行われる。この置き換えのアルゴリズム(リプレースメントアルゴリズム)には、ランダム、最初にロードされたものからリプレースするFIFO、又は最後に参照されたものからリプレースするLRU(Least Recentry Used)などがある。しかしながら、リプレースメントアルゴリズムを固定化した場合には、データ処理の都合上、常に特定の変換対をアドレス変換バッファにエントリとして格納しておきたいという要求や、特定のアドレス変換対をリプレース対象にしたくないという要求には一切答えることができない。   (3) If the target translation pair is not stored in the address translation buffer, the translation pair related to the cache miss (desired translation pair) is added to the address translation buffer as a new entry. At this time, if all of the conversion pairs in the indexed entry are valid conversion pairs, the conversion pairs are replaced. As the replacement algorithm (replacement algorithm), there are random, first-load FIFO to be replaced, or last-referenced LRU (Least Recentry Used). However, when the replacement algorithm is fixed, for the sake of data processing, a request to always store a specific translation pair as an entry in the address translation buffer or a specific address translation pair is not desired to be replaced. I can't answer any request.

(4)仮想記憶の形式には上記多重仮想記憶の他に、複数のプロセスに論理アドレス空間の一部が排他的に割り当てられる単一仮想記憶がある。使い勝手を向上させるという点においては、これらの双方をサポートできるようにすることが望ましい。   (4) In addition to the above-described multiple virtual memory, there is a single virtual memory in which a part of the logical address space is exclusively allocated to a plurality of processes. It is desirable to be able to support both of these in terms of improving usability.

本発明の目的は、ユーザの要求仕様に応えることができて使い勝手の良好なアドレス変換機構を備えたデータ処理装置を実現することにある。   An object of the present invention is to realize a data processing apparatus having an address translation mechanism that can meet user's required specifications and is easy to use.

本発明の目的を、更に詳述すれば、次の通りである。チップ専有面積と電力消費量を増大させることなく複数のページサイズをサポートできるアドレス変換機構を備えたデータ処理装置を提供すること。   The object of the present invention will be described in further detail as follows. To provide a data processing apparatus having an address conversion mechanism capable of supporting a plurality of page sizes without increasing a chip exclusive area and power consumption.

複数のインデックス方法をサポートし、それらからインデックス方法を選択できるアドレス変換機構を備えたデータ処理装置を提供すること。   A data processing apparatus including an address translation mechanism that supports a plurality of index methods and from which an index method can be selected is provided.

アドレス変換対のリプレース対象に自由度を持たせることができるアドレス変換機構を備えたデータ処理装置を提供すること。   To provide a data processing device including an address conversion mechanism that can give a degree of freedom to a replacement target of an address conversion pair.

また、サポートできる仮想記憶形式についても自由度を持たせることができるアドレス変換機構を備えたデータ処理装置を提供すること。   In addition, the present invention provides a data processing apparatus having an address translation mechanism that can give a degree of freedom to a virtual storage format that can be supported.

本発明の前記並びにその他の目的と新規な特徴は本明細書の記述及び添付図面から明らかになるであろう。   The above and other objects and novel features of the present invention will be apparent from the description of this specification and the accompanying drawings.

本願において開示される発明のうち代表的なものの概要を簡単に説明すれば下記の通りである。   The following is a brief description of an outline of typical inventions disclosed in the present application.

《複数ページサイズをサポート》 仮想記憶をサポートするデータ処理装置は、論理アドレス空間を論理ページと呼ばれる単位に分割して、そのページ単位で、論理アドレスを物理アドレスへ変換(アドレス変換)する。このデータ処理装置では、図1に例示されるように、その論理ページのサイズが、ページ毎に可変とされる。それぞれサイズが可変な複数の論理ページに対して、アドレス変換バッファのようなバッファメモリ1は、共通に利用される。このバッファメモリ1としては、論理ページ番号VPNとそれに対応する物理ページ番号PPNとを含むところの対応情報を、記憶するための記憶領域を夫々供え、共通のインデックスアドレス2によってアクセスされる複数バンク11〜14を持つセットアソシアティブ方式のキャッシュメモリが使われる。   << Supporting Multiple Page Sizes >> A data processing apparatus that supports virtual storage divides a logical address space into units called logical pages, and converts logical addresses into physical addresses (address conversion) in units of pages. In this data processing apparatus, as illustrated in FIG. 1, the size of the logical page is variable for each page. A buffer memory 1 such as an address translation buffer is commonly used for a plurality of logical pages each having a variable size. The buffer memory 1 is provided with a plurality of banks 11 each provided with a storage area for storing correspondence information including a logical page number VPN and a corresponding physical page number PPN, and accessed by a common index address 2. A set associative cache memory with ~ 14 is used.

サポートする論理ページの最大サイズは最小サイズの2のべき乗数倍(2のN乗倍)にされ、セットアソシアティブ方式のバッファメモリのバンクの数がその2のべき乗数(2のN乗数)以上とされる。更に詳しくは、図1に例示されるように、全体で4GB(ギガバイト)とされる論理アドレス空間(ビット0〜ビット31の論理アドレスで指定される)において、論理ページのサイズは、4KB(キロバイト)と1KBの2種類とされる。この場合、バッファメモリ1のバンクの数は4個とされ、バッファメモリ1は4ウェイ・セットアソシアティブ形式のキャッシュメモリとして構成される。論理ページサイズが4KBのとき、論理アドレスのオフセットは、論理アドレスのビット0〜ビット11とされ、論理ページ番号vpnは、論理アドレスのビット12〜ビット31とされる。論理ページサイズが1KBのとき、論理アドレスのオフセットは、論理アドレスのビット0〜ビット9とされ、論理ページ番号vpnは、論理アドレスのビット10〜ビット31とされる。尚、本明細書において小文字で示されるvpn,ppn,asidは、アクセスに利用される論理ページ番号、物理ページ番号、プロセス番号とされ、大文字で示されるバッファメモリ(アドレス変換バッファ)のエントリもしくはページテーブルエントリとしての論理ページ番号VPN、物理ページ番号PPN、プロセス番号ASIDとは区別される。   The maximum size of the logical page to be supported is a power of 2 times the minimum size (2 to the power of N), and the number of banks of the set associative buffer memory is greater than the power of 2 (the power of 2 to the N power). Is done. More specifically, as illustrated in FIG. 1, in a logical address space (specified by a logical address of bits 0 to 31) of 4 GB (gigabytes) as a whole, the size of the logical page is 4 KB (kilobytes). ) And 1 KB. In this case, the number of banks of the buffer memory 1 is four, and the buffer memory 1 is configured as a 4-way set associative cache memory. When the logical page size is 4 KB, the logical address offset is bits 0 to 11 of the logical address, and the logical page number vpn is bits 12 to 31 of the logical address. When the logical page size is 1 KB, the logical address offset is bits 0 to 9 of the logical address, and the logical page number vpn is bits 10 to 31 of the logical address. In this specification, vpn, ppn, and asid indicated by lowercase letters are logical page numbers, physical page numbers, and process numbers used for access, and entries or pages of a buffer memory (address translation buffer) indicated by uppercase letters. It is distinguished from the logical page number VPN, physical page number PPN, and process number ASID as table entries.

上記アドレス変換バッファにおいて、バッファメモリ1に対するインデックスアドレスの指定方法は、論理ページのサイズが4KBと1KBの双方において共通化され、最大ページサイズの論理ページアドレスにおける最下位から所定の複数ビットがインデックスアドレスとして与えられる。上記図1の例に従えば、全部で32ビットの論理アドレスにおけるビット12〜ビット16の5ビットを用いてバッファメモリ1がインデックスされる。インデックスアドレスは5ビットであるから、1バンク当たり最大32個のエントリを保有できる。図1の例のように、4個のバンクを持つ場合には、一つのインデックスアドレスにつき、最大4個のエントリを保有できる。上記インデックスアドレスは、ページサイズが4KBの場合には、当該論理ページ番号vpnの最下位から5ビット(ビット12〜16)とされるので、ページサイズ4KBのときは、任意の論理ページ番号のエントリを、各バンクに最大32個(全体で128エントリ)保有することができる。一方、ページサイズが1KBの場合には、当該論理ページ番号vpnの最下位から2ビット(ビット10,11)がインデックスに利用されないことになる。すなわち、論理ページサイズが1KBであって、一つのバンクに対するインデックスだけを考えると、インデックスされたエントリは、インデックスに利用されない2ビット(ビット10,11)によって更にその中から1個が選ばれるべき4個の論理ページ番号の内の何れか一つとされる。したがって、バンクの数が1個しか存在しない場合には、連続する4個の論理ページの内の1個しかエントリとして保有することができない。この点においては、論理ページの最大サイズ(4KB)が、最小サイズ(1KB)の2の2乗倍とされ、バンク数も2の2乗個(4個)設けることにより、バッファメモリ(アドレス変換バッファ)全体としては4KBページサイズとほぼ同様に、任意の論理ページ番号のエントリを、全体で128個保有することができる。但し、一つのバンクに保有できるエントリの論理ページ番号は4KB毎という制約を受ける。この制限は、アドレス変換バッファの保有するエントリの論理ページ番号が連続的であれば、ヒット(TLBヒット)率には何等影響を与えない。分散的である場合にはある程度ヒット率に影響を受ける。この場合でも、1KBの論理ページを2KB毎にアドレスマッピングすればその影響を小さくでき、4KB毎にアドレスマッピングすれば全く影響を受けないようにすることができる。   In the address conversion buffer, the index address designation method for the buffer memory 1 is such that the logical page size is common to both 4 KB and 1 KB, and a predetermined plurality of bits from the least significant logical page address of the maximum page size are index addresses. As given. According to the example of FIG. 1, the buffer memory 1 is indexed using 5 bits of bits 12 to 16 in a logical address of 32 bits in total. Since the index address is 5 bits, a maximum of 32 entries can be held per bank. In the case of having four banks as in the example of FIG. 1, a maximum of four entries can be held for one index address. When the page size is 4 KB, the index address is 5 bits (bits 12 to 16) from the lowest order of the logical page number vpn. Therefore, when the page size is 4 KB, an entry of an arbitrary logical page number is used. Can be stored in each bank at a maximum of 32 (128 entries in total). On the other hand, when the page size is 1 KB, the least significant 2 bits (bits 10 and 11) of the logical page number vpn are not used for the index. That is, when the logical page size is 1 KB and only the index for one bank is considered, one index is to be selected from 2 bits (bits 10 and 11) that are not used for the index. One of the four logical page numbers. Therefore, when there is only one bank, only one of four consecutive logical pages can be held as an entry. In this respect, the maximum size (4 KB) of the logical page is set to the square of 2 of the minimum size (1 KB), and the number of banks is also set to the square of 2 (4), thereby providing buffer memory (address conversion). As a whole, the buffer) can hold a total of 128 entries having an arbitrary logical page number in the same manner as the 4 KB page size. However, the logical page number of an entry that can be held in one bank is restricted by every 4 KB. This restriction has no effect on the hit (TLB hit) rate if the logical page numbers of entries held in the address translation buffer are continuous. In the case of decentralization, the hit rate is affected to some extent. Even in this case, if 1KB logical page is address-mapped for every 2KB, the influence can be reduced, and if address mapping is made for every 4KB, it can be made not affected at all.

TLBヒット/ミスを判定するために、各バンク11〜14に設けられた比較手段15においてヒット判定に反映されるべきアドレス比較のビット数は、論理ページサイズに応じて変化されなければならない。図1の例に従えば、論理ページサイズが1KBの場合には、論理ページサイズが4KBの場合に比べて、論理アドレスのビット10及びビット11も比較対象としなければならない。バッファメモリ1は、そのような比較対象のビット数を全てカバーできるように、論理ページ番号と物理ページ番号との対応情報(変換対)を記憶する領域のビット数が設定されている。バッファメモリ1においては、各変換対にそれがサポートする論理ページサイズを示すフィールドが設けられており、そのフィールドの値(サイズビット)SZに応じてヒット判定のためのアドレス比較のビット数が変化される。比較ビット数が変化される対象は、論理アドレスの論理ページ番号と、バッファメモリ内の変換対に含まれる論理ページ番号の双方とされる。hit1〜hit4は各バンク11〜14におけるヒット判定結果を通知するためのヒット信号であり、それらに基づいてTLBヒット/ミスが判定される。   In order to determine a TLB hit / miss, the number of address comparison bits to be reflected in the hit determination in the comparison unit 15 provided in each bank 11 to 14 must be changed according to the logical page size. According to the example of FIG. 1, when the logical page size is 1 KB, bits 10 and 11 of the logical address must be compared as compared with the case where the logical page size is 4 KB. The buffer memory 1 is set with the number of bits in the area for storing the correspondence information (conversion pair) between the logical page number and the physical page number so as to cover all the number of bits to be compared. In the buffer memory 1, a field indicating the logical page size supported by each conversion pair is provided, and the number of bits for address comparison for hit determination changes according to the value (size bit) SZ of the field. Is done. The object whose comparison bit number is changed is both the logical page number of the logical address and the logical page number included in the conversion pair in the buffer memory. Hit 1 to hit 4 are hit signals for notifying the hit determination result in each of the banks 11 to 14, and a TLB hit / miss is determined based on them.

複数ページサイズを選択的にサポートするデータ処理装置は、システムに実装される実メモリの全記憶容量が少ないような場合に、論理ページのサイズを比較的小さくして、各プロセスによるメモリの利用効率を向上させたいという要求にも容易に対応できる。このとき、最大論理ページサイズを最小サイズの2のべき乗数倍にし、セットアソシアティブ方式のバッファメモリのバンクの数をその2のべき乗数以上にすることは、インデックスアドレスの指定手法を最大論理ページサイズのものに統一しても、選ばれる論理ページのサイズに拘わらず、原理的には、どの論理ページ番号のエントリについても、同じ数だけエントリをバッファメモリに保有することが可能となる。論理ページのサイズを示すための情報を用いてヒット判定に反映されるべきアドレス比較のビット数を変化させることは、バッファメモリを連想的に検索するための比較対象情報のビット数やビット位置を論理ページのサイズによって変化させることを容易に実現する。複数ページサイズをサポートするバッファメモリをセットアソシアティブ形式のキャッシュメモリで実現することは、これをCAMで構成する場合に比べてチップ専有面積と消費電力を共に半減させる。   A data processing apparatus that selectively supports multiple page sizes can reduce the size of logical pages when the total storage capacity of real memory installed in the system is small, and the memory usage efficiency by each process It is possible to easily meet the demand to improve the quality. At this time, the maximum logical page size is set to a power of 2 times the minimum size, and the number of banks of the set associative buffer memory is set to a power of 2 or more. Regardless of the size of the selected logical page, in principle, the same number of entries can be held in the buffer memory for any logical page number entry. Changing the number of bits of the address comparison to be reflected in the hit determination using information for indicating the size of the logical page means changing the number of bits and the bit position of the comparison target information for associatively searching the buffer memory. It can be easily changed according to the size of the logical page. Realizing a buffer memory that supports a plurality of page sizes with a set-associative cache memory halves both the chip-occupied area and the power consumption compared to the case where it is configured with a CAM.

《複数のインデックス方法をサポート》 仮想記憶をサポートするデータ処理装置は、論理ページ番号と物理ページ番号との対応情報を記憶するための記憶領域を夫々有し、夫々が共通のインデックスアドレスによってアクセスされる複数バンクを持つセットアソシアティブ方式のキャッシュメモリによって構成されたバッファメモリを供える。そして、そのバッファメモリに対するインデックスアドレスの生成手法を可変とする手段を有する。例えば、複数のプロセスが存在し、夫々のプロセスが夫々のアドレス変換情報を有し、プロセス番号によってそれぞれのプロセスが区別される多重仮想記憶をサポートする場合、バッファメモリからエントリをインデックスするためのアドレス指定方法として、図2に例示されるように論理アドレスの一部(ビット12〜16)のみをデコードする手法と、図3に示されるようにその論理アドレスの一部(ビット12〜16)を現在のプロセス番号(asid)の一部によって修飾(XOR=排他的論理和)した結果をデコードする手法とを、レジスタMMUCR.IXの論理値にしたがって指示するようにできる。尚、図3,図2において、バッファメモリ1内の変換対に含まれる論理ページ番号VPNの情報はインデックスに利用されるvpn(16−12)に対応されるものが除かれて、VPN(31−17),VPN(11−10)として図示されている。ここで、vpn(16−12)の表記は論理アドレスのビット12〜ビット16を含む論理ページ番号の情報であることを意味する。VPN(31−17)の表記は論理アドレスのビット17〜ビット31に対応されるバッファメモリのエントリとしての論理ページ番号の情報であることを意味する。   << Supporting multiple index methods >> Data processing devices that support virtual storage each have storage areas for storing correspondence information between logical page numbers and physical page numbers, and each is accessed by a common index address. A buffer memory composed of a set associative cache memory having a plurality of banks. And it has a means to make variable the index address generation method for the buffer memory. For example, in the case where there are a plurality of processes, each process has respective address translation information, and supports multiple virtual memories in which each process is distinguished by a process number, an address for indexing an entry from the buffer memory As a designation method, a method of decoding only a part of the logical address (bits 12 to 16) as illustrated in FIG. 2 and a part of the logical address (bits 12 to 16) as illustrated in FIG. A method of decoding the result of modification (XOR = exclusive OR) by a part of the current process number (asid), and register MMUCR. The instruction can be made according to the logical value of IX. 3 and 2, the information of the logical page number VPN included in the conversion pair in the buffer memory 1 is excluded from the information corresponding to vpn (16-12) used for the index, and VPN (31 -17), VPN (11-10). Here, the notation of vpn (16-12) means the information of the logical page number including bits 12 to 16 of the logical address. The notation of VPN (31-17) means the information of the logical page number as the buffer memory entry corresponding to bit 17 to bit 31 of the logical address.

複数のインデックス方法をサポートする手段によれば、多重仮想記憶において多くのプロセスが並列的に起動される利用形態においてヒット率の低下を抑えることができるように、その利用形態に応じてインデックス方法を選択可能にすることができる。論理アドレスの一部を当該論理アドレスを利用するプロセス番号(asid)によって修飾し、これを以てバッファメモリをインデックスすることにより、多重仮想記憶において多くのプロセスが並列的に起動される利用形態においてのヒット率の低下を抑えることが可能となる。   According to the means for supporting a plurality of index methods, the index method can be set according to the usage mode so that a decrease in hit rate can be suppressed in a usage mode in which many processes are started in parallel in multiple virtual memory. Can be selectable. A hit in a usage mode in which many processes are started in parallel in multiple virtual memory by qualifying a part of the logical address with a process number (asid) using the logical address and indexing the buffer memory with this. It is possible to suppress a decrease in rate.

《リプレースの自由度》 仮想記憶をサポートするデータ処理装置は、図4に例示されるように、論理ページ番号VPNと物理ページ番号PPNとの対応情報を記憶するための記憶領域を夫々供え、夫々のインデックスアドレスが共通化された複数バンク11〜14を持つ4ウェイ・セットアソシアティブ方式のキャッシュメモリから成るバッファメモリ1を有し、キャッシュミスなどの発生によって、これらの複数バンクの中から記憶情報を置換すべき場合に、当該置換されるべきセットは、中央処理装置によるソフトウェアの実行によって任意に指定可能にされる。例えばMMUCR.RCは、上記バンクを任意に指定するための2ビットの情報が設定されるレジスタである。これに設定された値がデコーダ17によって解読されることにより4個のバンク11〜14の中から一つを選ぶ信号(BSK1〜BSL4)が形成される。これにより、4個のバンク11〜14の内、上記選択信号によって指定された1個のバンクであって、インデックスアドレス2で指定された1つのエントリが置換対象とされる。このレジスタMMUCR内のビットMMUCR.RCに対する値の設定がハードウェア手段によって行われるとき、当該ハードウェア手段によるバンクの指定は上記中央処理装置(CPU)によるソフトウェアの実行によって任意に変更可能にされる。   << Degree of Freedom of Replacement >> As illustrated in FIG. 4, each data processing apparatus that supports virtual storage provides storage areas for storing correspondence information between logical page numbers VPN and physical page numbers PPN, respectively. The buffer memory 1 includes a 4-way set associative cache memory having a plurality of banks 11 to 14 with a common index address. When a cache miss occurs, stored information is stored in the plurality of banks. In the case of replacement, the set to be replaced can be arbitrarily specified by execution of software by the central processing unit. For example, MMUCR. RC is a register in which 2-bit information for arbitrarily designating the bank is set. A value (BSK1 to BSL4) for selecting one of the four banks 11 to 14 is formed by the decoder 17 decoding the set value. Thus, one of the four banks 11 to 14 designated by the selection signal and one entry designated by the index address 2 is a replacement target. Bits MMUCR. When setting of a value for RC is performed by hardware means, designation of a bank by the hardware means can be arbitrarily changed by execution of software by the central processing unit (CPU).

上記ハードウェア手段は、図4に例示されるように、MMUCR.RCをランダムカウンタのような計数手段として備え、その計数手段のビット数の2のべき乗数が、上記バッファメモリ1のバンクの数(=4)と一致される。上記ハードウェア手段に含まれる制御回路CTRLは、バッファメモリ1に対する記憶情報の置換が必要になった場合、上記計数手段を1インクリメントし、何れのバンクの、インデックスされた記憶領域にも有効なデータが保持されている(インデックスされた各バンクの各エントリが、有効を示す”1”のバリッドビットVを有する)場合には、そのインクリメントされた結果を置換すべきバンク番号とする。これに対して、何れかのバンク内で、インデックスされた記憶領域に、有効なデータが保持されていない(インデックスされた何れかのエントリが、無効を示す”0”のバリッドビットVを有する)場合には、有効なデータを保持していないエントリを含むバンクの番号を計数手段にセットし、且つセットされた番号のバンクを置換すべきバンクとする。このような一定の規則に従って、置換すべきバンクの指定が行われる。このとき、上記計数手段の各ビットは、中央処理装置により実行されるソフトウェアによって、任意の値へ変更することが可能な対象とされている。   As illustrated in FIG. 4, the hardware means includes MMUCR. RC is provided as a counting means such as a random counter, and the power of 2 of the number of bits of the counting means matches the number of banks of the buffer memory 1 (= 4). The control circuit CTRL included in the hardware means increments the counting means by 1 when replacement of the stored information for the buffer memory 1 is necessary, and is effective for any indexed storage area of any bank. Is held (each entry of each indexed bank has a valid bit V of “1” indicating validity), the incremented result is set as a bank number to be replaced. On the other hand, valid data is not held in the indexed storage area in any bank (any indexed entry has a valid bit V of “0” indicating invalidity). In this case, the bank number including the entry that does not hold valid data is set in the counting means, and the bank having the set number is set as the bank to be replaced. The bank to be replaced is designated according to such a certain rule. At this time, each bit of the counting means is a target that can be changed to an arbitrary value by software executed by the central processing unit.

リプレースの自由度を向上させる手段によれば、バッファメモリの変換対を置き換えるためのリプレースメントアルゴリズムを固定化せず、置き換えるべきバンクをソフトウェアで任意に決定することが可能となる。これにより、データ処理の都合上、常に特定の変換対をアドレス変換バッファにエントリとして格納しておきたいという要求や、特定のアドレス変換対をリプレース対象にしたくないという要求に容易に答えることができる。ソフトウェアによってリプレースの対象を指示するレジスタを持つことは、ソフトウェアのアルゴリズム次第で、ランダム、FIFO、又はLRUなどにしたがってリプレースを行う自由度も保証できる。   According to the means for improving the degree of freedom of replacement, it is possible to arbitrarily determine the bank to be replaced by software without fixing the replacement algorithm for replacing the conversion pair of the buffer memory. As a result, it is possible to easily respond to a request to always store a specific translation pair as an entry in the address translation buffer for convenience of data processing or a request not to make a specific address translation pair to be replaced. . Having a register for designating a replacement target by software can guarantee the degree of freedom of replacement according to random, FIFO, LRU, or the like, depending on the algorithm of the software.

《単一仮想記憶と多重仮想記憶のサポート》 仮想記憶をサポートするデータ処理装置は、論理アドレス空間を論理ページと呼ばれる単位に分割して、そのページ単位で、論理アドレスを物理アドレスへアドレス変換を行うためのアドレス変換機構を備える。このアドレス変換機構は、複数のプロセスの夫々が論理空間の全域にわたるアドレス変換情報を有するとき、プロセス番号(asid)によって論理アドレスを修飾或いは拡張する多重仮想記憶と、複数のプロセスに論理アドレス空間の一部が排他的に割り当てられ、夫々のプロセスがそれに割り当てられた論理アドレス空間のアドレス変換情報を有するとき、プロセス番号(asid)によって論理アドレスを修飾或いは拡張しない単一仮想記憶とを有し、該多重仮想記憶と該単一仮想記憶とを選択することが可能にされている。したがって図5に例示されるようにバッファメモリ内の各エントリには、論理ページ番号VPNと物理ページ番号PPNの変換対に加え、プロセス番号ASIDのフィールドが設けられている。このフィールドの内容は、単一仮想記憶か多重仮想記憶かで、その処理内容が相違されることになる。あるTLBエントリに含まれるプロセス番号に対応される論理ページが、他のプロセスと共有不可能とされているとき、多重仮想記憶においては、プロセス番号ASIDのフィールドの内容はバッファメモリに対する検索のヒット/ミス(TLBヒット/TLBミス)の判定に用いられる。即ち、この場合には、バッファメモリに格納されているエントリの論理ページ番号VPNの情報が、論理ページアドレスvpnの情報に一致すると共に、当該エントリのプロセス番号ASIDが現在のプロセスの番号asidに一致していなければTLBヒットとはされない。単一仮想記憶においては、プロセス番号ASIDのフールドの内容はメモリ保護情報として使用される。即ち、この場合には、プロセス番号の相違によってTLBミスが発生したとき、ソフトウェアによってTLBミスの原因がプロセス番号の相違によるものか、論理ページアドレスの相違によるものかが判別され、プロセス番号の相違による場合には、プロテクションエラーとして処理される。上記単一仮想記憶か多重仮想記憶かは、図6に例示されるレジスタMMUCRのビットMMUCR.SVの値によって指示される。このビットMMUCR.SVの値は、中央処理装置によって実行されるソフトウェアによって、任意に設定することができる。   << Support for Single Virtual Storage and Multiple Virtual Storage >> A data processing device that supports virtual storage divides the logical address space into units called logical pages, and converts the logical addresses into physical addresses for each page. It has an address translation mechanism to do it. The address translation mechanism includes a multiple virtual memory that modifies or expands a logical address by a process number (asid) when each of a plurality of processes has address translation information over the entire logical space, and a logical address space for a plurality of processes. Having a single virtual memory that does not qualify or extend a logical address by a process number (asid) when a portion is allocated exclusively and each process has address translation information for the logical address space assigned to it, The multiple virtual memory and the single virtual memory can be selected. Therefore, as illustrated in FIG. 5, each entry in the buffer memory is provided with a process number ASID field in addition to a conversion pair of a logical page number VPN and a physical page number PPN. The contents of this field differ depending on whether it is a single virtual memory or multiple virtual memories. When a logical page corresponding to a process number included in a certain TLB entry cannot be shared with other processes, the contents of the field of the process number ASID are the hit / Used to determine a miss (TLB hit / TLB miss). That is, in this case, the information on the logical page number VPN of the entry stored in the buffer memory matches the information on the logical page address vpn, and the process number ASID of the entry matches the current process number asid. Otherwise, it will not be a TLB hit. In the single virtual memory, the contents of the field of the process number ASID are used as memory protection information. That is, in this case, when a TLB miss occurs due to a difference in the process number, the software determines whether the cause of the TLB miss is due to a difference in the process number or a difference in the logical page address. In case of, it is processed as a protection error. Whether the single virtual memory or the multiple virtual memory is the bit MMUCR. Of the register MMUCR illustrated in FIG. Indicated by the value of SV. This bit MMUCR. The value of SV can be arbitrarily set by software executed by the central processing unit.

単一仮想記憶と多重仮想記憶をサポートする手段によれば、アドレス変換機構の使い勝手を向上させることができる。特に、ソフトウェアを介して、何れを使うかを選択することができるようにして、一層使い勝手を向上させることができる。多重仮想記憶におけるプロセス番号(ASID)を単一仮想記憶におけるメモリ保護情報として使用することにより、単一仮想記憶を選択した場合におけるメモリ保護の完全化を容易に実現することができる。   According to the means for supporting single virtual memory and multiple virtual memory, the usability of the address translation mechanism can be improved. In particular, it is possible to select which one to use via software, thereby further improving usability. By using the process number (ASID) in the multiple virtual memory as the memory protection information in the single virtual memory, it is possible to easily realize the complete memory protection when the single virtual memory is selected.

本願において開示される発明のうち代表的なものによって得られる効果を簡単に説明すれば下記の通りである。   The effects obtained by the representative ones of the inventions disclosed in the present application will be briefly described as follows.

すなわち、代表的な一つの発明によればチップ専有面積と電力消費量を増大させることなく、複数のページサイズをサポートできるデータ処理装置を実現することができる。   That is, according to one representative invention, it is possible to realize a data processing apparatus capable of supporting a plurality of page sizes without increasing the chip exclusive area and power consumption.

代表的な別の一つの発明によれば、インデックス方法を選択できるアドレス変換機構を実現することができる。   According to another typical invention, an address translation mechanism that can select an index method can be realized.

代表的な更に別の一つの発明によれば、アドレス変換対のリプレース対象に自由度を持たせることができる。   According to another representative invention, the replacement target of the address translation pair can have a degree of freedom.

代表的な更に別の一つの発明によれば、サポートできる仮想記憶形式についても自由度を持たせることができる。   According to yet another representative invention, the virtual storage format that can be supported can also have a degree of freedom.

それらにより、ユーザの要求仕様に応えることができて使い勝手の良好なアドレス変換機構を備えたデータ処理装置を実現することができる。   As a result, it is possible to realize a data processing apparatus that can meet the user's required specifications and has an easy-to-use address translation mechanism.

《マイクロコンピュータ》 図7には本発明に係るデータ処理装置の一実施例であるマイクロコンピュータの要部が示される。本実施例のマイクロコンピュータは、特に制限されないが、公知の半導体集積回路製造技術によって単結晶シリコンのような1個の半導体基板に形成されている。同図には、論理アドレスバスVABUS、物理アドレスバスPABUS、データバスDBUS、中央処理装置(CPU)3、キャッシュメモリ(CACHE)4、バッファメモリとしてのアドレス変換バッファ(TLB)1、及びTLBコントローラ(TLBC)5が代表的な回路ブロックとして図示されている。CPU3は図示しないプログラムメモリから命令をフェッチし、その命令記述に応じたデータ処理を行い、外部アクセスを要する場合には論理アドレスバスVABUSに論理アドレスを出力し、データバスDBUSを介してデータの入出力を行う。キャッシュメモリ4は、特に制限されないが、4ウェイ・セットアソシアティブ形式とされ、バンクに対するインデックスは論理アドレスバスVABUSから供給される論理アドレスの一部を用いて行われ、エントリのタグ部には物理アドレスが保有され、インデックスされたタグ部はその論理アドレスがアドレス変換バッファ1で変換されて物理アドレスバスPABUSに出力される物理アドレスと比較され、その比較結果に応じてキャッシュミス/ヒットを判定する。   << Microcomputer >> FIG. 7 shows a main part of a microcomputer as an embodiment of the data processing apparatus according to the present invention. The microcomputer of the present embodiment is not particularly limited, but is formed on a single semiconductor substrate such as single crystal silicon by a known semiconductor integrated circuit manufacturing technique. The figure shows a logical address bus VABUS, a physical address bus PABUS, a data bus DBUS, a central processing unit (CPU) 3, a cache memory (CACHE) 4, an address translation buffer (TLB) 1 as a buffer memory, and a TLB controller ( TLBC) 5 is shown as a representative circuit block. The CPU 3 fetches an instruction from a program memory (not shown), performs data processing according to the instruction description, outputs a logical address to the logical address bus VABUS when external access is required, and inputs data via the data bus DBUS. Output. The cache memory 4 is not particularly limited, but has a 4-way set associative format. The bank is indexed using a part of the logical address supplied from the logical address bus VABUS, and a physical address is included in the tag portion of the entry. And the indexed tag portion is compared with a physical address whose logical address is converted by the address conversion buffer 1 and output to the physical address bus PABUS, and a cache miss / hit is determined according to the comparison result.

本実施例のマイクロコンピュータは、論理アドレス空間を論理ページと呼ばれる単位に分割し、そのページ単位で、論理アドレスを物理アドレスへアドレス変換を行うための仮想記憶をサポートしている。上記アドレス変換バッファ1は、論理ページ番号VPNとこれに対応した物理ページ番号PPNとに関する変換対などをTLBエントリとして格納し、TLBコントローラ5は中央処理装置3が出力する論理アドレスをアドレス変換バッファ1などを用いて物理アドレスに変換する。上記アドレス変換バッファ1は、それぞれインデックスアドレスが共通化された4個のバンクを持つ4ウェイ・セットアソシアティブ方式のキャッシュメモリによって構成される。図面が複雑になるのを避けるために、図7には、代表的に1個のバンク11のみが図示されているが、実際には図1のようにバンク11と同様の別のバンク12〜14が紙面の表裏方向に配置されている。上記アドレス変換バッファ1、TLBコントローラ5、CPU3、及びアドレス変換とメモリ保護のためのシステムソフトウェア若しくはオペレーティングシステムによって、上記仮想記憶をサポートするアドレス変換機構が構成される。   The microcomputer according to the present embodiment divides a logical address space into units called logical pages, and supports virtual storage for performing address conversion from logical addresses to physical addresses in units of pages. The address translation buffer 1 stores a translation pair associated with the logical page number VPN and the corresponding physical page number PPN as a TLB entry, and the TLB controller 5 receives the logical address output from the central processing unit 3 as the address translation buffer 1. Etc. to convert to a physical address. The address conversion buffer 1 is constituted by a 4-way set associative cache memory having four banks each having a common index address. In order to avoid the complexity of the drawing, FIG. 7 typically shows only one bank 11, but actually, another bank 12-similar to the bank 11 as shown in FIG. 14 is arranged in the front and back direction of the paper. The address translation buffer 1, TLB controller 5, CPU 3, and system software or operating system for address translation and memory protection constitute an address translation mechanism that supports the virtual memory.

ここで、予じめ、本実施例のマイクロコンピュータのアドレス空間について説明する。本実施例のマイクロコンピュータは、4GBの論理アドレス空間をサポートするために、中央処理装置3は、32ビットの論理アドレスを形成する。その論理アドレスは後述のプロセス番号(空間番号とも記す)asidによって拡張可能にされている。図8の(A)及び(B)には、サポートされている論理アドレス空間のアドレスマッピングが示される。これらの図において”Mapped”と示される領域は、アドレス変換バッファ(TLB)1を利用したアドレス変換の対象とされる領域である。H'FFFFFFFF(H'は16進数を意味する)〜H'80000000の領域は、特権モードにおいてアクセス可能な領域とされ、ユーザモードでのアクセスはアドレスエラーとされる。P4領域はコントロールスペースであり、周辺コントロールレジスタなどがマッピングされる。P1,P2領域はそれに対応される物理アドレスが固定とされる領域であり、アドレス変換バッファ1を利用したアドレス変換の対象とはされない。これらの領域P1,P2の論理アドレスは、一定の定数が加算又は減算されて、物理アドレスに変換される。したがって、特権モードにおいて、当該領域P1,P2をアクセスするときはTLBミスを初めとするアドレス変換に係る例外が生じない。特にP2領域はキャッシュメモリCACHEによるキャッシュの対象とされず、P1領域はキャッシュの対象とされている。   Here, the address space of the microcomputer of this embodiment will be described in advance. Since the microcomputer of this embodiment supports a 4 GB logical address space, the central processing unit 3 forms a 32-bit logical address. The logical address can be expanded by a process number (also referred to as a space number) asid described later. 8A and 8B show address mapping of the supported logical address space. In these drawings, an area indicated as “Mapped” is an area to be subjected to address translation using the address translation buffer (TLB) 1. An area from H′FFFFFFFF (H ′ means a hexadecimal number) to H′80000000 is an accessible area in the privileged mode, and an access in the user mode is an address error. The P4 area is a control space to which peripheral control registers and the like are mapped. The P1 and P2 areas are areas where the corresponding physical addresses are fixed, and are not subject to address translation using the address translation buffer 1. The logical addresses of these areas P1 and P2 are converted into physical addresses by adding or subtracting constant constants. Therefore, in the privileged mode, when accessing the areas P1 and P2, no exception related to address translation such as a TLB miss occurs. In particular, the P2 area is not subject to caching by the cache memory CACHE, and the P1 area is subject to caching.

本実施例のマイクロコンピュータは、上述の様に、特権モードとユーザモードとを有し、特権モードで動作しているのか、ユーザモードで動作しているのかが、中央処理装置3に含まれるステータスレジスタSRのモードビットMDの値によって示される。MD=0は、ユーザモードで動作していることを表わし、MD=1は、特権モードで動作していることを表わす。図8の(A)及び(B)に示されているように、特権状態(特権モードが設定されている状態)は、ユーザ状態(ユーザモードが設定されている状態)でのアクセスではアドレスエラーとなるようなアドレス空間(P1からP4)を、アクセスでき、ユーザ状態では実行不可能な特権命令若しくはシステム制御命令を実行することができる、などという点においてユーザ状態と相違される。   As described above, the microcomputer according to the present embodiment has a privileged mode and a user mode, and the status included in the central processing unit 3 indicates whether it is operating in the privileged mode or the user mode. It is indicated by the value of mode bit MD of register SR. MD = 0 represents operating in the user mode, and MD = 1 represents operating in the privileged mode. As shown in FIGS. 8A and 8B, the privileged state (the state in which the privileged mode is set) is an address error in the access in the user state (the state in which the user mode is set). Is different from the user state in that an address space (P1 to P4) can be accessed and privileged instructions or system control instructions that cannot be executed in the user state can be executed.

図8の(A)及び(B)に示される4GBの論理アドレス空間の内、特に制限されないが、P0領域とP3領域は、論理ページと呼ばれる単位で、複数に分割され、分割されたページ単位で、論理アドレスは物理アドレスへ変換される。本実施例のマイクロコンピュータがサポートする論理ページのサイズは4KBと1KBの2種類とされている。これは、サポートされる論理ページの最大サイズ(=4KB)が最小サイズ(=1KB)の2のべき乗数倍にされ、アドレス変換バッファ1のバンクの数(=4)がその2のべき乗数以上であるという関係を満足する。図5に示されるように、論理ページサイズが1KBの場合には、中央処理装置により形成される論理アドレス(ビット0からビット31迄の32ビットのアドレス)の内、ビット0〜ビット9までがオフセットとされ、ビット10〜ビット31までが論理ページ番号(論理ページアドレス)とされる。論理ページサイズが4KBの場合には、論理アドレスの内、ビット0〜ビット11までがオフセットとされ、ビット12〜ビット31までが論理ページ番号(論理ページアドレス)とされる。アドレス変換バッファ1に対するインデックスには、ページサイズが4KBであるか1KBであるかに拘わらず、4KBページサイズの論理ページアドレスの下位5ビットのビット位置の情報、換言すれば、32ビットの論理アドレスのビット12〜ビット16が用いられる。論理アドレスを物理アドレスに変換する場合、当該論理アドレスの論理ページ番号に対応するエントリから物理ページ番号を取得し、当該論理アドレスのオフセット情報を物理ページ番号の下位側に付加して物理アドレスが得られる。   The 4 GB logical address space shown in FIGS. 8A and 8B is not particularly limited, but the P0 area and the P3 area are divided into a plurality of units called logical pages and divided page units. Thus, the logical address is converted into a physical address. There are two types of logical page sizes supported by the microcomputer of this embodiment: 4 KB and 1 KB. This is because the maximum logical page size (= 4 KB) supported is a power of 2 times the minimum size (= 1 KB), and the number of banks of the address translation buffer 1 (= 4) is greater than the power of 2 Satisfy the relationship of As shown in FIG. 5, when the logical page size is 1 KB, bits 0 to 9 are among the logical addresses (32-bit addresses from bit 0 to bit 31) formed by the central processing unit. An offset is used, and bits 10 to 31 are logical page numbers (logical page addresses). When the logical page size is 4 KB, bits 0 to 11 of the logical address are offset, and bits 12 to 31 are a logical page number (logical page address). The index for the address translation buffer 1 includes information on the bit position of the lower 5 bits of the logical page address of the 4 KB page size, in other words, the 32-bit logical address, regardless of whether the page size is 4 KB or 1 KB. Bits 12 to 16 are used. When converting a logical address to a physical address, the physical page number is obtained from the entry corresponding to the logical page number of the logical address, and the offset information of the logical address is added to the lower side of the physical page number to obtain the physical address. It is done.

TLBミスなどが発生した際、アドレス変換バッファ1内のエントリへ取り込まれる情報(ページテーブルエントリ)は、予め、ソフトウエアにより形成され、図7には示されていない外部メモリ(例えば図22のメモリRAM)に記憶されている。すなわち、仮想記憶のためのページテーブルエントリは、論理ページ番号VPNと物理ページ番号PPNとの対応関係を示す変換情報やアクセスの属性などについての記述を含み、外部メモリに形成されるところのページテーブルに格納される。高速なアドレス変換ができるように、このページテーブルに格納されたエントリの一部が、上記TLB1内のバンク11〜14に格納される。外部メモリにおけるページテーブルのアドレスは、後で図6を用いて説明する変換テーブルレジスタ(TTB)53に、予めセットされる。TLBミスなどが発生した際には、この変換テーブルレジスタ53にセットされているベースアドレスと、ミスの際の論理ページ番号等を用いて、CPU3が、上記ページテーブルをアクセスして、その時の論理ページ番号に対応した物理ページ番号等を含むエントリを求めて、例えば、TLB1内のバンクへ求めたエントリを書き込む。これにより、その時の論理アドレスに対応した物理アドレスが形成される。   When a TLB miss or the like occurs, information (page table entry) taken into an entry in the address translation buffer 1 is formed in advance by software, and is not stored in FIG. RAM). That is, the page table entry for virtual storage includes a description of conversion information indicating the correspondence between the logical page number VPN and the physical page number PPN, access attributes, and the like, and is a page table formed in the external memory. Stored in Some of the entries stored in the page table are stored in the banks 11 to 14 in the TLB 1 so that high-speed address translation can be performed. The address of the page table in the external memory is set in advance in a conversion table register (TTB) 53 described later with reference to FIG. When a TLB miss or the like occurs, the CPU 3 accesses the page table using the base address set in the conversion table register 53, the logical page number at the time of the miss, and the logic at that time. An entry including a physical page number or the like corresponding to the page number is obtained, and the obtained entry is written to a bank in TLB1, for example. Thereby, a physical address corresponding to the logical address at that time is formed.

TLB1内の各バンクに格納されるエントリは、図5にその詳細が示されるように、便宜上アドレス部とデータ部に分けられている。アドレス部は、論理ページ番号の情報VPN(31−17),VPN(11−10)、エントリが有効であることを示すバッリドビットV(1ビット)、空間番号ASID(8ビット)、サイズビットSZ(1ビット)、及び共有ステータスSH(1ビット)を有する。データ部は、記憶保護のためのプロテクションPR(2ビット)、論理ページ番号に対応される物理ページ番号PPN(22ビット)、ダーティビットD(1ビット)、及びキャッシャブルビットC(1ビット)を保有する。アドレス部が保有する論理ページ番号の情報は、32ビットの論理アドレスのビットフォーマットにおいてインデックスに利用されるビットを除いたビット10〜ビット11とビット17〜ビット31とされる。前者はVPN(11−10)と表記され、後者はVPN(31−17)と表記されている。共有ステータスSHは複数プロセス間で当該ページが共有されているか否かを示し、SH=0は非共有、SH=1は共有を意味する。空間番号ASIDは特定のプロセスに属するものとして論理ページを定義するために利用されるものであり、プロセス番号とも称する。プロテクションPRはページに対するアクセス権を定義するためにエンコードされたデータであり、その値の組み合わせにより図9に示される態様でアクセス権が定義されている。サイズビットSZは論理ページサイズを指定するビットであり、論理値1は4KBページサイズを指定し、論理値0は1KBページサイズを指定する。   The entries stored in each bank in the TLB 1 are divided into an address part and a data part for convenience, as shown in detail in FIG. The address part includes logical page number information VPN (31-17), VPN (11-10), a valid bit V (1 bit) indicating that the entry is valid, a space number ASID (8 bits), a size bit SZ ( 1 bit) and a sharing status SH (1 bit). The data part includes a protection PR (2 bits) for storage protection, a physical page number PPN (22 bits) corresponding to the logical page number, a dirty bit D (1 bit), and a cacheable bit C (1 bit). Possess. The information of the logical page number held by the address part is composed of bits 10 to 11 and bits 17 to 31 excluding bits used for the index in the bit format of the 32-bit logical address. The former is expressed as VPN (11-10), and the latter is expressed as VPN (31-17). The sharing status SH indicates whether or not the page is shared among a plurality of processes. SH = 0 means non-shared and SH = 1 means shared. The space number ASID is used to define a logical page as belonging to a specific process, and is also referred to as a process number. The protection PR is data encoded to define the access right for the page, and the access right is defined in a manner shown in FIG. 9 by a combination of the values. The size bit SZ is a bit for designating a logical page size. A logical value 1 designates a 4 KB page size, and a logical value 0 designates a 1 KB page size.

ここで単一仮想記憶と多重仮想記憶の概念を図20の(A)及び(B)に基づいて説明する。多重仮想記憶とは、複数のプロセスの夫々が、論理空間の全域にわたるアドレス変換情報を有するとき、プロセス番号asidによって論理アドレスを修飾或いは拡張するというものである。これに対して、単一仮想記憶とは、複数のプロセスに論理アドレス空間の一部が排他的に割り当てられる。言い替えるならば、単一仮想記憶とは、夫々のプロセスがそれに割り当てられた論理アドレス空間のアドレス変換情報を有するとき、プロセス番号asidによって論理アドレスの修飾或いは拡張がされない。このように、単一仮想記憶においては、複数のプロセス間で、排他的に論理アドレス空間が割り当てられるため、図20の(B)に示されるように、プロセスに割り当てられた論理アドレス空間毎にそれ固有のアドレス変換情報が存在する。そのため、アドレス変換テーブルは一つ存在するだけである。当該一つのアドレス変換テーブルを用いれば、ある論理アドレスAはそれに対応される物理アドレスDに一義的に変換される。これに対して多重仮想記憶においては、複数のプロセス間で、論理アドレス空間が相互に重複して割り当てられる。そのため、プロセス毎のアドレス変換情報は相互に別々のアドレス変換テーブルに含まれなければならない。したがって、ある論理アドレスAは相互に異なるアドレス変換テーブルi,jを介することによって異なる物理アドレスB,Cに変換されることになる。このとき変換に係る論理アドレスAがどのプロセスに属するかは、プロセス番号によって識別される。図20の(A)に従えば、多重仮想記憶においてアドレス変換テーブルiはプロセス番号iに対応され、アドレス変換テーブルjはプロセス番号jに対応される。プロセス番号は、互いに同じ論理アドレス空間を使う(アクセスする)ところの複数のプロセスにおける識別番号とみなすこともできる。   Here, the concept of single virtual memory and multiple virtual memory will be described with reference to FIGS. Multiple virtual storage means that when each of a plurality of processes has address translation information over the entire logical space, the logical address is modified or expanded by the process number asid. On the other hand, in the single virtual memory, a part of the logical address space is exclusively allocated to a plurality of processes. In other words, in the single virtual memory, when each process has the address translation information of the logical address space assigned to it, the logical address is not modified or expanded by the process number asid. In this way, in a single virtual memory, a logical address space is exclusively allocated among a plurality of processes. Therefore, as shown in FIG. 20B, for each logical address space allocated to a process. There is unique address translation information. Therefore, there is only one address conversion table. If the one address conversion table is used, a certain logical address A is uniquely converted into a physical address D corresponding thereto. On the other hand, in the multiple virtual memory, logical address spaces are allocated overlappingly among a plurality of processes. For this reason, the address translation information for each process must be included in different address translation tables. Accordingly, a certain logical address A is converted into different physical addresses B and C through different address conversion tables i and j. At this time, the process number identifies the process to which the logical address A related to the conversion belongs. According to FIG. 20A, in the multiple virtual memory, the address conversion table i corresponds to the process number i, and the address conversion table j corresponds to the process number j. The process number can be regarded as an identification number in a plurality of processes that use (access) the same logical address space.

図19には、論理空間、変換情報、保護について、単一仮想記憶と多重仮想記憶との相違が示されている。この図面において、PRは、図9に示されている保護情報である。   FIG. 19 shows the difference between single virtual storage and multiple virtual storage regarding logical space, conversion information, and protection. In this drawing, PR is the protection information shown in FIG.

図7において上記TLBコントローラ5は制御回路(CTRL)50、ページテーブルエントリ上位(PTEH)レジスタ51、ページテーブルエントリ下位(PTEL)レジスタ52、変換テーブルベース(TTB)レジスタ53、TLB例外アドレス(TEA)レジスタ54、及びコントロール(MMUCR)レジスタ55を備える。後で、図22を用いて説明するように、これらのレジスタは、CPU3に結合されており、少なくともTEAレジスタ54とMMUCRレジスタ55はCPU3によって直接リード/ライト可能にされる。その他のレジスタ51〜53もCPU3によって直接アクセス可能にされている。   In FIG. 7, the TLB controller 5 includes a control circuit (CTRL) 50, a page table entry upper (PTEH) register 51, a page table entry lower (PTEL) register 52, a conversion table base (TTB) register 53, a TLB exception address (TEA). A register 54 and a control (MMUCR) register 55 are provided. As will be described later with reference to FIG. 22, these registers are coupled to the CPU 3, and at least the TEA register 54 and the MMUCR register 55 are directly readable / writable by the CPU 3. The other registers 51 to 53 are also directly accessible by the CPU 3.

図6に示されるようにPTEHレジスタ51,PTELレジスタ52はTLBミスなどにおいてTLB1のエントリを更新又は追加するためのページテーブルエントリを保有できるフィールドが備えられている。PTEHレジスタ51には、ソフトウエアの実行によって、中央処理装置3から、現在のプロセスの空間番号asidがセットされる。また、PTEHレジスタ51は、TLBミスなどが発生した場合、CPU3が出力しているTLBミスの論理ページアドレスvpnを保持する機能も兼ね備えている。CPU3が出力する論理アドレスのオフセットはCTRL50内部の図示しないラッチ回路に保持される。TTBレジスタ53には、現在のページテーブルのベースアドレスが保持されている。TEAレジスタ54は、TLBに関する例外又はアドレスエラー例外が生じた場合、そのときの論理アドレスを保持する。MMUCRレジスタ55は、アドレス変換を有効にするか無効にするかを指示するビットAT(論理値1=有効,論理値0=無効)、TLB1のフラッシングを指示するビットTF、2ビットのランダムカウンタフィールドRC、インデックスモードを指定するインデックスモードビットIX、単一仮想記憶と多重仮想記憶との何れを選択するかを指示するシングルバーチャルビットSV(SV=1で単一仮想記憶を選択,SV=0で多重仮想記憶を選択)を含む。上記インデックスモードビットIXが1の場合には、図3に示されるようにasid(4−0)即ち現在の空間番号asidのビット0〜ビット4と、中央処理装置3から出力されているところの論理ページ番号vpnのビット12〜ビット16とを利用したインデックス手法が選択される。これに対して、IXが0の場合には、図2に示されるように、中央処理装置3から出力されているところの論理ページ番号vpnのビット12〜ビット16を利用したインデックス手法が選択される。更に詳しく述べるならば、IX=1の場合におけるインデックスアドレスは、図7に示されるように、PTEHレジスタ51が保有する空間番号asidのビット0〜ビット4と、CPU3から出力されている論理ページ番号vpnのビット12〜ビット16すなわちvpn(16−12)とを入力する排他的論理和ゲートXORによって形成される。図7のセレクタ18は排他的論理和ゲートXORでハッシングされた出力又はvpn(16−12)の何れかをインデックス用アドレスとして選択する。その選択制御はインデックスモードビットIXの値にしたがって決定され、CTRL50から出力される選択信号550にて行われる。   As shown in FIG. 6, the PTEH register 51 and the PTEL register 52 are provided with a field that can hold a page table entry for updating or adding a TLB1 entry in a TLB miss or the like. The PTEH register 51 is set with the space number asid of the current process from the central processing unit 3 by execution of software. The PTEH register 51 also has a function of holding the logical page address vpn of the TLB miss output by the CPU 3 when a TLB miss occurs. The logical address offset output by the CPU 3 is held in a latch circuit (not shown) inside the CTRL 50. The TTB register 53 holds the base address of the current page table. When an exception related to TLB or an address error exception occurs, the TEA register 54 holds a logical address at that time. The MMUCR register 55 is a bit AT (logical value 1 = valid, logical value 0 = invalid) that indicates whether to enable or disable address translation, a bit TF that indicates flushing of TLB1, and a 2-bit random counter field RC, index mode bit IX for designating index mode, single virtual bit SV for indicating whether to select single virtual memory or multiple virtual memory (single virtual memory is selected with SV = 1, SV = 0 Select multiple virtual memory). When the index mode bit IX is 1, asid (4-0), that is, bits 0 to 4 of the current space number asid and the output from the central processing unit 3, as shown in FIG. An index method using bits 12 to 16 of the logical page number vpn is selected. On the other hand, when IX is 0, as shown in FIG. 2, an index method using bits 12 to 16 of the logical page number vpn output from the central processing unit 3 is selected. The More specifically, as shown in FIG. 7, the index address in the case of IX = 1 includes the bit 0 to bit 4 of the space number asid held by the PTEH register 51 and the logical page number output from the CPU 3. It is formed by an exclusive OR gate XOR which inputs bits 12 to 16 of vpn, that is, vpn (16-12). The selector 18 in FIG. 7 selects either the output hashed by the exclusive OR gate XOR or vpn (16-12) as an index address. The selection control is determined according to the value of the index mode bit IX, and is performed by a selection signal 550 output from the CTRL 50.

図7において、CPU3から出力される論理アドレスの論理ページ番号vpn(31−10)のうち、ビット12〜ビット16に相当されるvpn(16−12)は、TLB内の4個のバンク11〜14に共通なインデックスアドレス2の生成に利用される。上記のように、論理ページ番号は5ビットで表わされるため、共通なインデックスアドレス2によって、夫々のバンクにおける32個のエントリから、それぞれ一つづつが選択されて、読出される。選択される夫々のエントリは、情報として、VPN(31−17),VPN(11−10),ASID,SH,SZ,V,PPN(31−10),PR,C,Dを含む。選択され、読み出されたエントリにおける情報の内、読出されたVPN(31−17)は、コンパレータ151によって、中央処理装置3から出力されている論理アドレスのvpn(31−17)と比較され、VPN(11−10)は、コンパレータ152によって、中央処理装置3から出力されている論理アドレスのvpn(11−10)と比較され、読出されたASIDは、PTEHレジスタ51が保有する現在の空間番号asidとコンパレータ153にて比較される。比較結果に対しては制御ロジック154が、共有ステータスSH,サイズビットSZ、シングルバーチャルビットSV,及びモードビットMDの値を考慮してバンク11のミス/ヒットの判定を行う。hit1はバンク11におけるミス/ヒットの判定結果としてのヒット信号である。上記コンパレータ151〜153及び制御ロジック154は、各バンク11〜14に、それぞれ設けられている。図7ではバンク12〜14に関しては夫々のヒット信号hit2〜hit4が代表的に示されている。本実施例に従えば各コンパレータ151〜153の出力はハイレベルが一致レベルとされる。ヒット信号hit1〜hit4もハイレベルがヒットレベルとされる。制御回路50はヒット信号hit1〜hit4の何れかがヒットレベルにされることを以てTLBヒットと判定する。図7の501はTLBヒット/ミスの判定結果をCPU3に通知するTLBヒット信号である。TLBミスが発生したときには、アドレス変換バッファ1のエントリを置換する処理が行われる。この置換処理において、置換されるべきエントリの内容は、PTEHレジスタ51,PTELレジスタ52に保持され、PTEHレジスタ51,PTELレジスタ52からTLB1へ置換されるべき情報が供給され、TLB1に格納される。置換されるべきエントリを選択するためのインデックス手法は、上述のリード時におけるインデックス手法と同じであるが、どのバンク(セット)に当該エントリを格納するかはMMCCRレジスタ55のRCの値(MMUCR.RC)によって決定される。   In FIG. 7, of the logical page number vpn (31-10) of the logical address output from the CPU 3, vpn (16-12) corresponding to bit 12 to bit 16 is the four banks 11 to 11 in the TLB. 14 is used to generate an index address 2 common to 14. As described above, since the logical page number is represented by 5 bits, one is selected from each of 32 entries in each bank by the common index address 2, and is read out. Each entry selected includes VPN (31-17), VPN (11-10), ASID, SH, SZ, V, PPN (31-10), PR, C, and D as information. Of the information in the selected and read entry, the read VPN (31-17) is compared with the logical address vpn (31-17) output from the central processing unit 3 by the comparator 151. The VPN (11-10) is compared with the logical address vpn (11-10) output from the central processing unit 3 by the comparator 152, and the read ASID is the current space number held in the PTEH register 51. Asid is compared with the comparator 153. For the comparison result, the control logic 154 determines the miss / hit of the bank 11 in consideration of the values of the shared status SH, the size bit SZ, the single virtual bit SV, and the mode bit MD. hit 1 is a hit signal as a result of determination of a miss / hit in the bank 11. The comparators 151 to 153 and the control logic 154 are provided in the banks 11 to 14, respectively. In FIG. 7, the hit signals hit2 to hit4 are representatively shown for the banks 12 to 14. According to this embodiment, the outputs of the respective comparators 151 to 153 are set to the coincidence level. The hit signals hit1 to hit4 are also set to the high level. The control circuit 50 determines a TLB hit when any one of the hit signals hit1 to hit4 is set to the hit level. Reference numeral 501 in FIG. 7 denotes a TLB hit signal for notifying the CPU 3 of the TLB hit / miss determination result. When a TLB miss occurs, a process for replacing an entry in the address translation buffer 1 is performed. In this replacement process, the contents of the entry to be replaced are held in the PTEH register 51 and the PTEL register 52, and information to be replaced from the PTEH register 51 and the PTEL register 52 to the TLB1 is supplied and stored in the TLB1. The index method for selecting an entry to be replaced is the same as the index method at the time of reading described above, but the bank (set) in which the entry is stored depends on the RC value of the MMCCR register 55 (MMUCR. RC).

図21には前記制御ロジック154の論理構成の一例が示されている。1541は3入力アンドゲート、1542は2入力オアゲート、1543は2入力オアゲートである。オアゲート1542は、インデックスされたTLBエントリ(インデックスアドレスによって選択され、読み出されたエントリ)に含まれるVPN(11−10)と論理アドレスに含まれるvpn(11−10)との比較結果であるコンパレータ152の出力と上記インデックスされたTLBエントリからのサイズビットSZを入力する。サイズビットSZが1にされ、4KBの論理ページサイズが指示されている場合には、TLBミス/ヒット判定のためのアドレス比較において、TLBエントリ内のVPN(11−10)とCPU3からのvpn(11−10)との比較は行う必要がない。そのため、サイズビットSZ=1の状態では、アンドゲート1541の出力信号hit1には上記アドレスビット11,10の比較結果は反映されない。サイズビットSZが0にされ、1KBの論理ページサイズが指示された場合には、TLBミス/ヒット判定のために、アドレスビット11,10の比較動作が必要とされ、その比較結果が信号hit1に反映される。   FIG. 21 shows an example of the logical configuration of the control logic 154. Reference numeral 1541 denotes a 3-input AND gate, 1542 denotes a 2-input OR gate, and 1543 denotes a 2-input OR gate. The OR gate 1542 is a comparator that is a comparison result between the VPN (11-10) included in the indexed TLB entry (the entry selected and read by the index address) and vpn (11-10) included in the logical address. The output of 152 and the size bit SZ from the indexed TLB entry are input. When the size bit SZ is set to 1 and a logical page size of 4 KB is indicated, in the address comparison for the TLB miss / hit determination, the VPN (11-10) in the TLB entry and the vpn (CPU 3) It is not necessary to make a comparison with 11-10). Therefore, when the size bit SZ = 1, the comparison result of the address bits 11 and 10 is not reflected in the output signal hit1 of the AND gate 1541. When the size bit SZ is set to 0 and a logical page size of 1 KB is instructed, the comparison operation of the address bits 11 and 10 is required for the TLB miss / hit determination, and the comparison result is added to the signal hit1. Reflected.

前記オアゲート1543は、インデックスされたTLBエントリに含まれるプロセス番号ASIDと現在のプロセス番号(PTEHレジスタ51から出力されているプロセス番号)asidとの比較結果であるコンパレータ153の出力と、上記インデックスされたTLBエントリからの共有ビットSHとを入力する。この共有ビットSHが、1にされている場合、”プロセス間での論理ページの共有”の状態が指示されていることになる。そのため、この状態ではTLBミス/ヒット判定のためのアドレス比較において、プロセス番号間の比較が必要とされないから、共有ビットSH=1の状態では、アンドゲート1541の出力信号hit1にはプロセス番号間の比較結果は反映されない。上記インデックスにおける共有ビットSHが0にされ、”プロセス間での論理ページの非共有”の状態が指示されている場合には、TLBミス/ヒット判定のためのアドレス比較において、プロセス番号間の比較が必要とされるから、共有ビットSH=0の状態では、アンドゲート1541の出力信号hit1にはプロセス番号間の比較結果が反映される。   The OR gate 1543 includes the output of the comparator 153, which is a comparison result between the process number ASID included in the indexed TLB entry and the current process number (process number output from the PTEH register 51) asid, and the indexed The shared bit SH from the TLB entry is input. If the shared bit SH is set to 1, the state of “shared logical page between processes” is instructed. Therefore, in this state, the comparison between the process numbers is not required in the address comparison for the TLB miss / hit determination. Therefore, in the state where the shared bit SH = 1, the output signal hit1 of the AND gate 1541 includes between the process numbers. Comparison results are not reflected. When the shared bit SH in the index is set to 0 and the state of “unshared logical page between processes” is instructed, comparison between process numbers is performed in the address comparison for TLB miss / hit determination. Therefore, when the shared bit SH = 0, the output signal hit1 of the AND gate 1541 reflects the comparison result between the process numbers.

単一仮想記憶においては、TLBエントリが保有する上記プロセス番号ASIDが、メモリ保護情報(ドメイン番号)として利用される。単一仮想記憶でも多重仮想記憶でも共有ビットSHによって共有又は非共有が指示される。非共有が指示されているとき、多重仮想記憶においては現在のプロセス番号asidとTLBエントリに含まれるプロセス番号ASIDとの不一致はTLBミスとされる。これに対して、非共有が指示されているとき、単一仮想記憶においては、プロセス番号asid,ASID間の不一致は、TLBプロテクト違反例外の検出に利用される。それを実現するために、制御回路50は、アクセス権チェックのための一つの論理として、図21に示されるアンドゲート502を有する。このアンドゲート502は、前記オアゲート1543の反転出力、MMUCRレジスタからのシングルバーチャルビットSV、及び中央処理装置3内のステータスレジスタ内のモードビットMDの反転信号を受けて、TLBプロテクト違反例外の検出信号503を形成する。この検出信号503は、ハイレベルがTLBプロテクト違反例外の検出レベルである。信号503によってTLBプロテクト違反例外が検出されるのは、プロセス番号が不一致、且つ非共有の状態(オアゲート1543の出力がローレベル)で、単一仮想記憶(SV=1)、ユーザモード(MD=0)の条件が満足されたときである。即ち、単一仮想記憶において、プロセス番号が不一致、且つ非共有の場合には、実質的にTLBミスになるが、この状態をメモリ保護のためのTLBプロテクト違反例外とする。モードビットMD=1によって指示される特権状態では、別のプロセスに割り当てられている論理ページもアクセスできるようにすることが望ましいため、MD=1の特権状態においてはTLBプロテクト違反例外を検出しないようにしている。   In the single virtual memory, the process number ASID held by the TLB entry is used as memory protection information (domain number). Sharing or non-sharing is instructed by the shared bit SH in both single virtual memory and multiple virtual memory. When non-sharing is instructed, in the multiple virtual memory, a mismatch between the current process number asid and the process number ASID included in the TLB entry is regarded as a TLB miss. On the other hand, when non-sharing is instructed, in the single virtual memory, the mismatch between the process numbers asid and ASID is used for detecting a TLB protection violation exception. In order to realize this, the control circuit 50 has an AND gate 502 shown in FIG. 21 as one logic for checking the access right. The AND gate 502 receives the inverted output of the OR gate 1543, the single virtual bit SV from the MMUCR register, and the inverted signal of the mode bit MD in the status register in the central processing unit 3, and detects a TLB protection violation exception detection signal. 503 is formed. The detection signal 503 has a high level as a detection level of a TLB protection violation exception. The TLB protection violation exception is detected by the signal 503 when the process numbers do not match and are not shared (the output of the OR gate 1543 is low level), single virtual memory (SV = 1), user mode (MD = This is when the condition 0) is satisfied. That is, in the single virtual memory, when the process numbers do not match and are not shared, a TLB miss is substantially caused. This state is regarded as a TLB protection violation exception for memory protection. In the privileged state indicated by mode bit MD = 1, it is desirable to be able to access a logical page assigned to another process, so that a TLB protection violation exception is not detected in the privileged state of MD = 1. I have to.

図10は、制御回路50によるアドレス変換動作の制御を示すメインフローチャートである。この制御は、アドレス変換バッファ1のインデックス処理L1、アドレス比較とVビットのチェック処理L2、アクセス権のチェック処理L3、物理アドレスの生成処理L4に大別される。これらの処理はCPU3及びコントローラ5によって制御される。   FIG. 10 is a main flowchart showing control of the address conversion operation by the control circuit 50. This control is roughly divided into index processing L1 of the address translation buffer 1, address comparison and V-bit check processing L2, access right check processing L3, and physical address generation processing L4. These processes are controlled by the CPU 3 and the controller 5.

アドレス変換バッファ1のインデックス処理L1において、それに利用される論理アドレスは論理ページのサイズに拘わらずvpn(16−12)とされる。このインデックス処理において、利用される論理アドレスを、排他的論理和ゲートXORを用いて、空間番号asidの一部asid(4−0)でハッシングしたものをインデックス用アドレスとして使用するか否かが、MMUCRレジスタ55のIXの値(MMUCR.IX)によって決定される。図11に示されるように、MMUCR.IXが1の場合には、上記利用される論理アドレスがasid(4−0)にてハッシングされ、インデックス用アドレスとされる。これに対して、MMUCR.IXが、0の場合にはvpn(16−12)がそのままインデックス用アドレスとされる。前者のインデックス手法は図3に示され、後者のインデックス手法は図2に示される。TLB1がインデックスされると、夫々のバンク11〜14において32個のエントリから一つが選択されて読出される。選択される夫々のエントリは、情報として、VPN(31−12),VPN(11−10),ASID,SH,SZ,V,PPN(31−10),PR,C,Dを含む。   In the index processing L1 of the address translation buffer 1, the logical address used for it is set to vpn (16-12) regardless of the size of the logical page. In this index processing, whether or not to use a logical address to be used as an index address is a hashed part of the space number asid (asid (4-0)) using an exclusive OR gate XOR. It is determined by the value of IX (MMUCR.IX) in the MMUCR register 55. As shown in FIG. When IX is 1, the logical address to be used is hashed by asid (4-0) to be used as an index address. In contrast, MMUCR. When IX is 0, vpn (16-12) is used as an index address as it is. The former index method is shown in FIG. 3, and the latter index method is shown in FIG. When TLB1 is indexed, one of 32 entries is selected and read in each bank 11-14. Each entry selected includes VPN (31-12), VPN (11-10), ASID, SH, SZ, V, PPN (31-10), PR, C, and D as information.

アドレス比較とVビットのチェック処理L2において実行されるアドレス比較の手順の一例が、図12に示されている。ここに示されている手順は、図21に示されている制御ロジック154の論理に基づいているが、空間番号ASIDの比較に関してはTLBプロテクト違反例外の検出についても考慮して示されている。ヒット信号hit1〜hit4に反映されるべきアドレス比較の対象をどのようにするかは、次のようにして決められる。まず、SHが1か否によって、アドレス比較の対象として、空間番号を考慮するか否かが大別され、SZが0か否かによって、アドレス比較の対象として、VPN(11−10)を考慮するか否かが決定される。特に、単一仮想記憶(SV=1)においては、空間番号ASIDのフィールド内データをメモリ保護情報として用いるが、前述のように特権モードにおいては別のプロセスに割り当てられた論理ページも現在のプロセスからアクセスすることができるようにするため、言い換えるならば、TLBプロテクト違反例外を検出しないようにするために、単一仮想記憶であって、且つ特権モード(SV=1且つMD=1)のときには比較対象から空間番号ASIDのフィールドを除外するようにしている。   An example of the address comparison procedure executed in the address comparison and V-bit check processing L2 is shown in FIG. The procedure shown here is based on the logic of the control logic 154 shown in FIG. 21, but the comparison of the space number ASID is shown in consideration of the detection of the TLB protection violation exception. How to compare the addresses to be reflected in the hit signals hit1 to hit4 is determined as follows. First, whether or not to consider a space number as an address comparison target is broadly determined depending on whether or not SH is 1, and VPN (11-10) is considered as an address comparison target depending on whether or not SZ is 0. It is determined whether or not to do so. In particular, in the single virtual memory (SV = 1), the data in the field of the space number ASID is used as the memory protection information. As described above, in the privileged mode, the logical page assigned to another process is also the current process. In order to be able to access from, or in other words not to detect a TLB protection violation exception, when in single virtual memory and in privileged mode (SV = 1 and MD = 1) The field of the space number ASID is excluded from the comparison target.

インデックスによって、TLB1からTLBエントリがリードされ、そのリードされたTLBエントリ内の共有ステータスSHに基づいて、アドレス比較の際に空間番号ASIDを考慮するか否かが判定される。SH=1(共有)の場合、空間番号ASIDはアドレス比較の対象として考慮されず、SH=0(非共有)の場合、空間番号ASIDはアドレス比較の対象として考慮される。また、MMUCRレジスタ55のSVの値(MMUCR.SV)が1にされ、単一仮想記憶が設定されている場合であって、ステータスレジスタSRのモードビットSR.MDが1になっている場合(中央処理装置が、特権モードで動作している場合)には、空間番号ASIDはTLBプロテクト違反例外の検出には考慮されない。特権モードの性質上、別のプロセスに割り当てられている論理ページを、現在のプロセスからアクセスできるようにするためである。   Based on the index, a TLB entry is read from TLB1, and based on the shared status SH in the read TLB entry, it is determined whether or not to consider the space number ASID in the address comparison. When SH = 1 (shared), the space number ASID is not considered as an address comparison target, and when SH = 0 (non-shared), the space number ASID is considered as an address comparison target. Further, the SV value (MMUCR.SV) of the MMUCR register 55 is set to 1, and a single virtual memory is set, and the mode bit SR. When MD is 1 (when the central processing unit is operating in the privileged mode), the space number ASID is not considered in detecting the TLB protection violation exception. This is because a logical page allocated to another process can be accessed from the current process due to the nature of the privileged mode.

本実施例においては、TLBエントリ内のサイズビットSZの値に従って、1KBまたは4KBのサイズが論理ページのサイズとして選択される。論理ページのサイズが1KBの場合には、各バンクでインデックスされたそれぞれのTLBエントリ内の情報VPN(31−17)及びVPN(11−10)が、論理アドレスの対応ビットvpn(31−17),vpn(11−10)との比較対象とされる。論理ページサイズが4KBの場合には、各バンクでインデックスされたそれぞれのTLBエントリ内の情報VPNの内、VPN(11−10)と、これに対応する論理アドレスのvpn(11−10)とは比較判定の対象から除外される。   In the present embodiment, the size of 1 KB or 4 KB is selected as the size of the logical page according to the value of the size bit SZ in the TLB entry. When the size of the logical page is 1 KB, the information VPN (31-17) and VPN (11-10) in each TLB entry indexed in each bank are the corresponding bits vpn (31-17) of the logical address. , Vpn (11-10). When the logical page size is 4 KB, the VPN (11-10) and the corresponding logical address vpn (11-10) in the information VPN in each TLB entry indexed in each bank are: It is excluded from the target of comparison judgment.

上述の様にして、比較対象(VPN(31−17,11−10),vpn(31−17,11−10),ASID,asid)が定められ、比較が行われる。この比較の結果として、何れかのバンクにおいて一致すると、その一致したバンクからヒット信号が出力される。各バンクのヒットは、ヒット信号hit1〜hit4として出力され、TLBヒットとされる。これに対して、いずれのバンクからもヒット信号が出力されない場合、すなわち不一致の場合には、TLBミス例外が検出されることになる。その結果は、信号501にてCPU3にも通知され、CPU3によって、後で述べるTLBミス例外の処理が行われる。   As described above, comparison targets (VPN (31-17, 11-10), vpn (31-17, 11-10), ASID, asid) are determined, and comparison is performed. As a result of this comparison, if there is a match in any bank, a hit signal is output from the matched bank. The hits in each bank are output as hit signals hit1 to hit4 and are TLB hits. On the other hand, when no hit signal is output from any bank, that is, when there is a mismatch, a TLB miss exception is detected. The result is also notified to the CPU 3 by a signal 501, and the TLB miss exception processing described later is performed by the CPU 3.

また、インデックスされた各バンクのエントリに対しては、そのエントリ内のVビットについてのチェックも行われる。すなわち、インデックスによって、リードされたエントリ内のVビットに対してチエックが行われる。TLBヒットの場合に、ヒットに係るエントリ内のVビットが0(無効)のときは、TLBインバリッド例外が検出され、これがCPU3に通知される。この例外処理の内容は後述する。TLBミスの場合におけるVビットの判定結果はTLBミスに係る後述のエントリリプレースにて利用される。   In addition, for each indexed entry in the bank, the V bit in the entry is also checked. That is, a check is performed on the V bit in the read entry by the index. In the case of a TLB hit, if the V bit in the entry related to the hit is 0 (invalid), a TLB invalid exception is detected and notified to the CPU 3. The contents of this exception processing will be described later. The determination result of the V bit in the case of the TLB miss is used in the entry replacement described later related to the TLB miss.

アクセス権のチェック処理L3においては、インデックスによりリードされたTLBエントリ内の情報PRの内容と、MMUCRレジスタ内のビットMMUCR.SVの内容とに従ってアクセス権がチェックされる。例えば図13に示されるように、先ず、MMUCRレジスタ内のビットMMUCR.SVが、1(単一仮想記憶)か、0(多重仮想記憶)かの判定が行われる。多重仮想記憶の場合(SV=0)には、図9に示したPRの内容にしたがって、TLBエントリ内の情報で表されるアドレス空間のプロテクションが行われる。単一仮想記憶で、かつ特権モードにされている場合、すなわちMMUCR.SV=1(単一仮想記憶)で、ステータスレジスタ内のビットSR.MD=1(特権モード)の場合には、TLBエントリ内の情報で表されるアドレス空間を、無条件にアクセスすることができる。これに対して、単一仮想記憶であっても、ユーザモードの場合(SR.MD=0:ユーザモード)には、アクセス権のチエックに際して、空間番号ASIDと共有ステータスSHが考慮される。すなわち、アクセス時のPTEHレジスタ51の空間番号asidとTLB1からリードされた空間番号ASIDとが一致する場合又はSH=1(共有)の場合には、上記PRにしたがって、TLBエントリ内の情報で表されるアドレス空間のプロテクションが行われる。これに対して、プロセス番号が不一致で、且つ非共有の場合にはTLBプロテクト違反例外が検出される。当該例外の内容については後述する。更にアクセス権のチェック処理L3においては、アクセスがリードのためのものかライトのためのものかのアクセスタイプ判定と、TLB1からリードしたエントリのDビットの判定が行われる。アクセスが、初めてのライト(例えば、電源投入やリセットの後の初めてのライトアクセス)の場合には、TLBイニシャルページライト例外が検出される。即ち、TLBイニシャルページライト例外は、論理アドレスとインデックスされたTLBエントリとの比較結果がTLBヒットであって、TLBエントリ内のダーティビットDが0とされ、そのときのアクセスがライトアクセスである条件によって検出される。このTLBイニシャルページライト例外処理の内容については後述する。   In the access right check processing L3, the contents of the information PR in the TLB entry read by the index and the bits MMUCR. The access right is checked according to the contents of the SV. For example, as shown in FIG. 13, first, the bits MMUCR. It is determined whether the SV is 1 (single virtual memory) or 0 (multiple virtual memory). In the case of multiple virtual storage (SV = 0), the address space represented by the information in the TLB entry is protected according to the contents of the PR shown in FIG. When in single virtual memory and in privileged mode, ie MMUCR. When SV = 1 (single virtual memory), bits SR. When MD = 1 (privileged mode), the address space represented by information in the TLB entry can be accessed unconditionally. On the other hand, even in the case of a single virtual memory, in the case of the user mode (SR.MD = 0: user mode), the space number ASID and the shared status SH are considered when checking the access right. That is, when the space number asid of the PTEH register 51 at the time of access matches the space number ASID read from TLB1, or when SH = 1 (shared), it is represented by the information in the TLB entry according to the PR. Address space protection is performed. In contrast, if the process numbers do not match and are not shared, a TLB protection violation exception is detected. The contents of the exception will be described later. Further, in the access right check process L3, an access type determination is made as to whether the access is for reading or writing, and the D bit of the entry read from the TLB 1 is determined. If the access is the first write (for example, the first write access after power-on or reset), a TLB initial page write exception is detected. That is, the TLB initial page write exception is a condition in which the comparison result between the logical address and the indexed TLB entry is a TLB hit, the dirty bit D in the TLB entry is 0, and the access at that time is a write access. Detected by. The contents of this TLB initial page write exception process will be described later.

物理アドレスの生成処理L4においては、インデックスされたTLBエントリのサイズビットSZにしたがって、図14のように物理アドレスが生成される。物理アドレスpaを形成するために使われる論理アドレスvaのオフセットva(9−0)は、図に示されていないが、制御回路(CTRL)50内のラッチ回路に保持されている。SZ=0(論理ページサイズが1KB)のときは、CPU3から出力されている論理アドレスvaのオフセットva(9−0)が物理アドレスpaのオフセットpa(9−0)とされる。すなわち、ヒットしたTLBエントリのデータ部に含まれる物理ページ番号PPNの全ビットPPN(31−10)が物理ページアドレスpa(31−10)とされ、これにオフセットとしてアドレス(9ー0)が下位側に付加されて、物理アドレスpaが生成される。SZ=1(論理ページサイズが4KB)のときは、CPU3から出力されている論理アドレスvaのオフセットva(11−0)が物理アドレスpaのオフセットpa(11−0)とされる。ヒットしたTLBエントリ内のデータ部に含まれる物理ページ番号PPNの内、下位2ビットが無視されたPPN(31−12)が物理ページアドレスpa(31−12)とされ、オフセットとしてのアドレス(11ー0)が下位側に付加されて、物理アドレスpaが生成される。   In the physical address generation process L4, a physical address is generated as shown in FIG. 14 in accordance with the size bit SZ of the indexed TLB entry. The offset va (9-0) of the logical address va used to form the physical address pa is not shown in the figure, but is held in a latch circuit in the control circuit (CTRL) 50. When SZ = 0 (logical page size is 1 KB), the offset va (9-0) of the logical address va output from the CPU 3 is set as the offset pa (9-0) of the physical address pa. That is, all bits PPN (31-10) of the physical page number PPN included in the data part of the hit TLB entry are set as the physical page address pa (31-10), and the address (9-0) is subordinate to this as an offset. The physical address pa is generated. When SZ = 1 (logical page size is 4 KB), the offset va (11-0) of the logical address va output from the CPU 3 is set as the offset pa (11-0) of the physical address pa. Of the physical page number PPN included in the data part in the hit TLB entry, PPN (31-12) in which the lower 2 bits are ignored is set as the physical page address pa (31-12), and an address (11 as an offset) -0) is added to the lower side, and the physical address pa is generated.

図15には、アドレス比較とVビットのチェック処理L2において検出されたTLBミス例外におけるリプレース対象バンクのハードウェア指定手法が示されている。この制御は制御回路50がその論理構成に従って一義的に行うものであり、MMUCRレジスタのビットMMUCR.RCをランダムカウンタのような計数手段として利用する。ここで、MMUCR.RCのビット数の2のべき乗数が、上記TLB1のバンクの数(=4)に一致される。制御回路50は、上記ヒット信号hit1〜hit4のいずれもがヒット状態を示さないことに応答して、TLBミスによるTLB1に対するエントリの置換が必要と判断する。このように判断すると、制御回路50は、MMUCR.RCを1インクリメント(+1)し、インデックスされた4個のエントリの中に、無効なエントリが有るか否かを調べる。これは、インデックスされた4個のエントリのそれぞれにおけるVビットを調べることによって達成される。Vビットを調べた結果として、無効なエントリがない(インデックスされた各バンクのエントリは、全て有効なデータ”V=1”を保持している)場合には、そのインクリメントされた結果を置換すべきバンク番号とし、MMUCR.RCに対してはノー・オペレーションとする。無効なエントリが存在する(各バンクでインデックスされた何れかのエントリが、V=0を示し、有効なデータを保持していない)場合には、無効なエントリを有するバンクのバンク番号をMMUCR.RCにセットし、且つセットされた番号のバンクを置換すべきバンクとする。また、上記MMUCR.RCの各ビットは、CPU3によるソフトウェアの実行によって、任意にその値を変更することが可能である。そのため、上述の様にして、このレジスタに設定されたバンク番号を、更に、ソフトウエアによって変更することもできる。そのため、任意のバンクをリプレースの対象にすることができる。   FIG. 15 shows a hardware designation method of the replacement target bank in the TLB miss exception detected in the address comparison and V-bit check processing L2. This control is uniquely performed by the control circuit 50 according to the logical configuration, and the bits MMUCR. RC is used as a counting means such as a random counter. Here, MMUCR. The power of 2 of the number of bits of RC is matched with the number of banks of TLB1 (= 4). In response to the fact that none of the hit signals hit1 to hit4 indicates a hit state, the control circuit 50 determines that it is necessary to replace the entry for TLB1 due to a TLB miss. If it judges in this way, the control circuit 50 will carry out MMUCR. RC is incremented by 1 (+1), and it is checked whether or not there is an invalid entry in the indexed four entries. This is accomplished by examining the V bit in each of the four indexed entries. As a result of examining the V bit, if there is no invalid entry (all the entries in each indexed bank hold valid data “V = 1”), the incremented result is replaced. Power bank number and MMUCR. No operation for RC. When an invalid entry exists (any entry indexed in each bank indicates V = 0 and does not hold valid data), the bank number of the bank having the invalid entry is set to MMUCR. Set to RC, and the bank with the set number is the bank to be replaced. In addition, the above MMUCR. The value of each bit of RC can be arbitrarily changed by execution of software by the CPU 3. Therefore, as described above, the bank number set in this register can be further changed by software. Therefore, any bank can be a target for replacement.

図16には、上記TLBミス例外に対処するために、TLBエントリを更新するためのTLBミスハンドラによる処理手順が示されている。TLB1のエントリの更新にはロードTLBインストラクションが利用される。このロードTLBインストラクション(LDTLBとも表す)が、CPU3によって実行されることにより、次の処理が行われる。すなわち、PTEH,PTELの各レジスタ51,52の値を、TLB1のエントリへ書き込む処理が行われる。この場合、書き込み対象のエントリは、特に制限されないが、MMUCR.RCにセットされているバンク番号により指示されるバンク内のエントリであって、PTEHレジスタ51内に保持されている論理アドレス(ビット12ービット16)をインデックスアドレスとして指示されるエントリである。上記TLBミス例外が検出されると、CPU3から出力されているところの、その時の論理アドレスの一部(ビット10からビット31)は、上記PTEHレジスタ51に保持される。これにより、TLBミス例外が発生した時のインデックスアドレスと同じ値のインデックスアドレスによって、リプレースの際のエントリが指示される。但し、リプレースに使われるバンクは、MMUCR.RCにセットされているバンク番号によって決定されることになる。   FIG. 16 shows a processing procedure by the TLB miss handler for updating the TLB entry in order to deal with the TLB miss exception. The load TLB instruction is used to update the TLB1 entry. The load TLB instruction (also referred to as LDTLB) is executed by the CPU 3, whereby the following processing is performed. That is, processing for writing the values of the registers 51 and 52 of PTEH and PTEL into the entry of TLB1 is performed. In this case, the entry to be written is not particularly limited, but MMUCR. This is an entry in the bank indicated by the bank number set in RC, and is indicated by using the logical address (bit 12 to bit 16) held in the PTEH register 51 as an index address. When the TLB miss exception is detected, a part of the logical address (bit 10 to bit 31) output from the CPU 3 is held in the PTEH register 51. Thereby, the entry at the time of replacement is instructed by the index address having the same value as the index address when the TLB miss exception occurs. However, the bank used for replacement is MMUCR. It is determined by the bank number set in RC.

TLBミス例外に対処するために、図22に示されている様な外部メモリRAMに、予め、ページテーブルが、ユーザによって形成される。このページテーブルには、特に制限されないが、複数の論理アドレスに各々対応した複数の変換情報(ページテーブルエントリ)が、所定の規則にしたがって、格納される。このページテーブルのアドレス、例えば、その開始アドレスは、ベースアドレスとして、レジスタTTB53に、予め格納される。このページテーブルは、特に制限されないが、開始アドレスとしての上記ベースアドレスと論理アドレスとに基づいて、当該論理アドレスに対応したページテーブルエントリ(対応する物理ページ番号ppn、バリッドビットv、プロテクションビットpr、サイズビットsz、キャッシャブルビットc、ダーテイビットd、ステータスshを含む)を検索することができるような規則で、複数の論理アドレスに各々対応した複数のページテーブルエントリが、配置されている。   In order to cope with the TLB miss exception, a page table is formed in advance in the external memory RAM as shown in FIG. In the page table, although not particularly limited, a plurality of pieces of conversion information (page table entries) respectively corresponding to a plurality of logical addresses are stored according to a predetermined rule. The page table address, for example, its start address is stored in advance in the register TTB 53 as a base address. The page table is not particularly limited, but based on the base address and logical address as the start address, a page table entry corresponding to the logical address (corresponding physical page number ppn, valid bit v, protection bit pr, A plurality of page table entries respectively corresponding to a plurality of logical addresses are arranged in accordance with a rule such that a size bit sz, a cacheable bit c, a dirty bit d, and a status sh can be searched.

上記TLBミスハンドラは、ユーザによって、記述される。TLBミス例外が検出されると、CPU3によって、このTLBミスハンドラが起動される。これにより、PTEHレジスタ51にはTLBミス発生時の論理アドレスの情報vpn(10ー31)が格納される。この時に、PTEHレジスタ51には、TLBミス発生時の空間番号asidも格納されるようにしても良い。また、CPU3は、レジスタTTB53に格納されているベースアドレスと、TLBミス発生時の論理アドレスとを用いて、外部メモリ上の上記ベーステーブルを検索する。この検索によって、TLBミス発生時の論理アドレスに対応するページテーブルエントリが、発見されると、この発見されたページテーブルエントリの内容は、PTELレジスタ52にロードされる。次いで、ロードTLBインストラクションが発行されてPTEH,PTELの各レジスタ51,52の値によってTLB1のエントリが更新される。従って、PTEHレジスタ51に保持されているところの、TLBミス発生時の論理アドレスの情報vpn,asidは、TLBエントリの一部VPN,ASIDとして採用されることになる。また、この時、リプレースされるエントリは、上記したように、、MMUCR.RCにセットされているバンク番号によって指示されているバンク内のエントリであって、TLBミス発生時のインデックスアドレスと同じインデックスアドレスによって指示されるエントリである。   The TLB miss handler is described by the user. When a TLB miss exception is detected, this TLB miss handler is activated by the CPU 3. As a result, the logical address information vpn (10-31) when the TLB miss occurs is stored in the PTEH register 51. At this time, the PTEH register 51 may also store the space number asid when the TLB miss occurs. Further, the CPU 3 searches the base table in the external memory using the base address stored in the register TTB 53 and the logical address when the TLB miss occurs. When a page table entry corresponding to the logical address at the time of occurrence of the TLB miss is found by this search, the contents of the found page table entry are loaded into the PTEL register 52. Next, a load TLB instruction is issued, and the entry of TLB 1 is updated with the values of the registers 51 and 52 of PTEH and PTEL. Accordingly, the logical address information vpn and asid held in the PTEH register 51 at the time of occurrence of the TLB miss is adopted as a part of VPN and ASID of the TLB entry. At this time, the entry to be replaced is MMUCR. This is an entry in the bank indicated by the bank number set in RC and indicated by the same index address as the index address when a TLB miss occurs.

上記TLBインバリッド例外は、TLBヒットにおけるページフォルトの場合に発生する。この例外に対しては、例えば、先ず、外部メモリ上のページテーブルエントリを回復し、そのページテーブルエントリ内のVビットを論理値1にする。この後、当該ページテーブルエントリを外部メモリからPTELレジスタ52にロードし、上述のロードTLBインストラクションを発行して、PTEH,PTELの各レジスタ51,52の値によってTLB1の該当エントリを更新する。   The TLB invalid exception occurs in the case of a page fault in a TLB hit. For this exception, for example, first, the page table entry in the external memory is recovered, and the V bit in the page table entry is set to the logical value 1. Thereafter, the page table entry is loaded from the external memory into the PTEL register 52, the above-described load TLB instruction is issued, and the corresponding entry of TLB1 is updated with the values of the registers 51 and 52 of PTEH and PTEL.

上記TLBイニシャルページライト例外については、それが検出されると、外部メモリ上の対応するページテーブルエントリのDビットを論理値1にし、当該ページテーブルエントリを外部メモリからPTELレジスタ52にロードした後、上述のロードTLBインストラクションを発行してPTEH,PTELの各レジスタ51,52の値によってTLB1の該当エントリを更新する。尚、例外要因とされた論理アドレスの情報vpn,asidはPTEHレジスタ51に保持されている。D=1にされるべき状況は、メインメモリ上の物理ページ領域に最初に書込みが行われるときに発生される。仮想記憶において、ページ入れ換えの際に補助記憶装置とメインメモリ(例えば図22の外部メモリ)相互間でのデータの整合を図るため、メインメモリの入れ換え対象ページの内容を補助記憶装置にコピーバックするか否かの判定が必要とされる。ダーティービットDは、この判定のために、利用される。   When the TLB initial page write exception is detected, the D bit of the corresponding page table entry on the external memory is set to the logical value 1, and the page table entry is loaded from the external memory to the PTEL register 52. The above-described load TLB instruction is issued, and the corresponding entry of TLB 1 is updated with the values of the registers 51 and 52 of PTEH and PTEL. Note that the logical address information vpn and asid that are the exception factors are held in the PTEH register 51. The situation to be set to D = 1 occurs when the physical page area on the main memory is first written. In the virtual storage, in order to match data between the auxiliary storage device and the main memory (for example, the external memory in FIG. 22) at the time of page replacement, the contents of the page to be replaced in the main memory are copied back to the auxiliary storage device. Whether or not is required. The dirty bit D is used for this determination.

上記TLBプロテクト違反例外が検出されると、例外要因とされる論理アドレスの論理ページ番号vpnがPTEHレジスタ51に、そしてその論理アドレスがTEAレジスタ54に書き込まれた後に、そのプロテクト違反を解決するためのハンドラが起動される。   When the TLB protection violation exception is detected, in order to resolve the protection violation after the logical page number vpn of the logical address as the exception cause is written in the PTEH register 51 and the logical address is written in the TEA register 54. The handler is started.

上記のように、MMUCR.RCをカウンタとして使う場合、上記のTLBミス例外の対策の際には、新たなバンクへエントリを登録することができるようにするために、上記のようにインクリメントすることが望ましい。これに対して、上記TLBインバリッド例外、上記TLBイニシャルページライト例外及び上記TLBプロテクト違反例外の対策においては、MMUCR.RCをインクリメントしないことが望ましい。これらの対策においては、Dビット、或いはVビットの変更だけが必要な場合があり、新たなバンクに登録せずに、元のバンクに登録するようにしたほうが、TLBを有効に使えるためである。勿論、本発明は、このようにすることに制限されるものではない。   As mentioned above, MMUCR. When RC is used as a counter, it is desirable to increment as described above so that an entry can be registered in a new bank when the TLB miss exception is taken. On the other hand, in the countermeasure against the TLB invalid exception, the TLB initial page write exception, and the TLB protection violation exception, the MMUCR. It is desirable not to increment RC. In these measures, there is a case where only the D bit or V bit needs to be changed, so that it is possible to use the TLB more effectively by registering in the original bank without registering in the new bank. . Of course, the present invention is not limited to this.

図17及び図18には、MMUCRレジスタのビットMMUCR.SVを0にセットして、多重仮想記憶を指示した場合におけるTLB1に関する例外検出フローの全体が示されている。図17に従えば、論理アドレスのvpnや現在の空間番号asidに従って所定の手法でTLB1のインデックスが行われる(S1)。これによってインデックスされたエントリがSH=0(非共有)を含む場合、ASIDまたはVPNが不一致であれば(S3)、TLBミス例外(EX1)が検出される。インデックスされたエントリがSH=1(共有)を含む場合には、ASIDは比較されずVPNが不一致であれば(S4)、TLBミス例外(EX1)が検出される。TLBヒットの場合(S3,S4のYES)には、V=1か否かが判定される(S5)。V=0(インバリッド)であれば、TLBインバリッド例外(EX2)が検出される。V=1(バリッド)の場合には、図18に示されるように、ステータスレジスタのビットSR.MDからユーザモード(User)か特権モード(Privileged)かが判定される(S6)。CPU3がユーザモードで動作しており、このモードで動作しているCPU3によるアクセスによってリードされたところのエントリが、特権モードでのアクセスを許容すること(ユーザモードでのアクセスの禁止)を示す情報PRを有している場合(PR=00又は01)、TLBプロテクト違反例外(EX3)が検出される。また、ユーザモードでのアクセスにより、リードされたエントリ内の情報PRが、10であると判定された場合、このアクセスが、リードのアクセスタイプかライトのアクセスタイプかが更に判定される。図9に示されているように、情報PRが、10の場合、ユーザアクセスは、リードのアクセスタイプのみが許容される。そのため、上記アクセスが、ライトのアクセスタイプで有る場合には、アクセスタイプが相違される(S7のwrite)ため、TLBプロテクト違反例外(EX3)が検出される。   17 and 18 show the bits MMUCR. The entire exception detection flow related to TLB1 when SV is set to 0 and multiple virtual storage is instructed is shown. According to FIG. 17, the index of TLB1 is performed by a predetermined method according to the logical address vpn and the current space number asid (S1). If the indexed entry includes SH = 0 (non-shared), if the ASID or VPN does not match (S3), a TLB miss exception (EX1) is detected. If the indexed entry contains SH = 1 (shared), the ASID is not compared and if the VPNs do not match (S4), a TLB miss exception (EX1) is detected. In the case of a TLB hit (YES in S3 and S4), it is determined whether or not V = 1 (S5). If V = 0 (invalid), a TLB invalid exception (EX2) is detected. When V = 1 (valid), as shown in FIG. It is determined from the MD whether the user mode (User) or the privileged mode (Privileged) (S6). Information indicating that the CPU 3 is operating in the user mode and that the entry read by the access by the CPU 3 operating in this mode permits access in the privileged mode (access prohibition in the user mode). If it has PR (PR = 00 or 01), a TLB protection violation exception (EX3) is detected. When it is determined that the information PR in the read entry is 10 by access in the user mode, it is further determined whether this access is a read access type or a write access type. As shown in FIG. 9, when the information PR is 10, only the read access type is allowed for user access. For this reason, when the access is the write access type, the access type is different (write in S7), and therefore the TLB protection violation exception (EX3) is detected.

特権モードでのアクセスにおいてもPR=00又は10が判定された場合、リード/ライトのアクセスタイプがPRの内容に対して反している(S8のwrite)と、TLBプロテクト違反例外(EX4)が検出される。すなわち、CPU3が、ユーザモードで動作しているか、特権モードで動作しているかにより、PRにより許容されるアクセス権は、異なるが、何れの場合であっても、PRにより許容される以外のアクセスタイプでアクセスをした場合には、TLBプロテクト違反例外(EX3,4)が検出される。アクセスタイプが、PRによって許容されたライト(S9,S10のwrite)である場合、エントリ内の情報Dが、0(未書込みのページ)ならば、TLBイニシャルライト例外(EX5)が検出される。また、エントリ内の情報Dが、1の場合、エントリ内の情報Cが、1ならば、キャッシュメモリ4がアクセスされ、C=0ならばメインメモリ(例えば、図22の外部メモリRAM,ROM)がアクセスされることになる。アクセスタイプが、PRによって許容されたリード(S7〜S10のread)である場合には、C=1ならばキャッシュメモリ4がアクセスされ、C=0のときはメインメモリがアクセスされることになる。   If PR = 00 or 10 is also determined in the access in the privileged mode, a TLB protection violation exception (EX4) is detected if the read / write access type is contrary to the PR contents (write in S8). Is done. That is, the access right permitted by the PR differs depending on whether the CPU 3 is operating in the user mode or the privileged mode, but in any case, access other than that permitted by the PR is allowed. When accessing by type, a TLB protection violation exception (EX3, 4) is detected. When the access type is a write permitted by PR (write of S9 and S10), if the information D in the entry is 0 (unwritten page), a TLB initial write exception (EX5) is detected. When the information D in the entry is 1, if the information C in the entry is 1, the cache memory 4 is accessed, and if C = 0, the main memory (for example, the external memory RAM or ROM in FIG. 22). Will be accessed. When the access type is a read permitted by PR (read of S7 to S10), if C = 1, the cache memory 4 is accessed, and if C = 0, the main memory is accessed. .

図22には、図7に示した各レジスタと中央処理装置CPUとの接続関係が主に示されている。上記各レジスタには、それぞれ固有のアドレスが割り当てられている。中央処理装置CPU3により形成された論理アドレスは、内部論理アドレスバスVABUSを介して、制御回路(TLBC)50内の選択回路に供給される。この選択回路は、上記論理アドレスをデコードし、論理アドレスが、レジスタに割り当てられた固有のアドレスであった場合、レジスタを選択するための選択信号を形成する。例えば、論理アドレスが、PTELレジスタ52に割り当てられたアドレスであった場合、選択回路は、選択信号C4を形成して、該レジスタを選択する。同様にして、他のレジスタ(PTEH,MMUCR,TEA,TTB)の選択も行われる。言い替えるならば、これらのレジスタは、アドレスマップされている。選択されたレジスタに対する、中央処理装置からのリード/ライトは、図示されていない内部制御バスを介して、中央処理装置から各レジスタへ供給されるリード/ライト制御信号によって、指示される。勿論、この図面に示されているように、各レジスタと中央処理装置CPU3とは、内部データバスDBUSを介して互いに接続されている。各レジスタは、図7に示した制御回路50及びTLB1とも接続されているが、図面が複雑になるのを避けるため、図22には示されていない。中央処理装置は、ソフトウエアを実行することにより、レジスタにデータを書き込むことができる。すなわち、ソフトウエアの実行により、中央処理装置は、レジスタに割り当てられた論理アドレスをバスVABUSへ出力し、データをバスDBUSへ出力し、リード/ライト制御信号でライトを指示することにより、レジスタへデータを書き込むことができる。同様に、ソウトウエアの実行によって、中央処理装置3は、レジスタからデータを読み出すことも可能である。このようにソウフトウエアの実行により、PTEHレジスタ51に対しては、論理空間番号、TLBミスの際の論理アドレスを書き込むことが可能であり、PTELレジスタ52に対しては、リプレースの際のテーブルエントリを書き込むことが可能であり、TTBレジスタ53に対しては、ベースアドレスを、TEAレジスタ54に対しては、プロテクト違反例外の際に論理アドレスを書き込むことが可能である。また、MMUCRレジスタ55に対しては、図6に示されている種々の制御データを書き込むことが可能であり、特定のビットをカウンタの様に使うこともできる。   FIG. 22 mainly shows the connection relationship between each register shown in FIG. 7 and the central processing unit CPU. Each register is assigned a unique address. The logical address formed by the central processing unit CPU3 is supplied to the selection circuit in the control circuit (TLBC) 50 via the internal logical address bus VABUS. The selection circuit decodes the logical address, and when the logical address is a unique address assigned to the register, generates a selection signal for selecting the register. For example, when the logical address is an address assigned to the PTEL register 52, the selection circuit forms the selection signal C4 and selects the register. Similarly, other registers (PTEH, MMUCR, TEA, TTB) are also selected. In other words, these registers are address mapped. The read / write from the central processing unit to the selected register is instructed by a read / write control signal supplied from the central processing unit to each register via an internal control bus (not shown). Of course, as shown in this drawing, each register and the central processing unit CPU3 are connected to each other via an internal data bus DBUS. Each register is also connected to the control circuit 50 and TLB 1 shown in FIG. 7, but is not shown in FIG. 22 to avoid complicating the drawing. The central processing unit can write data to the register by executing software. That is, by executing the software, the central processing unit outputs the logical address assigned to the register to the bus VABUS, outputs the data to the bus DBUS, and instructs the write by the read / write control signal. Data can be written. Similarly, the central processing unit 3 can read data from the register by executing the software. As described above, by executing the software, the logical space number and the logical address at the time of TLB miss can be written to the PTEH register 51, and the table entry at the time of replacement is written to the PTEL register 52. The base address can be written to the TTB register 53, and the logical address can be written to the TEA register 54 when a protection violation exception occurs. Various control data shown in FIG. 6 can be written into the MMUCR register 55, and specific bits can be used like a counter.

内部論理アドレスバスVABUSは、制御回路(CTRL)50、TLB1にも接続されている。制御回路(CTRL)50には、上記したように論理アドレスのオフセットを保持するためのラッチ回路が設けられており、内部論理アドレスバスVABUSからの論理アドレスのオフセットが保持される。また、この内部論理アドレスバスVABUSを介して、CPU3から論理アドレスが、TLB1に供給され、インデックスアドレス、検索用のアドレスとして使われる。勿論、制御回路(CTRL)50に設けられる上記ラッチ回路は、オフセットアドレスだけでなく、論理アドレスの全てを保持する様にしても良い。   The internal logical address bus VABUS is also connected to the control circuit (CTRL) 50 and TLB1. The control circuit (CTRL) 50 is provided with a latch circuit for holding the offset of the logical address as described above, and holds the offset of the logical address from the internal logical address bus VABUS. Further, a logical address is supplied from the CPU 3 to the TLB 1 via the internal logical address bus VABUS, and is used as an index address and a search address. Of course, the latch circuit provided in the control circuit (CTRL) 50 may hold not only the offset address but all the logical addresses.

この図面には、上記PTEHレジスタ51と上記TLB1との接続だけが、明示的に示されている。TLB1のミス/ヒットの判定のための空間番号は、このレジスタにセットされ、このレジスタから上記TLB1へ供給される。また、TLB1のミス例外についての対策においても、このレジスタから、上記したように論理アドレス等が上記TLB1へ供給される。   In the drawing, only the connection between the PTEH register 51 and the TLB 1 is explicitly shown. The space number for determining the TLB1 miss / hit is set in this register and supplied to the TLB1 from this register. Also, as a countermeasure against the TLB1 miss exception, a logical address or the like is supplied from the register to the TLB1 as described above.

内部データバスDBUS及び内部物理アドレスバスPABUSは、このデータ処理装置に設けられた外部端子TD及びTAを介して、外部データバスDBUS及び外部アドレスバスABUSに接続される。これらの外部バスには、例えば、同図に示されている様に、外部メモリRAM,ROMが接続される。特に制限されないが、外部メモリRAMは、揮発性メモリであり、上記したような種々のテーブル等が形成される。また、外部メモリROMは、不揮発性のメモリであり、種々のプログラム(例えば、上記したハンドラ等のソフトウエア)を格納している。   The internal data bus DBUS and the internal physical address bus PABUS are connected to the external data bus DBUS and the external address bus ABUS via external terminals TD and TA provided in the data processing device. For example, as shown in the figure, external memory RAM and ROM are connected to these external buses. Although not particularly limited, the external memory RAM is a volatile memory, and various tables as described above are formed. The external memory ROM is a non-volatile memory, and stores various programs (for example, software such as the above-described handler).

以下においては、本実施例のマイクロコンピュータにおける仮想記憶の作用効果をその特徴点毎に説明する。   In the following, the effect of virtual memory in the microcomputer of this embodiment will be described for each feature point.

《複数ページサイズのサポート》 図5及び図6に示されるように、ページテーブルエントリ及びTLBエントリは、上記サイズビットSZを有し、論理ページのサイズが、ページ毎に設定可能とされる。4ウェイ・セットアソシアティブ形式のアドレス変換バッファ1は、そのサイズが可変に設定可能にされる複数の論理ページに対して共通利用される。本実施例では、マイクロコンピュータがサポートする論理ページサイズは1KBと4KBの2種類とされる。そしてTLB1に対するインデックス用アドレスの指定方法は、4KBと1KBの双方において共通化されおり、本実施例においては、図2及び図3に示されるように中央処理装置3で形成される全部で32ビットの論理アドレスの内、ビット12〜ビット16即ちvpn(16−12)がTLB1のインデックスに利用される。インデックスアドレスは5ビットであるから1バンク(ウエイ)当たり最大32個のエントリを保有できる。TLB1は4個のバンク11〜14を持つから、一つのインデックスアドレスにつき、最大4個のエントリを保有できる。上記インデックスアドレスは、ページサイズが4KBの場合には当該論理ページ番号vpnの最下位から5ビットvpn(16−12)とされるので、ページサイズ4KBのときは、任意の論理ページ番号のエントリを各バンクに最大32エントリ(全体で128エントリ)保有することができる。一方、ページサイズが1KBの場合、当該論理ページ番号vpnの最下位から2ビットvpn(11−10)はインデックスに利用されない。このため、論理ページサイズが1KBで、バンクの数が一つの場合におけるインデックスを考えると、インデックスされたエントリは、5ビットのインデックスアドレスによって選ばれた4個の論理ページ番号(それぞれが1KBのページサイズを持つ)の内のいずれかを指す。インデックスに利用されない2ビット(ビット10,11)は、この選ばれた4個の論理ページ番号の内の何れか一つを指すために使われるものである。したがって、バンクの数が1個しか存在しない場合には、連続する4個の論理ページに対して、1個しかエントリが割り当てられない。本実施例においては、論理ページの最大サイズが最小サイズに対して2のN乗倍とされ、バンクの数も2のN乗個設けられている。すなわち、論理ページサイズの最小サイズは1KBとされ、最大サイズは、その2の2乗倍である4KBとされ、バンク数は2の2乗個である数(4個)設けられている。このようにすることにより、4KBページサイズの場合とほぼ同様に、アドレス変換バッファ1には、全体としては1KBページサイズの、任意論理ページ番号のエントリを、128個保有することができる。但し、一つのバンクに保有できるエントリの論理ページ番号は4KB毎という制約を受ける。この制限は、アドレス変換バッファ1の保有するエントリの論理ページ番号が連続的であれば、TLB1のヒット率には何等影響を与えない。分散的である場合にはある程度ヒット率に影響を受ける。この場合でも、1KBの論理ページを2KB毎にアドレスマッピングすればその影響を小さくでき、4KB毎にアドレスマッピングすれば全く影響を受けないようにすることができる。例えば、1KBページサイズの変換情報をアドレス変換バッファ1へ設定する(書き込む)際、4個のバンク11,12,13,14のそれぞれから、5ビットのインデックスアドレスによって指示される4個のエントリに、2ビットvpn(11−10)が”00”のときの変換情報、2ビットvpn(11−10)が”01”のときの変換情報、2ビットvpn(11−10)が”10”のときの変換情報、2ビットvpn(11−10)が”11”のときの変換情報を、各々設定する。このようにすれば、ヒット率の低下を防ぐことが可能となる。   << Support of Multiple Page Sizes >> As shown in FIGS. 5 and 6, the page table entry and the TLB entry have the size bit SZ, and the size of the logical page can be set for each page. The 4-way set associative address translation buffer 1 is commonly used for a plurality of logical pages whose size can be set variably. In this embodiment, there are two types of logical page sizes supported by the microcomputer: 1 KB and 4 KB. The index address designation method for TLB 1 is common to both 4 KB and 1 KB. In this embodiment, as shown in FIG. 2 and FIG. 3, the total number of bits formed by the central processing unit 3 is 32 bits. Of these logical addresses, bits 12 to 16, that is, vpn (16-12) are used for the index of TLB 1. Since the index address is 5 bits, a maximum of 32 entries can be held per bank (way). Since the TLB 1 has four banks 11 to 14, a maximum of four entries can be held for one index address. When the page size is 4 KB, the index address is 5 bits vpn (16-12) from the lowest order of the logical page number vpn. Therefore, when the page size is 4 KB, an entry of an arbitrary logical page number is set. Each bank can have a maximum of 32 entries (128 entries in total). On the other hand, when the page size is 1 KB, the least significant 2 bits vpn (11-10) of the logical page number vpn are not used for the index. Therefore, considering an index in the case where the logical page size is 1 KB and the number of banks is one, the indexed entry has four logical page numbers selected by a 5-bit index address (each is a page of 1 KB). Size). Two bits (bits 10 and 11) not used for the index are used to indicate any one of the four selected logical page numbers. Therefore, when there is only one bank, only one entry is assigned to four consecutive logical pages. In this embodiment, the maximum size of the logical page is set to 2 N times the minimum size, and the number of banks is also set to 2 N powers. That is, the minimum size of the logical page size is 1 KB, the maximum size is 4 KB, which is a squared multiple of 2, and the number of banks is a number that is the square of 2 (four). By doing so, almost as in the case of the 4 KB page size, the address translation buffer 1 can hold 128 entries of arbitrary logical page numbers having a 1 KB page size as a whole. However, the logical page number of an entry that can be held in one bank is restricted by every 4 KB. This restriction has no effect on the hit rate of the TLB 1 if the logical page numbers of entries held in the address translation buffer 1 are continuous. In the case of decentralization, the hit rate is affected to some extent. Even in this case, if 1KB logical page is address-mapped for every 2KB, the influence can be reduced, and if address mapping is made for every 4KB, it can be made not affected at all. For example, when 1 KB page size conversion information is set (written) to the address conversion buffer 1, four entries indicated by a 5-bit index address from each of the four banks 11, 12, 13, and 14 Conversion information when the 2-bit vpn (11-10) is “00”, conversion information when the 2-bit vpn (11-10) is “01”, and 2-bit vpn (11-10) is “10” Conversion information when the 2-bit vpn (11-10) is “11”, respectively. In this way, it is possible to prevent a decrease in hit rate.

ヒット判定のためのアドレス比較のビット数は、図12に基づいて説明したように論理ページサイズに応じて変化されなければならない。論理ページサイズが1KBの場合には、4KBの場合に比べてvpn(11−10)をVPN(11−10)と比較しなければならない。TLB1はそのような比較対象のビット数を全てカバーできるようにVPN(31−17)とVPN(11−10)の記憶領域を備え、且つ、物理ページ番号PPNに対しても22ビットの記憶領域を備えている。TLB1は、各エントリのデータ部にそれがサポートする論理ページサイズを示すサイズビットSZを有しており、その値に応じてヒット判定のためのアドレス比較のビット数が変化される。図12で説明したように、サイズビットSZ=1(論理ページサイズ=4KB)の場合には、VPN(31−17)が論理アドレスの対応ビットとの比較対象とされ、サイズビットSZ=0(論理ページサイズ=1KB)の場合には、VPN(31−17)とVPN(11−10)とが論理アドレスの対応ビットとの比較対象とされる。   The number of bits of address comparison for hit determination must be changed according to the logical page size as described with reference to FIG. When the logical page size is 1 KB, vpn (11-10) must be compared with VPN (11-10) compared to the case of 4 KB. The TLB 1 has storage areas for VPN (31-17) and VPN (11-10) so as to cover all the numbers of bits to be compared, and a 22-bit storage area for the physical page number PPN. It has. The TLB 1 has a size bit SZ indicating the logical page size supported by the data portion of each entry, and the number of bits for address comparison for hit determination is changed according to the value. As described in FIG. 12, when the size bit SZ = 1 (logical page size = 4 KB), the VPN (31-17) is a comparison target with the corresponding bit of the logical address, and the size bit SZ = 0 ( In the case of logical page size = 1 KB), VPN (31-17) and VPN (11-10) are to be compared with the corresponding bits of the logical address.

このように複数ページサイズを選択的にサポートするマクロコンピュータは、システムに実装される実メモリの全記憶容量が少ないような場合に、論理ページのサイズを比較的小さくして各プロセスによるメモリ利用効率を向上させたいという要求にも容易に対応できる。このとき、最大論理ページサイズが最小サイズの2のべき乗数倍にされ、そのセットアソシアティブ方式のTLB1のバンクの数をその2のべき乗数以上にすることにより、インデックスアドレスの指定手法を最大論理ページサイズのものに統一化しても、選ばれている論理ページサイズが最大であっても最小であっても、原理的にはどの論理ページ番号のエントリについてもアドレス変換バッファ1に保有可能にすることができる。論理ページ番号に対応させて、論理ページのサイズを示すための情報を設け、このサイズを用いてヒット判定のためのアドレス比較のビット数を変化させることにより、アドレス変換バッファ1を連想的に検索するための比較対象情報のビット数やビット位置を、論理ページのサイズによって変化させることを容易に実現できる。複数ページサイズをサポートするアドレス変換バッファ1をセットアソシアティブ形式のキャッシュメモリで実現することは、これをCAMで構成する場合に比べてチップ専有面積と消費電力を共に半減させることができる。   In this way, a macro computer that selectively supports multiple page sizes can reduce the size of logical pages and reduce the memory usage efficiency of each process when the total storage capacity of the real memory installed in the system is small. It is possible to easily meet the demand to improve the quality. At this time, the maximum logical page size is set to a power of 2 times the minimum size, and the number of banks of the TLB1 of the set associative method is set to a power of 2 or more, whereby the index address designation method is set to the maximum logical page Regardless of whether the size is unified or the selected logical page size is the maximum or minimum, in principle, any logical page number entry can be held in the address translation buffer 1. Can do. Corresponding to the logical page number, information for indicating the size of the logical page is provided, and by using this size, the address comparison buffer 1 is associatively searched by changing the number of bits for address comparison for hit determination. Therefore, it is possible to easily change the number of bits and the bit position of the information to be compared according to the size of the logical page. Realizing the address translation buffer 1 that supports a plurality of page sizes with a set-associative cache memory can halve both the chip-occupied area and the power consumption as compared with the case where it is configured with a CAM.

《複数のインデックス方法をサポート》 複数のプロセスが存在し、夫々のプロセスが夫々のアドレス変換情報を有し、プロセス番号asidによって、それぞれのプロセスが区別されるところの多重仮想記憶をサポートする場合、TLB1のインデックスアドレスを指定する手法として、図2に示されるように論理アドレスの一部(インデックスアドレス)のみをデコードする手法と、図3に示されるように排他的論理和ゲートXORによってその論理アドレスの一部(インデックスアドレス)を現在のプロセス番号asidの一部によって修飾した結果をデコードする手法とを、レジスタMMUCRのビットMMUCR.IXの論理値にしたがって指示することができる。これによれば、多重仮想記憶において多くのプロセスが並列的に起動される利用形態においてヒット率の低下を抑えることができるように、その利用形態に応じてインデックス方法を選択可能にすることができる。また、論理アドレスの一部を当該論理アドレスを利用するプロセスの番号asidによって修飾し、これを以てバッファメモリをインデックスすることにより、多重仮想記憶において多くのプロセスが並列的に起動される利用形態においてヒット率の低下を抑えることができる。   << Supporting multiple index methods >> When there are multiple processes, each process has its own address translation information, and supports multiple virtual storage where each process is distinguished by the process number asid, As a method of designating the index address of TLB1, a method of decoding only a part of the logical address (index address) as shown in FIG. 2 and its logical address by exclusive OR gate XOR as shown in FIG. And a method of decoding a result obtained by modifying a part (index address) of the current process number asid with a bit MMUCR. It can be indicated according to the logical value of IX. According to this, it is possible to select an index method according to the usage mode so that a decrease in hit rate can be suppressed in a usage mode in which many processes are started in parallel in multiple virtual memory. . In addition, a part of the logical address is modified by the number asid of the process that uses the logical address, and the buffer memory is indexed by this. The decrease in rate can be suppressed.

《リプレースの自由度》 上述の如くTLB1は、夫々のインデックスアドレスが共通化された複数バンク11〜14を持つ4ウェイ・セットアソシアティブ方式のキャッシュメモリとして構成されている。キャッシュミスなどにおいて、その複数バンク(ウエイ)の中から記憶情報を置換すべき場合に、当該置換されるべきバンクは、中央処理装置3によるソフトウェアの実行によって任意に指定可能にされる。図6に示されるレジスタMMUCRの内、ビットMMUCR.RCは、上記バンクを任意に指定するための2ビットの情報が設定される領域である。これに設定された値が、図4のデコーダ17によって解読されることにより、4個のバンク11〜14の中から一つを選ぶ信号(BSL1〜BSL4)が形成される。これにより、インデックスアドレス2で指定された4個のバンク11〜14内のエントリの内の一つが、上記選択信号(BSL1〜BSL4)によって選択され、置換対象とされる。ビットMMUCR.RCはランダムカウンタのような計数手段として使うこともできる。MMUCR.RCのビット数の2のべき乗数は上記バッファメモリ1のバンクの数(=4)に一致される。制御回路(CTRL)50は、図15に基づいて説明したように、TLB1に対する記憶情報の置換が必要になった(TLBミス)場合、そのMMUCR.RCを1インクリメントし、何れのバンクもインデックスされた記憶領域に有効なデータを保持している(インデックスされた各エントリ内の変換情報Vが1を保有する)と、そのインクリメントされた結果を置換すべきバンク番号とし、インデックスされた記憶領域に有効なデータを保持していない(インデックスされた何れかのエントリはV=0を保有する)バンクがある場合には、そのバンク番号をMMUCR.RCにセットし且つセットされた番号のバンクを置換すべきバンクとする、という一定の規則に従って置換すべきバンクを指定する。このとき、MMUCR.RCの各ビットは中央処理装置3によるソフトウェアの実行によって任意に値が変更可能な対象とされる。すなわち、MMUCR.RCはTLBミスの発生によって+1される動作に限定されない。特定の値を除外するようにMMUCR.RCを更新してもよい。さらに、CPU3が実行するソフトウェアのアルゴリズム次第で、種々の置換が可能である。例えば、ランダム、最初にロードされたものからリプレースするFIFO、又は最後に参照されたものからリプレースするLRU(Least Recentry Used)などのリプレースを、MMUCR.RCの更新方法を変えることに容易に実現できる。そのため、リプレースの自由度も保証できる。   << Freedom of Replacement >> As described above, the TLB 1 is configured as a 4-way set associative cache memory having a plurality of banks 11 to 14 each having a common index address. When the stored information is to be replaced from among the plurality of banks (way) due to a cache miss or the like, the bank to be replaced can be arbitrarily designated by execution of software by the central processing unit 3. Of the register MMUCR shown in FIG. RC is an area in which 2-bit information for arbitrarily designating the bank is set. A value (BSL1 to BSL4) for selecting one of the four banks 11 to 14 is formed by decoding the set value by the decoder 17 of FIG. As a result, one of the entries in the four banks 11 to 14 specified by the index address 2 is selected by the selection signal (BSL1 to BSL4) and is set as a replacement target. Bit MMUCR. RC can also be used as a counting means such as a random counter. MMUCR. The power of 2 of the number of bits of RC matches the number of banks (= 4) of the buffer memory 1. As described with reference to FIG. 15, when the control information (CTRL) 50 needs to replace stored information for TLB 1 (TLB miss), the MMUCR. RC is incremented by 1 and if any bank holds valid data in the indexed storage area (conversion information V in each indexed entry has 1), the incremented result is replaced. If there is a bank that does not hold valid data in the indexed storage area (any indexed entry has V = 0), the bank number is set to MMUCR. A bank to be replaced is designated in accordance with a certain rule that is set to RC and the bank of the set number is a bank to be replaced. At this time, MMUCR. Each bit of RC is a target whose value can be arbitrarily changed by execution of software by the central processing unit 3. That is, MMUCR. RC is not limited to the operation incremented by the occurrence of a TLB miss. To exclude specific values, MMUCR. The RC may be updated. Furthermore, various substitutions are possible depending on the software algorithm executed by the CPU 3. For example, replacement such as random, first-loaded FIFO to be replaced, or last-replaced LRU (Least Recentry Used) is replaced with MMUCR. This can be easily realized by changing the RC update method. Therefore, the degree of freedom of replacement can be guaranteed.

このようにTLB1のエントリを置き換えるためのリプレースメントアルゴリズムを固定化せず、置き換えるべきバンクをソフトウェアで任意に決定可能にすることにより、データ処理の都合上、常に特定の変換対をアドレス変換バッファ1にエントリとして格納しておきたいという要求や、特定のエントリをリプレース対象にしたくないという要求に容易に答えることができるようになる。   In this way, the replacement algorithm for replacing the entry of TLB 1 is not fixed, and the bank to be replaced can be arbitrarily determined by software, so that a specific conversion pair is always stored in the address conversion buffer 1 for the convenience of data processing. It becomes possible to easily respond to a request to store as an entry or a request not to make a specific entry a replacement target.

《単一仮想記憶と多重仮想記憶のサポート》 本実施例のマイクロコンピュータにおいては、実行されるべき複数のプロセスの夫々が論理空間の全域にわたるアドレス変換情報を有する場合、プロセス番号asidによって、その論理アドレスを修飾或いは拡張する多重仮想記憶を、また、実行されるべき複数のプロセスに論理アドレス空間の一部が排他的に割り当てられ、夫々のプロセスがそれに割り当てられた論理アドレス空間のアドレス変換情報を有する場合、プロセス番号asidによって論理アドレスを修飾或いは拡張しない単一仮想記憶を、選択することが可能とされる。そのような仮想記憶についての制御は、図6に例示されるMMUCR.SVの値によって指示される。MMUCR.SVの値は中央処理装置3がソフトウェアを実行することによって任意に設定される。単一仮想記憶と多重仮想記憶との概念的な相違は図20で説明した通りであり、その他の代表的な相違点については図19に例示されている。図5に示されるようにTLB1は論理ページ番号VPNと物理ページPPN番号と共にプロセス番号ASIDのフィールドを有する。このフィールドの値は、単一仮想記憶か多重仮想記憶かでその処理内容が相違されることになる。あるTLBエントリに含まれるプロセス番号に対応される論理ページが、他のプロセスと共有不可能であると設定されているとき、多重仮想記憶においては、そのプロセス番号ASIDは図17で説明したようにTLB1のTLBヒット/ミスの判定に用いられる。したがって、TLB1に格納されているエントリの論理ページ番号VPNが論理ページアドレスvpnに一致すると共に当該エントリのプロセス番号ASIDが現在のプロセスの番号asidに一致していなければTLBヒットとはされない。単一仮想記憶においては、プロセス番号ASIDはメモリ保護情報(ドメイン番号)として使用される。ユーザモードにおいて、非共有ページに対する、他プロセスによる当該ページへのアクセスは、TLBプロテクト違反例外としてソフトウェアにより処理される。   << Support for Single Virtual Memory and Multiple Virtual Memory >> In the microcomputer of this embodiment, when each of a plurality of processes to be executed has address translation information over the entire logical space, the logical number is indicated by the process number asid. Multiple virtual memories that modify or expand addresses, and a part of the logical address space is exclusively allocated to a plurality of processes to be executed, and address conversion information of the logical address space to which each process is allocated If so, it is possible to select a single virtual memory that does not qualify or extend the logical address by the process number asid. Such control for virtual memory is controlled by the MMUCR.exe illustrated in FIG. Indicated by the value of SV. MMUCR. The value of SV is arbitrarily set by the central processing unit 3 executing software. The conceptual difference between the single virtual memory and the multiple virtual memory is as described with reference to FIG. 20, and other typical differences are illustrated in FIG. As shown in FIG. 5, the TLB 1 includes a process number ASID field together with a logical page number VPN and a physical page PPN number. The processing content of the value of this field differs depending on whether it is a single virtual memory or a multiple virtual memory. When a logical page corresponding to a process number included in a certain TLB entry is set to be non-shareable with other processes, the process number ASID in the multiple virtual memory is as described with reference to FIG. Used to determine TLB1 TLB hit / miss. Therefore, if the logical page number VPN of the entry stored in TLB1 matches the logical page address vpn and the process number ASID of the entry does not match the current process number asid, a TLB hit is not made. In a single virtual memory, the process number ASID is used as memory protection information (domain number). In the user mode, access to a non-shared page by another process is processed by software as a TLB protection violation exception.

MMUCR.SVの値をCPU3を介して設定することにより単一仮想記憶と多重仮想記憶の双方を選択的にサポート可能にすることにより、アドレス変換機構の使い勝手を向上させることができる。多重仮想記憶におけるプロセス番号ASIDを単一仮想記憶におけるメモリ保護情報として使用することにより、その場合におけるメモリ保護の完全化を容易に実現することができる。   MMUCR. By setting the SV value via the CPU 3, it is possible to selectively support both single virtual memory and multiple virtual memory, thereby improving the usability of the address translation mechanism. By using the process number ASID in the multiple virtual memory as the memory protection information in the single virtual memory, complete memory protection in that case can be easily realized.

以上本発明者によってなされた発明を実施例に基づいて具体的に説明したが、本発明はそれに限定されるものではなく、その要旨を逸脱しない範囲において種々変更可能であることは言うまでもない。   Although the invention made by the present inventor has been specifically described based on the embodiments, it is needless to say that the present invention is not limited thereto and can be variously modified without departing from the gist thereof.

例えば、上記実施例においてTLBのウェイ数、即ちバンクの数を5以上例えば8にすることも可能である。例えばページサイズを1KBと8KBにする場合にはLTBのウェイ数(バンク数)は8以上とすればよい。また、ページサイズを4KBと16KBにする場合にはLTBのウェイ数(バンク数)は4以上であればよい。それらによっても上記実施例と同様の効果を得ることができる。要はサポートするページの最大サイズが最小サイズの2のべき乗数倍にされ、そのセットアソシアティブ方式のバッファメモリのセットの数がその2のべき乗数以上であればよい。マイクロコンピュータがサポートするアドレス空間のサイズは4GBに限定されず、それに応じて論理アドレスのビット数も制限されない。サポートするページサイズも適宜のサイズに、且つサポートする種類の数も適宜変更可能である。また、TLBエントリとして保有する論理ページ番号VPNは上記実施例のようにインデックスに利用される対応ビットを除いたものとする構成に限定されず、論理ページ番号の全ビットをTLBエントリとして保有することもできる。   For example, in the above embodiment, the number of TLB ways, that is, the number of banks can be set to 5 or more, for example, 8. For example, when the page size is 1 KB and 8 KB, the number of LTB ways (the number of banks) may be 8 or more. When the page size is 4 KB and 16 KB, the number of LTB ways (the number of banks) may be four or more. The effect similar to the said Example can be acquired also by them. In short, the maximum size of the supported page is set to a power of 2 times the minimum size, and the number of sets of the buffer memory of the set associative method may be equal to or greater than the power of 2. The size of the address space supported by the microcomputer is not limited to 4 GB, and the number of bits of the logical address is not limited accordingly. The supported page size can be changed to an appropriate size, and the number of supported types can be changed as appropriate. Further, the logical page number VPN held as the TLB entry is not limited to the configuration excluding the corresponding bits used for the index as in the above embodiment, and all bits of the logical page number are held as the TLB entry. You can also.

以上の説明では主として本発明者によってなされた発明をその背景となった利用分野であるマイクロコンピュータに利用した場合について説明したが、本発明はそれに限定されず、例えばMMU(メモリマネージメントユニット)用のコントローラチップなどにも広く適用することができる。   In the above description, the case where the invention made mainly by the present inventor is used for the microcomputer which is the field of use behind the present invention has been described. However, the present invention is not limited to this. It can be widely applied to controller chips and the like.

本発明の一実施例に係るマイクロコンピュータにおける複数ページサイズをサポートする構成の説明図である。It is explanatory drawing of the structure which supports multiple page size in the microcomputer based on one Example of this invention. 論理ページアドレスの一部をそのまま利用してTLBをインデックスする手法の説明図である。It is explanatory drawing of the method of indexing TLB using a part of logical page address as it is. 論理ページアドレスの一部とプロセス番号の一部を用いてTLBをインデックスする手法の説明図である。It is explanatory drawing of the method of indexing TLB using a part of logical page address and a part of process number. TLBエントリのリプレース対象バンクをソフトウェアで任意に決定可能とする構成の説明図である。It is explanatory drawing of the structure which can determine arbitrarily the replacement object bank of a TLB entry by software. ページサイズの異なる論理アドレスとそれらをサポートするためのTLBエントリのフォーマットの一例を説明するための説明図である。It is explanatory drawing for demonstrating an example of the format of the logical address from which page sizes differ, and the TLB entry for supporting them. TLBのための各種レジスタの一例を説明するための説明図である。It is explanatory drawing for demonstrating an example of the various registers | resistors for TLB. 本発明の一実施例に係るマイクロコンピュータの要部を示す全体ブロック図である。It is a whole block diagram which shows the principal part of the microcomputer based on one Example of this invention. 本実施例のマイクロコンピュータがサポートするアドレスマップの一例を(A)及び(B)にて示す説明図である。It is explanatory drawing which shows an example of the address map which the microcomputer of a present Example supports in (A) and (B). 記憶保護に利用されるプロテクションビットPRによって規定されるアクセス権の説明図である。It is explanatory drawing of the access right prescribed | regulated by the protection bit PR utilized for storage protection. アドレス変換の制御メインフローチャートである。It is a control main flowchart of address conversion. TLBのインデックス手法選択のための制御フローチャートである。It is a control flowchart for the index method selection of TLB. 論理アドレスとそれによってインデックスされたタグとのアドレス比較の制御フローチャートである。It is a control flowchart of an address comparison between a logical address and a tag indexed thereby. 単一仮想記憶においてASIDをメモリ保護に利用する制御を含んだプロテクション制御の部分的なフローチャートである。It is a partial flowchart of protection control including control which uses ASID for memory protection in a single virtual memory. ページサイズに従った物理アドレス生成手順を示すフローチャートである。It is a flowchart which shows the physical address production | generation procedure according to page size. リプレース対象バンクをハードウェア的に指定するための制御フローチャートである。It is a control flowchart for designating the replacement target bank in hardware. TLBミスにより生じる例外によって、起動されるところの TLBエントリを更新するためのTLBミスハンドラによる処理の一例を示すフローチャートである。It is a flowchart which shows an example of the process by the TLB miss handler for updating the TLB entry started by the exception which arises by TLB miss. 単一仮想記憶におけるTLBに関する例外検出処理の前半を示すフローチャートである。It is a flowchart which shows the first half of the exception detection process regarding TLB in a single virtual memory. 単一仮想記憶におけるTLBに関する例外検出処理の後半を示すフローチャートである。It is a flowchart which shows the second half of the exception detection process regarding TLB in a single virtual memory. 単一仮想記憶と多重仮想記憶との全体的な相違を示す説明図である。It is explanatory drawing which shows the whole difference of single virtual memory and multiple virtual memory. 単一仮想記憶と多重仮想記憶との概念を(A)及び(B)にて示す説明図である。It is explanatory drawing which shows the concept of single virtual memory and multiple virtual memory in (A) and (B). TLBの各バンクにおけるヒット信号に反映すべきアドレス比較結果を制御する制御ロジックの一例を示す論理回路図である。It is a logic circuit diagram showing an example of control logic for controlling an address comparison result to be reflected in a hit signal in each bank of TLB. 図7の一部を更に詳細に示したブロック図である。FIG. 8 is a block diagram showing a part of FIG. 7 in more detail.

符号の説明Explanation of symbols

1 アドレス変換バッファ(バッファメモリ)
VPN 論理ページ番号
PPN 物理ページ番号
ASID,asid 空間番号(プロセス番号)
vpn 論理ページアドレス(論理ページ番号)
ppn 物理ページアドレス(物理ページ番号)
PR プロテクションキー
11〜14 バンク
15 比較手段
151〜153 コンパレータ
154 制御ロジック
2 インデックス用アドレス
XOR 排他的論理和ゲート
3 中央処理装置
4 キャッシュメモリ
5 TLBコントローラ
50 制御回路
51 PTEHレジスタ
52 PTELレジスタ
53 TTBレジスタ
54 TEAレジスタ
55 MMUCRレジスタ
SV シングルバーチャルビット
SZ サイズビット
IX インデックスモードビット
RC ランダムカウンタ
MD モードビット
1 Address translation buffer (buffer memory)
VPN logical page number PPP physical page number ASID, asid space number (process number)
vpn logical page address (logical page number)
ppn physical page address (physical page number)
PR protection key 11-14 bank 15 comparison means 151-153 comparator 154 control logic 2 index address XOR exclusive OR gate 3 central processing unit 4 cache memory 5 TLB controller 50 control circuit 51 PTEH register 52 PTEL register 53 TTB register 54 TEA register 55 MMUCR register SV Single virtual bit SZ Size bit IX Index mode bit RC Random counter MD Mode bit

Claims (14)

中央処理装置を含み、論理アドレス空間を複数の論理ページに分割し、中央処理装置から論理アドレスを受付け、上記論理ページ上に割当てられる論理アドレスが物理ページ上の物理アドレスに変換される仮想記憶機能を有し、キャッシュメモリと、レジスタを有し、
上記キャッシュメモリは、複数のエントリを有し、上記複数のエントリは、論理ページを特定する論理ページ番号と、論理ページ番号に対応し物理ページを特定する物理ページ番号とをそれぞれのエントリに有し、
上記レジスタは、上記中央処理装置とキャッシュメモリに接続され、上記中央処理装置により上記複数のエントリのうちの一つを、リプレース対象として特定するためのデータが設定される事を特徴とするデータ処理装置。
A virtual storage function that includes a central processing unit, divides a logical address space into a plurality of logical pages, receives a logical address from the central processing unit, and converts a logical address allocated on the logical page into a physical address on a physical page A cache memory, a register,
The cache memory has a plurality of entries, and each of the plurality of entries has a logical page number for specifying a logical page and a physical page number for specifying a physical page corresponding to the logical page number in each entry. ,
The register is connected to the central processing unit and a cache memory, and data for identifying one of the plurality of entries as a replacement target is set by the central processing unit. apparatus.
中央処理装置と主記憶装置とキャッシュメモリと制御レジスタを有し、
上記主記憶装置は、上記中央処理装置と接続され、データの格納のために用いられ、
上記キャッシュメモリは、上記中央処理装置と主記憶装置に接続され、複数のエントリを有し、それぞれのエントリは上記主記憶装置に格納されているデータを選択的に格納し、
上記制御レジスタは、上記中央処理装置とキャッシュメモリに接続され、上記中央処理装置が供給する値を格納し、上記格納される値は、次に上記主記憶装置からのデータで置き換えが行われるべきキャッシュメモリのエントリを特定するために用いられる事を特徴とするデータ処理装置。
A central processing unit, a main storage, a cache memory, and a control register;
The main storage device is connected to the central processing unit and is used for storing data,
The cache memory is connected to the central processing unit and the main storage device, and has a plurality of entries, each entry selectively storing data stored in the main storage device,
The control register is connected to the central processing unit and a cache memory, and stores a value supplied by the central processing unit, and the stored value is to be replaced with data from the main storage device next. A data processing device used for specifying an entry in a cache memory.
中央処理装置と主記憶装置とキャッシュメモリと制御レジスタを有し、
上記主記憶装置は、上記中央処理装置に接続され、データの格納のために用いられ、
上記キャッシュメモリは、上記中央処理装置と主記憶装置に接続され、複数のエントリを有し、それぞれのエントリは主記憶装置に格納されているデータを選択的に格納し、
上記制御レジスタは、上記中央処理装置とキャッシュメモリに接続され、中央処理装置により設定される値を格納し、上記格納される値は、次に上記主記憶装置からのデータで置き換えられるべきキャッシュメモリのエントリを置き換え制御するために用いられる事を特徴とするデータ処理装置。
A central processing unit, a main storage, a cache memory, and a control register;
The main storage device is connected to the central processing unit and is used for storing data,
The cache memory is connected to the central processing unit and the main storage device, and has a plurality of entries, each entry selectively storing data stored in the main storage device,
The control register is connected to the central processing unit and a cache memory, and stores a value set by the central processing unit, and the stored value is to be replaced with data from the main storage device next. A data processing apparatus characterized by being used for replacement control of entries.
中央処理装置とキャッシュメモリと制御レジスタを有し、
上記キャッシュメモリは、上記中央処理装置に接続され、複数のエントリを有し、それぞれのエントリは中央処理装置から供給されるデータを選択的に格納し、
上記制御レジスタは、上記中央処理装置とキャッシュメモリに接続され、中央処理装置から供給される値を格納し、上記格納される値は、次に中央処理装置から供給されるデータで置き換えられるべきキャッシュメモリのエントリを特定するために用いられる事を特徴とするデータ処理装置。
A central processing unit, a cache memory and a control register;
The cache memory is connected to the central processing unit and has a plurality of entries, each entry selectively storing data supplied from the central processing unit,
The control register is connected to the central processing unit and a cache memory and stores a value supplied from the central processing unit, and the stored value is a cache to be replaced with data supplied from the central processing unit next. A data processing apparatus used for specifying an entry in a memory.
中央処理装置とキャッシュメモリと制御レジスタを有し、
上記キャッシュメモリは、上記中央処理装置に接続され、複数のエントリを有し、それぞれのエントリは上記中央処理装置から供給されるデータを選択的に格納し、
上記制御レジスタは、上記中央処理装置とキャッシュメモリに接続され、上記中央処理装置から供給される値を格納し、上記格納した値は、次に中央処理装置から供給されるデータで置き換えられるべきキャッシュメモリのエントリを置き換え制御するために用いられる事を特徴とするデータ処理装置。
A central processing unit, a cache memory and a control register;
The cache memory is connected to the central processing unit and has a plurality of entries, each entry selectively storing data supplied from the central processing unit,
The control register is connected to the central processing unit and a cache memory, stores a value supplied from the central processing unit, and the stored value is a cache to be replaced with data supplied from the central processing unit next. A data processing apparatus used for replacing and controlling a memory entry.
バッファメモリとレジスタと中央処理装置を有し、
上記バッファメモリは複数のエントリを有し、それぞれのエントリは論理アドレスタグと物理アドレス情報を含むアドレス情報を有し、
上記レジスタは上記複数のエントリのうちの1つを特定するためのデータを格納し、
上記中央処理装置は論理アドレスを出力し、
上記論理アドレスにより選択された上記エントリに格納された論理アドレスタグが、中央処理装置が出力する論理アドレスに含まれるアドレスデータと一致する場合、上記中央処理装置は当該エントリに格納された物理アドレス情報を使用し、
上記選択されたエントリに含まれる論理アドレスタグが、上記論理アドレスに含まれるアドレスデータと一致しない場合、上記レジスタに格納されたデータにより特定されるエントリのアドレス情報を新しいアドレス情報で置き換える事を特徴とするデータ処理装置。
A buffer memory, a register and a central processing unit;
The buffer memory has a plurality of entries, and each entry has address information including a logical address tag and physical address information,
The register stores data for specifying one of the plurality of entries,
The central processing unit outputs a logical address,
If the logical address tag stored in the entry selected by the logical address matches the address data included in the logical address output by the central processing unit, the central processing unit stores the physical address information stored in the entry. Use
When the logical address tag included in the selected entry does not match the address data included in the logical address, the address information of the entry specified by the data stored in the register is replaced with new address information. A data processing device.
論理アドレス空間が複数の仮想ページに分割され、仮想ページ単位に論理アドレスが物理アドレスにアドレス変換される仮想記憶機能を有し、処理装置とバンク指定回路とアドレス変換バッファを有し、
上記処理装置は、インデックスアドレスと比較アドレスとオフセットアドレスを有する論理アドレスを生成し、
上記バンク指定回路は上記処理装置により設定可能であり、
上記アドレス変換バッファは、上記処理装置の生成した論理アドレスを物理アドレスに変換するために用いられ、複数のバンクと選択回路と比較回路とバンクセレクタを有し、
上記複数のバンクはそれぞれ、仮想ページ番号と物理ページ番号をそれぞれに有する複数のエントリを有し、
上記選択回路は、上記複数のバンクのそれぞれから、上記インデックスアドレスにより指定されるエントリを選択し、
上記比較器は、上記選択されたエントリの仮想ページ番号と比較アドレスを比較し、
上記バンクセレクタは、上記比較器によって選択されたエントリに上記比較アドレスに対応する仮想ページ番号が格納されていない事が示されている場合、バンク指定回路により指定されたバンクをエントリのリプレースを行うために指定し、
上記物理アドレスは当該エントリに格納された物理ページ番号とオフセットアドレスから生成される事を特徴とするデータ処理装置。
The logical address space is divided into a plurality of virtual pages, and has a virtual storage function in which logical addresses are converted into physical addresses in units of virtual pages, and includes a processing device, a bank specifying circuit, and an address conversion buffer.
The processing device generates a logical address having an index address, a comparison address, and an offset address,
The bank designating circuit can be set by the processing device,
The address conversion buffer is used to convert a logical address generated by the processing device into a physical address, and includes a plurality of banks, a selection circuit, a comparison circuit, and a bank selector.
Each of the plurality of banks has a plurality of entries each having a virtual page number and a physical page number;
The selection circuit selects an entry specified by the index address from each of the plurality of banks,
The comparator compares the virtual page number of the selected entry with a comparison address,
When the entry selected by the comparator indicates that the virtual page number corresponding to the comparison address is not stored, the bank selector replaces the bank designated by the bank designation circuit. Specify for and
A data processing apparatus, wherein the physical address is generated from a physical page number and an offset address stored in the entry.
論理アドレス空間が複数の仮想ページに分割され、仮想ページ単位に論理アドレスが物理アドレスにアドレス変換される仮想記憶機能を有し、セットアソシアティブ構成のキャッシュメモリと制御信号出力部とインデックスアドレス生成回路を有し
上記セットアソシアティブ構成のキャッシュメモリは、複数のメモリバンクを有し、複数のメモリバンクのそれぞれは複数のメモリフィールドを有し、それぞれのメモリフィールドは仮想ページを指定するための仮想ページ番号と、仮想ページ番号に対応する物理ページ番号を格納可能であり、
上記インデックスアドレス生成回路は、少なくとも論理アドレスの一部と制御信号を入力され、それぞれ複数のバンクのそれぞれからメモリフィールドを選択するためのインデックスアドレスを生成し、その場合、制御信号に応じて異なるインデックスアドレスを生成する事を特徴とするデータ処理装置。
The logical address space is divided into a plurality of virtual pages, and has a virtual memory function in which logical addresses are converted into physical addresses in units of virtual pages, and a set associative cache memory, a control signal output unit, and an index address generation circuit are provided. The set associative cache memory has a plurality of memory banks, each of the plurality of memory banks has a plurality of memory fields, and each memory field has a virtual page number for designating a virtual page and The physical page number corresponding to the virtual page number can be stored,
The index address generation circuit receives at least a part of a logical address and a control signal, and generates an index address for selecting a memory field from each of a plurality of banks. In this case, a different index depends on the control signal. A data processing apparatus characterized by generating an address.
論理アドレス空間が複数の仮想ページに分割され、仮想ページ単位に論理アドレスが物理アドレスにアドレス変換される仮想記憶機能を有し、中央処理装置とセットアソシアティブ構成のキャッシュメモリと指定回路を有し、
上記セットアソシアティブ構成のキャッシュメモリは、複数のバンクに分割され、それぞれのバンクは、仮想ページを指定するための仮想ページ番号と仮想ページ番号に対応した物理ページ番号を格納可能な複数のメモリフィールドを有し、
上記指定回路は、上記中央処理装置によりアクセスされ、情報が置き換えられるべきメモリフィールドを含むバンクを指定し、
上記置き換えられるべき情報を含むバンクの指定は、上記中央処理装置で実行されるソフトウェアにより決定される事を特徴とするデータ処理装置。
The logical address space is divided into a plurality of virtual pages, and has a virtual storage function in which logical addresses are converted into physical addresses in units of virtual pages, a central processing unit, a set associative cache memory, and a designation circuit,
The set associative cache memory is divided into a plurality of banks, and each bank has a plurality of memory fields that can store a virtual page number for designating a virtual page and a physical page number corresponding to the virtual page number. Have
The designating circuit designates a bank that includes a memory field that is accessed by the central processing unit and whose information is to be replaced;
A data processing apparatus characterized in that designation of a bank including information to be replaced is determined by software executed by the central processing unit.
論理アドレス空間が複数の仮想ページに分割され、仮想ページ単位に論理アドレスが物理アドレスにアドレス変換される仮想記憶機能を有し、セットアソシアティブ構成のキャッシュメモリと指定回路と中央処理装置を有し、
上記セットアソシアティブ構成のキャッシュメモリは、複数のバンクに分割され、それぞれのバンクは仮想ページを指示する仮想ページ番号と仮想ページ番号に対応した物理ページ番号を格納可能な複数のメモリフィールドを有し、
上記指定回路は、所定のルールに従って、記憶情報を置換すべきメモリフィールドを含むバンクを、複数のバンクの中から指定し、
上記中央処理装置は、上記指定回路に接続され、中央処理装置で実行中のソフトウェアに応じて指定されるバンクが変更される事を特徴とするデータ処理装置。
The logical address space is divided into a plurality of virtual pages, has a virtual storage function in which logical addresses are converted into physical addresses in units of virtual pages, has a set associative configuration cache memory, a designation circuit, and a central processing unit,
The set associative cache memory is divided into a plurality of banks, each bank having a plurality of memory fields capable of storing a virtual page number indicating a virtual page and a physical page number corresponding to the virtual page number,
The designation circuit designates, from a plurality of banks, a bank including a memory field whose stored information is to be replaced according to a predetermined rule.
The central processing unit is connected to the designating circuit, and a bank designated according to software being executed in the central processing unit is changed.
論理アドレス空間が複数の仮想ページに分割され、仮想ページ単位に論理アドレスが物理アドレスにアドレス変換される仮想記憶機能を有し、複数のプロセスが仮想記憶機能を利用して実行され、単一仮想記憶モードと多重仮想記憶モードを有し、
上記多重仮想記憶モードは、論理アドレスが実行されているプロセスに応じて変更され、上記複数のプロセスのそれぞれは論理アドレス空間の全域にわたるアドレスを利用可能であり、
上記単一仮想記憶モードは、論理アドレスは実行されているプロセスに応じて変更される事はなく、複数のプロセスのそれぞれは論理アドレス空間中に割当てられたアドレス空間の論理アドレスを利用可能であり、アドレス空間の一部分は、実行される複数のプロセス間で、排他的に割当てられ、
上記多重記憶モードと単一記憶モードを選択するためのセレクタを有するデータ処理装置。
The logical address space is divided into a plurality of virtual pages, and has a virtual memory function in which a logical address is converted into a physical address in units of virtual pages. A plurality of processes are executed using the virtual memory function, and a single virtual Having storage mode and multiple virtual storage mode,
The multiple virtual memory mode is changed according to a process in which a logical address is executed, and each of the plurality of processes can use an address over the entire logical address space.
In the single virtual memory mode, the logical address is not changed according to the process being executed, and each of the plurality of processes can use the logical address of the address space allocated in the logical address space. , A portion of the address space is allocated exclusively among the processes that are executed,
A data processing apparatus having a selector for selecting the multiple storage mode and the single storage mode.
中央処理装置の論理アドレス空間が複数の仮想ページに分割され、仮想ページ単位に論理アドレスが物理アドレスにアドレス変換される仮想記憶機能を有し、複数のプロセスが仮想記憶機能を利用して実行され、中央処理装置の動作モードを指定するモード情報と、仮想記憶モードを指定する制御情報と、アドレス変換バッファと、制御回路を有し、
上記モード情報は、中央処理装置が特権モード又はユーザモードのいずれのモードで動作しているかを指定し、
上記制御情報は、多重仮想記憶モード又は単一仮想記憶モードのいずれかを指定し、上記多重仮想記憶モードではプロセスのそれぞれが論理アドレス空間全体のアドレスを使用可能であり、上記単一仮想記憶モードでは論理アドレスを使用しているプロセスに応じて論理アドレスを変更し、プロセスのそれぞれが論理アドレス空間の一部を排他的に割当てられ、そしてプロセスのそれぞれがプロセス後とにアドレスを変更されることなく割当てられた一部のアドレス空間の論理アドレスを利用可能とされ、
上記アドレス変換バッファは、少なくとも論理アドレスの一部をインデックスアドレスとして利用する事でアクセスされ、複数のフィールドを有し、それぞれのフィールドはプロセス毎のプロセス情報と、プロセス毎の仮想ページに割当てられた仮想ページ情報と、仮想ページ情報に対応した物理ページ情報と、あるプロセスが使用している仮想ページを他のプロセスと共有しているかどうかを示す共有情報を含み、
上記制御回路は、アドレス変換のために用いられ、上記共有情報が非共有である事を示している場合、プロセス情報をアドレス変換バッファでのヒット判定に利用し、上記モード情報は中央処理装置がユーザモードにある事を示し、上記制御情報が単一仮想記憶モードにある事を示し、上記共有情報が非共有である事を示している場合、上記プロセス情報を記憶保護情報として用いることを特徴とするデータ処理装置。
The logical address space of the central processing unit is divided into a plurality of virtual pages, and has a virtual storage function in which logical addresses are converted into physical addresses in units of virtual pages, and a plurality of processes are executed using the virtual storage function. , Mode information designating the operation mode of the central processing unit, control information designating the virtual storage mode, an address translation buffer, and a control circuit,
The mode information specifies whether the central processing unit is operating in a privileged mode or a user mode,
The control information specifies either a multiple virtual storage mode or a single virtual storage mode, and in the multiple virtual storage mode, each of the processes can use the address of the entire logical address space. Now, change the logical address according to the process that uses the logical address, each process will be allocated a part of the logical address space exclusively, and each process will be changed after the process The logical address of a part of the allocated address space is made available,
The address translation buffer is accessed by using at least a part of the logical address as an index address, and has a plurality of fields. Each field is assigned to process information for each process and a virtual page for each process. Including virtual page information, physical page information corresponding to the virtual page information, and shared information indicating whether a virtual page used by a process is shared with other processes,
When the control circuit is used for address translation and indicates that the shared information is non-shared, the process information is used for hit judgment in the address translation buffer, and the mode information is stored by the central processing unit. The process information is used as storage protection information when the user mode is indicated, the control information is in a single virtual storage mode, and the shared information is non-shared. A data processing device.
論理アドレス空間が複数の仮想ページに分割され、仮想ページ単位に論理アドレスが物理アドレスにアドレス変換される仮想記憶機能を有し、仮想記憶機能により複数のプロセスを実行可能とされ、処理装置と出力装置と設定装置とアドレス変換バッファを有し、
上記処理装置は、インデックスアドレスと比較アドレスとオフセットアドレスを含む論理アドレスを生成し、
上記出力装置は、上記複数のプロセスのうちの1のプロセスを指定するためのプロセス番号を出力し、
上記設定回路は、上記処理装置により設定され、インデックスを指定するための情報を出力し、
上記アドレス変換バッファは、上記処理装置により生成された論理アドレスを物理アドレスに変換するために用いられ、複数のバンクと選択回路と比較器を有し、
上記複数のバンクはそれぞれ、仮想ページ番号と物理ページ番号をそれぞれに含む複数のエントリを有し、
上記選択回路は、上記インデックス情報により、上記論理アドレスのインデックスアドレス又はプロセス番号により修飾されたインデックスアドレスの何れかを選択し、上記複数のバンクのそれぞれから選択されたインデックスアドレスにより決定されるエントリを選択し、
上記比較器は、選択されたエントリの仮想ページ番号と比較アドレスを比較し、
当該エントリの上記物理ページ番号とオフセットアドレスから上記物理アドレスは生成される事を特徴とするデータ処理装置。
The logical address space is divided into a plurality of virtual pages, and has a virtual memory function that converts the logical address into a physical address in units of virtual pages. The virtual memory function enables a plurality of processes to be executed, and outputs to the processing device. A device, a setting device, and an address translation buffer;
The processing device generates a logical address including an index address, a comparison address, and an offset address,
The output device outputs a process number for designating one of the plurality of processes,
The setting circuit is set by the processing device and outputs information for designating an index.
The address conversion buffer is used to convert a logical address generated by the processing device into a physical address, and includes a plurality of banks, a selection circuit, and a comparator.
Each of the plurality of banks has a plurality of entries each including a virtual page number and a physical page number;
The selection circuit selects either the index address of the logical address or the index address modified by the process number based on the index information, and selects an entry determined by the index address selected from each of the plurality of banks. Selected,
The comparator compares the virtual address of the selected entry with the comparison address,
A data processing apparatus, wherein the physical address is generated from the physical page number and offset address of the entry.
論理アドレス空間が複数の仮想ページに分割され、仮想ページ単位に論理アドレスが物理アドレスにアドレス変換される仮想記憶機能を有し、複数のプロセスが実行され、処理装置とレジスタとアドレス変換バッファを有し、
上記処理装置は、インデックスアドレスと比較アドレスとオフセットアドレスからなる論理アドレスを生成し、
上記レジスタは上記処理装置により複数のプロセスから1のプロセスを特定するためのプロセス番号を設定可能とされ、
上記アドレス変換バッファは、上記処理装置により生成された論理アドレスを物理アドレスに変換するために用いられ、複数のエントリと選択回路と比較器を有し、
上記複数のエントリは、それぞれに仮想ページ番号と、仮想ページ番号に対応した物理ページ番号と、プロセスを特定するためのプロセス番号と、当該仮想ページが複数のプロセスで共有されているかどうかを示す共通情報を有し、
上記選択回路は上記インデックスアドレスにより指定されるエントリを選択し、
上記比較器は、選択されたエントリの仮想ページ番号と比較アドレスを比較し、上記レジスタに格納されたプロセス番号と選択されたエントリに格納されたプロセス番号の比較を行うかどうかを上記共通情報により決定され、
上記物理アドレスは、当該エントリの物理ページ番号とオフセットアドレスにより生成される事を特徴とするデータ処理装置。
The logical address space is divided into a plurality of virtual pages, and has a virtual storage function that converts the logical address into a physical address in units of virtual pages. A plurality of processes are executed, and a processing device, a register, and an address conversion buffer are provided. And
The processing device generates a logical address composed of an index address, a comparison address, and an offset address,
The register can set a process number for specifying one process from a plurality of processes by the processing device,
The address conversion buffer is used to convert a logical address generated by the processing device into a physical address, and includes a plurality of entries, a selection circuit, and a comparator.
The plurality of entries are common to each of the virtual page number, the physical page number corresponding to the virtual page number, the process number for specifying the process, and whether the virtual page is shared by a plurality of processes. Have information,
The selection circuit selects an entry specified by the index address,
The comparator compares the virtual page number of the selected entry with the comparison address, and determines whether to compare the process number stored in the register with the process number stored in the selected entry based on the common information. Determined,
The data processing apparatus, wherein the physical address is generated by a physical page number and an offset address of the entry.
JP2005000091A 1994-09-09 2005-01-04 Data processor Pending JP2005108262A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005000091A JP2005108262A (en) 1994-09-09 2005-01-04 Data processor

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP24199394 1994-09-09
JP8606895 1995-03-17
JP2005000091A JP2005108262A (en) 1994-09-09 2005-01-04 Data processor

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP24087195A Division JP3740195B2 (en) 1994-09-09 1995-08-25 Data processing device

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2007168670A Division JP2007280421A (en) 1994-09-09 2007-06-27 Data processor

Publications (1)

Publication Number Publication Date
JP2005108262A true JP2005108262A (en) 2005-04-21

Family

ID=34556838

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005000091A Pending JP2005108262A (en) 1994-09-09 2005-01-04 Data processor

Country Status (1)

Country Link
JP (1) JP2005108262A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010097558A (en) * 2008-10-20 2010-04-30 Toshiba Corp Virtual address cache memory and virtual address cache method
JP2012533135A (en) * 2009-07-13 2012-12-20 アップル インコーポレイテッド TLB prefetching
JP2013232210A (en) * 2008-02-29 2013-11-14 Qualcomm Inc Systems and methods for cache line replacement
CN114218153A (en) * 2021-12-06 2022-03-22 海飞科(南京)信息技术有限公司 Method, medium, program product, system and apparatus for storage management

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013232210A (en) * 2008-02-29 2013-11-14 Qualcomm Inc Systems and methods for cache line replacement
US8812789B2 (en) 2008-02-29 2014-08-19 Qualcomm Incorporated Systems and methods for cache line replacement
JP2010097558A (en) * 2008-10-20 2010-04-30 Toshiba Corp Virtual address cache memory and virtual address cache method
JP2012533135A (en) * 2009-07-13 2012-12-20 アップル インコーポレイテッド TLB prefetching
CN114218153A (en) * 2021-12-06 2022-03-22 海飞科(南京)信息技术有限公司 Method, medium, program product, system and apparatus for storage management
CN114218153B (en) * 2021-12-06 2023-11-14 海飞科(南京)信息技术有限公司 Method, medium, program product, system, and apparatus for storage management

Similar Documents

Publication Publication Date Title
JP3740195B2 (en) Data processing device
JP3713312B2 (en) Data processing device
US5526504A (en) Variable page size translation lookaside buffer
US6532528B1 (en) Data processor and data processor system having multiple modes of address indexing and operation
US6324634B1 (en) Methods for operating logical cache memory storing logical and physical address information
US5265227A (en) Parallel protection checking in an address translation look-aside buffer
JP5628404B2 (en) Cache memory attribute indicator with cached memory data
CN110998549B (en) Address translation cache
US6189074B1 (en) Mechanism for storing system level attributes in a translation lookaside buffer
US6901501B2 (en) Data processor
US20050027961A1 (en) System and method for resolving virtual addresses using a page size tag
JPH10177520A (en) Data processor and data processing system
JPH04320553A (en) Address converting mechanism
JP6478843B2 (en) Semiconductor device and cache memory control method
JP2007280421A (en) Data processor
JP2001222470A (en) Translation look aside buffer circuit
JP2930071B2 (en) Information processing device and processor
JP2005108262A (en) Data processor
US7076635B1 (en) Method and apparatus for reducing instruction TLB accesses
CN115794681A (en) Multi-level extensible TLB structure applicable to RISC-V
JP2000267932A (en) Tag address comparing device
JP2003337790A (en) Bus control circuit and processor
JPH024016B2 (en)
JP2011180969A (en) Data processor
JPH1027134A (en) Address converter and processor using the converter

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050104

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070306

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070313

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070514

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20070529

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070627