JP3055031B2 - A microprocessor that performs selectable alignment checking on memory references. - Google Patents

A microprocessor that performs selectable alignment checking on memory references.

Info

Publication number
JP3055031B2
JP3055031B2 JP2085074A JP8507490A JP3055031B2 JP 3055031 B2 JP3055031 B2 JP 3055031B2 JP 2085074 A JP2085074 A JP 2085074A JP 8507490 A JP8507490 A JP 8507490A JP 3055031 B2 JP3055031 B2 JP 3055031B2
Authority
JP
Japan
Prior art keywords
bit
level
program
memory
address
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.)
Expired - Lifetime
Application number
JP2085074A
Other languages
Japanese (ja)
Other versions
JPH02287741A (en
Inventor
ジヨン・エイチ・クロフオード
アシシユ・ビイ・デイクシツト
Original Assignee
インテル・コーポレーシヨン
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 インテル・コーポレーシヨン filed Critical インテル・コーポレーシヨン
Publication of JPH02287741A publication Critical patent/JPH02287741A/en
Application granted granted Critical
Publication of JP3055031B2 publication Critical patent/JP3055031B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0751Error or fault detection not based on redundancy
    • G06F11/0763Error or fault detection not based on redundancy by bit configuration check, e.g. of formats or tags
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/073Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a memory management context, e.g. virtual memory or cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0751Error or fault detection not based on redundancy
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3648Software debugging using additional hardware

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)
  • Debugging And Monitoring (AREA)

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は半導体マイクロプロセツサの分野に関する。The present invention relates to the field of semiconductor microprocessors.

〔従来の技術及び発明が解決しようとする問題点〕[Problems to be solved by conventional technology and invention]

本発明は、マイクロプロセツサの内部で「モードビツ
ト」により制御される整列検査機能を実行する方式を扱
う。この概念を使用すると、プログラマーは、メモリ参
照が整列されていないアドレスに対するものである場合
に故障(フォルト)が発生されるか否かを選択すること
がきる。本発明の現時点で好ましい実施例は、486TM
ロセツサとしても知られているIntel 80486マイクロプ
ロセツサのアーキテクチヤに組込まれる。486TMマイク
ロプロセツサは、同じように386TMプロセツサと呼ばれ
ているIntelの80386マイクロプロセツサを改良したもの
である。(Intel,80386,386,80486及び486はIntel Corp
orationの商標である。) 80486マイクロプロセツサは、X86シリーズのプロセツ
サの中の1つの型である32ビツト高性能プロセツサであ
る。これは、オブジエクトコードに関し、80386プロセ
ツサと互換性を有する。従つて、80486プロセツサは、
このシリーズの以前のプロセツサ用として開発されたコ
ードを実行することができる。概して、80486マイクロ
プロセツサは、命令1つ当たりの平均クロツク数により
測定したときに性能を少なくとも2.5倍に向上させるこ
とを目的として、80386アーキテクチヤを再実現したも
のである。本発明は、この性能向上を助ける80486マイ
クロプロセツサのそのような1つの特徴を表わす。
The present invention addresses a scheme for performing an alignment check function controlled by "mode bits" inside a microprocessor. Using this concept, a programmer can choose whether a fault will be generated if a memory reference is to an unaligned address. The presently preferred embodiment of the present invention is incorporated into the architecture of an Intel 80486 microprocessor, also known as a 486 processor. The 486 microprocessor is an improvement on Intel's 80386 microprocessor, also called the 386 processor. (Intel, 80386, 386, 80486 and 486 are Intel Corp.
oration is a trademark. The 80486 microprocessor is a 32-bit high-performance processor, a type of X86 series processor. It is compatible with the 80386 processor for object code. Therefore, the 80486 processor is
It can execute code developed for earlier processors in this series. In general, the 80486 microprocessor is a re-implementation of the 80386 architecture with the goal of improving performance by at least 2.5 times as measured by the average number of clocks per instruction. The present invention represents one such feature of the 80486 microprocessor that assists in this performance enhancement.

上述のように、本発明は、プログラム中のメモリ参照
が整列されていないアドレスに対するものである場合に
故障(フォルト)を発生するか否かを選択することがで
きるという能力を、マイクロプロセツサに付加する。従
来、1つのデータのアドレスは、アドレスがデータの長
さの倍数である場合に、整列していると考えられる。1
バイトのデータは常に整列している。2バイトのデータ
は、そのアドレスが2の倍数であれば、整列している。
4バイトのデータは、そのアドレスが4の倍数であれ
ば、整列している。その他の長さをもつデータの場合も
同様である。従つて、アドレスがデータのサイズの倍数
であるときには、データは一般に整列している。
As described above, the present invention provides the microprocessor with the ability to select whether a fault occurs if a memory reference in the program is to an unaligned address. Add. Conventionally, one data address is considered aligned if the address is a multiple of the data length. 1
Byte data is always aligned. Two-byte data is aligned if its address is a multiple of two.
Four bytes of data are aligned if the address is a multiple of four. The same applies to data having other lengths. Thus, when the address is a multiple of the size of the data, the data is generally aligned.

マイクロプロセツサの内部メモリアーキテクチヤを考
えると、整列メモリ参照の重要性は明白になる。多くの
コンピュータにおいては、メモリは、データサイズがメ
モリの幅と等しくなるように編成されている。32ビツト
により編成されたメモリであれば、4の倍数であるアド
レスを有する32ビツトの項目を、1つのメモリクロツク
サイクルの中でアクセスすることができる。(32ビツト
語は倍長語又はd語と呼ばれる場合が多い−1つのd語
は4つの別個のバイト、たとえば、0,1,2及び3から構
成されている。)80386CPUと、80486CPUは、共に、任意
のアドレスでデータを参照することができる。参照が整
列されていない場合には、マイクロプロセツサは、性能
の上で不利になる。これは、データをアクセスする、す
なわち、参照するために、追加のメモリサイクルを必要
とするという状況となつて現われる。
Given the microprocessor's internal memory architecture, the importance of aligned memory references becomes apparent. In many computers, the memory is organized such that the data size is equal to the width of the memory. If the memory is organized in 32 bits, a 32-bit item having an address that is a multiple of 4 can be accessed in one memory clock cycle. (32-bit words are often referred to as doublewords or d-words-one d-word is made up of four separate bytes, for example, 0, 1, 2 and 3). In both cases, data can be referred to at any address. If the references are not aligned, the microprocessor suffers a performance penalty. This manifests itself as a situation where accessing or referring to data requires additional memory cycles.

アドレス3で始まる32ビツトd語をメモリ参照する場
合を考える。従来の方法においては、プロセツサは2つ
のd語を参照する。すなわち、まず、バイト3を取出す
ためにアドレス0で始まるd語を参照し、次に、残るバ
イト4,5及び6を取出すためにアドレス4で始まるd語
を参照することになるであろう。必要なバイトをアクセ
スした後、プロセツサは、何らかの方法によつて、それ
らのバイトを一体に接合して、データ項目、すなわち、
メモリ参照を再編成する。すなわち、従来の方法は、少
なくとも2つの点で、すなわち、(1)少なくとも2つ
の付加メモリサイクルが必要である点と、(2)データ
項目を新たな記憶場所に再構成、すなわち「接合」する
という点で不利である。
Consider the case where a 32-bit d word starting at address 3 is referred to in memory. In the conventional method, the processor refers to two d words. That is, one would first refer to the d word starting at address 0 to retrieve byte 3, and then refer to the d word starting at address 4 to retrieve the remaining bytes 4, 5, and 6. After accessing the required bytes, the processor in some way joins the bytes together to form a data item,
Reorganize memory references. That is, the conventional method reconstructs, or "joins," at least two points: (1) at least two additional memory cycles are required, and (2) the data item to a new storage location. It is disadvantageous in that.

この欠点を回避するために、この方法に代わるいくつ
かの方法が試みられている。たとえば、80386におい
て、メモリ参照ごとに、それを進行するインラインコー
ドを挿入することにより、整列検査を実行することがで
きる。このコードはレジスタへアドレスを発生し、次
に、レジスタの下位ビツトをマスキングする。マスキン
グ動作は、同じレジスタコンポーネントを取出し且つ整
列変位を加えることにより、実現される。基本的には、
この方法を使用して各メモリ参照を進行するには、一連
の3つの別個の命令が実行されなければならない。通常
のプログラムでは、それらの命令の半分が何らかの方法
によりメモリを参照するので、これは許容しえないオー
バヘツドを表わす。すなわち、性能は20から30パーセン
トも劣化してしまう。
In order to avoid this disadvantage, several alternatives have been attempted. For example, at 80386, an alignment check can be performed for each memory reference by inserting inline code that proceeds through it. This code generates an address to the register, which in turn masks the lower bits of the register. The masking operation is achieved by taking the same register component and applying an alignment displacement. Basically,
To advance each memory reference using this method, a series of three separate instructions must be executed. In normal programs, this represents an unacceptable overhead, since half of those instructions refer to memory in some way. That is, performance degrades by 20 to 30 percent.

機械(マシン)の中には、全てのメモリ参照を整列さ
せなければならないものもあり、その中で最も顕著なの
が新しいRISCプロセツサである。このような機械(マシ
ン)は、整列されていないデータへの参照に際して、必
ず故障を起こす。しかしながら、故障は選択可能ではな
いので、常に必ず故障が発生されることになる。非人工
知能環境の多く(特にCOBOL)は整列されていないデー
タを参照する能力から利益を受けているので、これは問
題である。別の種類の機械では、整列されていない参照
が可能であるが、上述のような性能の低下を伴なう。そ
のような機械はIntel 80386,DigitalのVAX及びIBM370を
含む。従つて、この分野で必要とされているのは、上述
のような性能上の不利がなく、任意に整列されていない
アドレスに対し故障を発生する新たな方法である。
Some machines require all memory references to be aligned, the most prominent of which is the new RISC processor. Such a machine always fails when referring to unaligned data. However, failures are not always selectable, so failures will always occur. This is a problem because many non-artificial intelligence environments (particularly COBOL) benefit from the ability to reference unaligned data. In other types of machines, unaligned references are possible, but with the aforementioned performance degradation. Such machines include the Intel 80386, Digital VAX and IBM370. Therefore, what is needed in the art is a new method of failing for addresses that are not arbitrarily aligned, without the performance penalties described above.

以下の説明から明らかであるように、本発明は、ユー
ザーにより選択可能であり且つ追加命令を必要としない
整列検査を実行する手段を提供する。さらに、本発明
は、整列検査手順に関して2つのマスキングレベル、す
なわち、アプリケーションレベルと、オペレーテイング
システムレベルとにおけるマスキンクを支援する。トラ
ツプ又は故障自体をマスクすることが可能であるので、
本発明は、ユーザーに、整列検査を制御する2つの機会
を与えることになる。
As will be apparent from the following description, the present invention provides a means for performing an alignment check that is user selectable and requires no additional instructions. In addition, the present invention supports masking at two masking levels for the alignment inspection procedure: the application level and the operating system level. Since it is possible to mask the trap or the fault itself,
The present invention will give the user two opportunities to control the alignment inspection.

従つて、本発明の目的は、偶発的にデータが整列して
いない状態を検出する手段を提供することである。プロ
グラムデバツクのために、データを整列させることは性
能を相当に向上させる。
Accordingly, it is an object of the present invention to provide a means for detecting a state where data is not aligned accidentally. For program debugging, aligning data significantly improves performance.

本発明の別の目的は、ポインタの種類を識別するため
に下位のアドレスビツトを使用し、続いて、整列アドレ
スを得るためにそれらのタグビツトを「調整する」よう
に小さな変位を使用するある種の人工知能(AI)プログ
ラムにおいて、整列故障(整列フォルト)を発生する手
段を提供することである。本発明は、性能の大きな低下
を伴なわずに、ポインタの型の検査を実行する。実験測
定によれば、本発明は、80386マイクロプロセツサで実
行される平均的なAIプログラムについて、30パーセント
の性能向上を実現することがわかつている。別の研究で
は、他の機械において20パーセントの向上が示されてい
る。
It is another object of the present invention to use the lower address bits to identify the type of pointer, and then use a small displacement to "adjust" those tag bits to obtain an aligned address. To provide a means for generating an alignment fault in an artificial intelligence (AI) program. The present invention performs pointer type checking without significant performance degradation. Experimental measurements have shown that the present invention achieves a 30% performance improvement for an average AI program running on an 80386 microprocessor. Another study has shown a 20 percent improvement on other machines.

〔問題点を解決するための手段〕[Means for solving the problem]

整列していないデータの参照を検出する手段を含むマ
イクロプロセツサを説明する。検出手段は、それがイネ
ーブルされ且つ整列していないデータオブジエクトに対
して参照が実行されたときに、現在プログラムの実行を
中断する故障が発生されるように、選択可能である。検
出手段は、ここで説明するマイクロプロセツサのセグメ
ンテーシヨン装置の一部である。好ましい実施例におい
ては、マイクロプロセツサは、様々な特権レベルである
いくつかのデータオブジエクトに対するアクセスを許可
する保護メカニズムをさらに有する。
A microprocessor including means for detecting unaligned data references is described. The detection means is selectable such that when a reference is made to a data object that is enabled and not aligned, a fault is generated that interrupts the current execution of the program. The detection means is part of the microprocessor segmentation device described herein. In the preferred embodiment, the microprocessor further has a protection mechanism that allows access to some data objects at various privilege levels.

検出手段は、マイクロプロセツサ内に記憶されている
2つのモードビツトを含む。第1のモードビツトは、最
下位の特権をもつ実行レベル(すなわち、アプリケーシ
ヨンレベル)で故障のマスキングを実行し、第2のモー
ドビツトは、最上位の特権レベル(すなわち、オペレー
テイングシステムレベル)で故障のマスキングを実行す
る。従つて、モードビツト、すなわち、マスクビツトに
対するアクセスは2つの異なるレベルで行われることに
なる。2つのモードビツトは、検出手段をイネーブルさ
せるべきときには、共に、「1」にセツトされなければ
ならない。整列検査を任意にイネーブルするために2つ
の別個のモードビツトを使用することにより、プログラ
ミングに関して最良の融通性が得られる。
The detecting means includes two mode bits stored in the microprocessor. The first mode bit performs fault masking at the lowest privileged execution level (ie, application level), and the second mode bit performs fault masking at the highest privilege level (ie, operating system level). Perform the masking of Therefore, access to the mode bit, ie, the mask bit, is performed at two different levels. The two mode bits must both be set to "1" when the detection means are to be enabled. The use of two separate mode bits to optionally enable alignment checking provides the best programming flexibility.

〔実施例〕〔Example〕

本発明は、以下に挙げる本発明の好ましい実施例の詳
細な説明及び添付の図面から、さらに十分に理解される
であろう。ただし、好ましい実施例の説明と、それを示
す図面は、本発明を特定の実施例に限定するものと解釈
されてはならず、単に説明と理解を助けるために提示さ
れるにすぎない。
The present invention will be more fully understood from the detailed description of the preferred embodiments thereof given below and the accompanying drawings. However, the description of the preferred embodiments, and the accompanying drawings, are not to be construed as limiting the invention to any particular embodiment, but are merely provided to aid explanation and understanding.

整列していないメモリ参照が検出されるたびに、故障
を発生すべきか否かを選択する手段を含むマイクロプロ
セツサを説明する。以下の説明中、本発明を完全に理解
させるために、特定のビツト長さ、レジスタ内容、論理
図などの多数の事項を特定して詳細に挙げるが、本発明
を実施する際に、そのような特定の詳細な事項を採用す
る必要はないことは、当業者には自明であろう。また、
本発明を無用にわかりにくくするのを避けるため、周知
の構造や回路を詳細に示さない場合もある。
A microprocessor is described that includes means for selecting whether or not a fault should occur whenever an unaligned memory reference is detected. In the following description, for the purpose of providing a thorough understanding of the present invention, numerous details, such as specific bit lengths, register contents, and logic diagrams, will be identified and described in detail in practicing the invention. It will be obvious to one skilled in the art that it is not necessary to employ any particular detail. Also,
In other instances, well-known structures and circuits have not been shown in detail in order not to unnecessarily obscure the present invention.

詳細な実施例を説明する前に、まず、80486マイクロ
プロセツサのいくつかのアーキテクチヤ上の特徴を考え
てみることは、本発明を理解するためには有益である。
Before describing the detailed embodiments, it is helpful to understand the present invention first to consider some architectural features of the 80486 microprocessor.

基本マイクロプロセツサのアーキテクチヤ コンピュータが我々の社会で果たす役割がますます重
要になるにつれて、保護仮想アドレスモード(保護モー
ド)を実現するマイクロプロセツサは多くなつている。
80486マイクロプロセツサに組込まれた保護モードによ
れば、複数のアプリケーシヨンを同時に実行することが
できるが、1つのアプリケーシヨンにおける故障が他の
アプリケーシヨンに影響を及ぼさないように、アプリケ
ーシヨンを互いに隔離している。保護メカニズムの中心
を成す特徴はセレクタである。プログラムは、システム
のいずれかの部分を直接アクセスするのではなく、1つ
のシステムオブジエクトに対するアクセスを許可するセ
レクタを扱う。各オブジエクトに対し、それと関連する
情報、たとえば、そのオブジエクトの場所、サイズ、使
用制限などに関する情報が存在している。80486マイク
ロプロセツサにおいては、記述子と呼ばれるセレクタに
より参照されたデータを、オペレーテイングシステムの
みがアクセスする。
Basic Microprocessor Architectures As computers play an increasingly important role in our society, more and more microprocessors implement protected virtual address mode (protected mode).
The protected mode built into the 80486 microprocessor allows multiple applications to run at the same time, but keeps the applications together so that a failure in one application does not affect other applications. Isolated. The central feature of the protection mechanism is the selector. The program does not directly access any part of the system, but rather a selector that allows access to one system object. For each object, there is information associated with it, for example, information about the location, size, usage restrictions, etc. of the object. In the 80486 microprocessor, only the operating system accesses data referenced by a selector called a descriptor.

記述子はシステムオブジエクトを詳細に記述する。メ
モリセグメントはシステムオブジエクトの一種である。
その他のシステムオブジエクトとしては、保護メカニズ
ムを支援する表、プロセツサ状態を記憶する特殊セグメ
ントなどがある。ハードウエアは、セレクタを検査する
ことにより、そのセレクタがどの記述子と関連している
かを判定し、記述子が指示しているオブジエクトを判定
する。記述子が指示する項目の1つは、オブジエクトの
特権レベルである。プログラムがセレクタによつてオブ
ジエクトに対するアクセスを要求したとき、アクセスは
否定される(要求が保護メカニズムの規則に違反してい
る場合には、制御は、そのプログラムから、オペレーテ
イングシステム中の指定ルーチンへ移行する)か、アク
セスは認められはするが許可されない(たとえば、オブ
ジエクトが、現在、メモリにない場合には、オペレーテ
イングシステムのルーチンはオブジエクトをメモリ内へ
スワツプし、制御をプログラムに戻す)か、要求された
特権レベルでアクセスが許可される。
The descriptor describes the system object in detail. A memory segment is a type of system object.
Other system objects include tables that support protection mechanisms and special segments that store processor state. By examining the selector, the hardware determines which descriptor the selector is associated with and determines the object to which the descriptor points. One of the items indicated by the descriptor is the privilege level of the object. When a program requests access to an object by a selector, access is denied (if the request violates the rules of the protection mechanism, control is passed from the program to a designated routine in the operating system). Migrate), or access is granted but not granted (eg, if the object is not currently in memory, the operating system routine swaps the object into memory and returns control to the program). Access is granted at the requested privilege level.

80486プロセツサは、第1図に示すように3,2,1,0と番
号付けされた、徐々に大きくなる4つの特権レベルを支
援する。特権レベル0は最上位の特権レベルである。コ
ードセグメント(cs)レジスタにおけるセレクタの特権
レベルは現在実行中のルーチンの優先度を識別するもの
で、現在特権レベル(CPL)と呼ばれる。信頼性を保つ
ため、オペレーテイングシステムの最も信頼しうるコー
ドのみが最上位特権レベル(CPL=0)でランする。故
障を生じるおそれのあるアプリケーシヨンは最下位レベ
ル(CPL=3)でランされる。第1図では、様々な特権
レベルを一連の同心リングとして示している。(特権と
いう用語は、通常では許可されない権利又は利益を示唆
する。80486マイクロプロセツサにおいては、最も内側
のリンクでランする手順は外側のリングにあるデータオ
ブジエクトをアクセスすることができるが、外側のリン
クの手順はより大きな特権をもつ内側のリングのオブジ
エクトをアクセスできない。) 以下にさらに詳細に説明するが、本発明では、整列検
査機能をアプリケーシヨンレベル(たとえば、CPL=
3)と、オペレーテイングシステムレベル(たとえば、
CPL=0)の双方でマスキングすることができる。この
ように、2つの異なる特権レベルでマスキングを選択可
能であるため、本発明は、整列していないデータの参照
時に常にトラツプするか、全くトラツプしないかのいず
れかである機械とも互換性をもつている。1例を挙げれ
ば、オペレーテイングシステムレベルで、整列検査機能
をリセツト時にデイスエーブルすることにより、それに
80386マイクロプロセツサとの互換性を与えても良い。
The 80486 processor supports four gradually increasing privilege levels, numbered 3,2,1,0 as shown in FIG. Privilege level 0 is the highest privilege level. The selector privilege level in the code segment (cs) register identifies the priority of the currently executing routine and is called the current privilege level (CPL). To maintain reliability, only the most trusted code of the operating system runs at the highest privilege level (CPL = 0). Applications that may fail are run at the lowest level (CPL = 3). FIG. 1 shows the various privilege levels as a series of concentric rings. (The term privilege implies a right or interest not normally granted. In an 80486 microprocessor, the procedure of running on the innermost link can access data objects on the outer ring, but not on the outer ring. Link procedure cannot access objects in the inner ring with greater privileges.) As will be described in further detail below, the present invention provides that the alignment check function can be performed at the application level (eg, CPL =
3) and operating system level (for example,
CPL = 0). The ability to select masking at two different privilege levels thus allows the present invention to be compatible with machines that either always trap when referring to unaligned data or do not trap at all. ing. For example, at the operating system level, disabling the alignment check function at reset can help
Compatibility with the 80386 microprocessor may be provided.

C又はPascalのようなある種のプログラミング言語に
おいては、コンパイル時にデータの型が宣言されたと
き、セレクタにはそのデータの型が永久的にタグ付けさ
れる。言いかえれば、プログラムの実行中に、データの
型は変化しない。しかしながら、LISP又はPrologなどの
いくつかのAI言語では、ラン/時間の型の割当てにさら
に融通性が盛り込まれている。そのような言語の場合に
は、プログラムの実行につれて、データの型は変化する
可能性がある。そのため、ユーザーは、複数の型に作用
する関数(たとえば、Xを整数,短精度実数,長精度実
数,複素数などとしたときの を規定することができる。従つて、プログラム中の特定
の1点におけるデータの型に応じて、複数の機能を実行
できる。
In some programming languages, such as C or Pascal, when a data type is declared at compile time, the selector is permanently tagged with that data type. In other words, the data type does not change during the execution of the program. However, some AI languages, such as LISP or Prolog, provide more flexibility in assigning run / time types. In such a language, the data type may change as the program executes. For this reason, the user must use a function that operates on multiple types (for example, when X is an integer, a short real number, a long real number, a complex number, etc.) Can be defined. Therefore, a plurality of functions can be executed according to the type of data at a specific point in the program.

LISPプログラム又はPrologプログラムにおいては、ポ
インタフイールドはアドレスと、データの型の双方を指
示する。データの型を識別する項目はタグと呼ばれる。
プログラマーは、32ビツトポインタの最下位2ビツトを
最上位タグビツトとして使用する。データの型がある1
つの型でなければならないか又は演算が無効である場
合、あるいは、プログラマーがデータの型を圧倒的に多
い頻度である1つの型であると予期する場合には、ユー
ザーは、タグが所与の値であると仮定するコードを発生
することができる。このコードは下位タグビツトを取消
す。たとえば、タグが2の値を有するならば、コード
は、タグビツトを相殺するために、−2の値を加算する
と考えられる。このオフセツト又は取消しは変位として
も知られている。変位が正しければ、メモリ項目は整列
しており、故障又はトラツプを受けずにデータを参照す
ることができる。
In LISP or Prolog programs, the pointer field indicates both the address and the type of data. Items that identify the type of data are called tags.
The programmer uses the least significant two bits of the 32-bit pointer as the most significant tag bit. Data type 1
If the type must be one or the operation is invalid, or if the programmer expects the type of data to be one type that is by far the most frequent type, the user must Code can be generated that assumes a value. This code cancels the lower tag bit. For example, if the tag has a value of 2, the code would add a value of -2 to offset the tag bit. This offset or cancellation is also known as a displacement. If the displacement is correct, the memory items are aligned and the data can be referenced without failure or trap.

本発明を使用してAIプログラムを実行する場合、変位
がタグと整合している限り、メモリ参照は整列してい
る。しかしながら、変位がタグと整合しない場合には、
本発明の整列検査装置は、任意に、トラツプ又は故障を
発生する。これが起こると、現在実行場所(CS:EIP)
と、フラグレジスタの内容(EFLAGS)とはスタツクにセ
ーブされ、制御は、割込みハンドラとして知られるソフ
トウエアルーチンへ移行する。それぞれの故障条件と関
連する1つの特定の割込み番号がある。スタツクにセー
ブされた命令ポインタは、故障が起こつた後、その故障
の原因となつた命令を指示する。そこで、オペレーテイ
ングシステムはその条件を修正することができ、プログ
ラムの実行を再開することができる。
When running an AI program using the present invention, the memory references are aligned as long as the displacement is aligned with the tag. However, if the displacement does not match the tag,
The alignment inspection apparatus of the present invention arbitrarily causes traps or failures. When this happens, the current execution location (CS: EIP)
And the contents of the flag register (EFLAGS) are saved on the stack, and control transfers to a software routine known as an interrupt handler. There is one specific interrupt number associated with each fault condition. The instruction pointer saved in the stack points to the instruction that caused the failure after the failure occurred. Thus, the operating system can correct the condition and resume the execution of the program.

マイクロプロセツサの全体ブロツク線図 第4図に関して説明する。第4図には、以上説明した
整列検査機能を組込んだ本発明によるマイクロプロセツ
サが全体ブロツク線図の形で示されている。マイクロプ
ロセツサは、32ビツト外部データバス30に結合されると
共に、アドレスバス31及びいくつかの別の制御線にさら
に結合されているバスインタフエース装置10を含む。バ
スインタフエース装置10が扱うのは物理(ハードウエ
ア)アドレスのみであるので、オペランドアドレスは、
まず、セグメンテーシヨン装置14と、ページング装置13
とを通過しなければならない。また、バスインタフエー
ス装置10には、キヤツシユ装置12と、先取り装置11も結
合されている。先取り装置は、次の命令アドレスのメモ
リの内容を取出すために、絶えずバスインタフエース装
置に対し間合せしている。先取り装置は、データを受信
すると、直ちにそのデータを待ち行列の中に挿入し、待
ち行列が一杯でなければ、さらに別の32ビツトのメモリ
内容を要求する。
FIG. 4 is a general block diagram of the microprocessor. FIG. 4 shows a microprocessor according to the present invention incorporating the above-described alignment inspection function in the form of a general block diagram. The microprocessor includes a bus interface device 10 coupled to a 32-bit external data bus 30 and further coupled to an address bus 31 and some other control lines. Since only the physical (hardware) address is handled by the bus interface device 10, the operand address is
First, the segmentation device 14 and the paging device 13
And must pass through. Further, a cache device 12 and a prefetch device 11 are also connected to the bus interface device 10. The look-ahead device is constantly adjusting to the bus interface device to retrieve the contents of the memory at the next instruction address. As soon as the prefetch device receives the data, it inserts the data into a queue and, if the queue is not full, requests another 32 bits of memory content.

キヤツシユ装置12は、データキヤツシユと、キヤツシ
ユメモリのアクセツシングを制御するコントローラとを
含む。先取り装置11と、キヤツシユ装置12とは、共に、
32ビツトバスを介してセグメンテーシヨン装置14に結合
されている。セグメンテーシヨン装置14は区分化アドレ
ス(セグメント化されたアドレス)を線形アドレスに変
換する。
The cache device 12 includes a data cache and a controller that controls access to the cache memory. The prefetching device 11 and the cache device 12 are both
It is coupled to the segmentation device 14 via a 32-bit bus. The segmentation device 14 converts a segmented address (segmented address) into a linear address.

セグメンテーシヨン装置14は、「LA(すなわち、Line
ar Address(線形アドレス))バス」とも呼ばれる32ビ
ツト線形アドレスバス20を介して、ページング装置13
と、キヤツシユ装置12とに結合されている。ページング
装置13は、セグメンテーシヨン装置14により発生された
線形アドレスを取出し、それらを物理アドレスに変換す
る。ページングがデイスエーブルされた場合には、セグ
メンテーシヨン装置の線形アドレスが物理アドレスにな
る。ページングがイネーブルされると、80486マイクロ
プロセツサの線形アドレスはページと呼ばれる複数の40
96バイトブロツクに分割される。それぞれのページを全
く異なるアドレスにマツピングすることができる。本発
明を理解するために、便宜上、セグメンテーシヨン装置
14は市販のIntel 80386マイクロプロセツサに使用され
ているのと同じ装置であると仮定しても良い。Intel 80
386マイクロプロセツサのセグメンテーシヨン装置及び
ページング装置は、1985年6月13日に出願された同時係
属出願−出願番号744,389,名称「Memory Management fo
r Microprocessor」,譲受人は本発明と同じである−に
説明されている。
The segmentation device 14 has a “LA (ie, Line
The paging device 13 via a 32-bit linear address bus 20, also called an "ar Address (linear address) bus"
And the cache device 12. Paging device 13 takes the linear addresses generated by segmentation device 14 and translates them into physical addresses. If paging is disabled, the linear address of the segmentation device becomes the physical address. When paging is enabled, the linear address of the 80486 microprocessor is stored in multiple 40
Divided into 96 byte blocks. Each page can be mapped to a completely different address. For the sake of understanding the invention, for convenience, a segmentation device
It may be assumed that 14 is the same device used in a commercially available Intel 80386 microprocessor. Intel 80
The 386 microprocessor segmentation and paging devices are described in co-pending application filed June 13, 1985, application number 744,389, entitled "Memory Management fo
r Microprocessor ", assignee is the same as the present invention.

マイクロプロセツサ内で、命令は命令デコーダ装置15
に結合される。デコーダ装置は先取り装置と同じように
動作し、先取り待ち行列から個々のバイトを取出して、
次の命令を完了するために必要なバイトの数を決定す
る。デコーダ装置は制御装置19と共に動作するが、制御
装置19は、マイクロコード命令を記憶しており、マイク
ロプロセツサに対して複数の制御信号シーケンスを供給
する。命令デコーダ装置15は制御装置19に結合されるも
のとして示され、その制御装置19はセグメンテーシヨン
装置14と、データ装置18と、浮動小数点装置17とに結合
されるものとして示されている。データ装置18は、Inte
l 80386プロセツサにより実行されるALU機能と同様にし
てALU機能を実行する演算論理装置(ALU)である。
In the microprocessor, the instructions are sent to the instruction decoder unit 15
Is combined with The decoder device operates the same as the prefetch device, fetching individual bytes from the prefetch queue,
Determine the number of bytes required to complete the next instruction. The decoder device operates in conjunction with the controller 19, which stores the microcode instructions and provides a plurality of control signal sequences to the microprocessor. The instruction decoder unit 15 is shown coupled to a control unit 19, which is shown coupled to a segmentation unit 14, a data unit 18 and a floating point unit 17. Data device 18 is Inte
l An arithmetic and logic unit (ALU) that performs ALU functions in a manner similar to the ALU functions performed by the 80386 processor.

マイクロプロセツサは、浮動小数点演算を実行する浮
動小数点装置17をさらに含む。浮動小数点装置17並びに
マイクロプロセツサのその他の装置の厳密な構成は、本
発明を理解する上で重要ではない。以下、本発明を理解
するために必要である場合に限り、マイクロプロセツサ
の様々な装置の間の信号の流れを説明する。
The microprocessor further includes a floating point device 17 for performing floating point operations. The exact construction of the floating point unit 17, as well as other units of the microprocessor, is not important to understanding the present invention. The signal flow between the various devices of the microprocessor will now be described only as necessary to understand the invention.

好ましい実施例の説明 本発明の選択可能整列検査装置は、外部からは、プロ
グラマーには2つの新状態(モード)ビツトとして現わ
れているように見える。一方のビツトはEFLAGASレジス
タ内に位置し、AC(整列検査)ビツトと呼ばれる。EFLA
GSレジスタは現在命令流れに関する状態情報を保持する
(EIPジスタは現在実行中の命令のアドレスを記憶して
いる)と共に、異なる様々な命令に関連するいくつかの
フイールドを保持する。AM(整列マスキング)ビツトと
呼ばれる他方のビツトは、制御レジスタCRO内に位置し
ている。
Description of the Preferred Embodiment The selectable alignment tester of the present invention appears to the programmer to appear to the programmer as two new state (mode) bits. One bit is located in the EFLAGAS register and is called the AC (alignment check) bit. EFLA
The GS register holds state information about the current instruction stream (the EIP register stores the address of the currently executing instruction), as well as some fields associated with various different instructions. The other bit, called the AM (alignment masking) bit, is located in the control register CRO.

次に、第2図を参照して、EFLAGSレジスタの詳細を説
明する。(尚、フラグビツト1,3,5,15及び19から31は
「不定」である。)ACビツトはビツト位置18に位置して
いる。ACビツトは、メモリ参照が整列していないアドレ
スである場合に、故障の発生をイネーブルする。たとえ
ば、これは、奇数アドレスに対する語アクセス、又はO
MOD4ではないアドレスに対するd語アクセス、又はO MO
D8ではないアドレスに対する8バイト参照により引起こ
されると考えることができる。整列の故障はレベル3で
のみ発生される。すなわち、レベル0,1及び2では、AC
ビツトの設定は無視される(暗示的に0)。記述子表に
対する(セレクタロードに関する)参照は、記述子表を
「出現させている」命令がレベル3で実行されている場
合でも、暗示的にレベル0の参照である。好ましい実施
例では、整列の故障は、誤りコード0を伴なつて、割込
みビツト17を介して報告される。(ビツト17は、1に設
定されたとき、現在実行中の命令流れがX86コードであ
ることを示す仮想モード(VM)ビツトである。) 以下の表は、マイクロプロセツサの様々なデータの型
について要求される整列を示したものである。
Next, the details of the EFLAGS register will be described with reference to FIG. (Note that the flag bits 1, 3, 5, 15, and 19 to 31 are undefined.) The AC bit is located at the bit position 18. The AC bit enables the occurrence of a fault if the memory reference is an unaligned address. For example, this can be a word access to an odd address, or O
D word access to an address other than MOD4, or O MO
It can be considered caused by an 8-byte reference to an address that is not D8. Alignment faults occur only at level 3. That is, at levels 0, 1, and 2, AC
Bit settings are ignored (implicitly 0). A reference to the descriptor table (with respect to the selector load) is an implicit level 0 reference, even if the instruction that "emits" the descriptor table is executed at level 3. In the preferred embodiment, alignment failures are reported via interrupt bit 17 with an error code of zero. (Bit 17 is a virtual mode (VM) bit that, when set to 1, indicates that the currently executing instruction stream is X86 code.) The following table shows the various data types of the microprocessor. 3 shows the required alignment for.

整列検査機能はタスクごとに別個にイネーブルされな
ければならないので、各タスクが独自の「EFLAGS」の
「コピー」を有していることから、この機能はEFLAGSレ
ジスタに含まれている。
Since the alignment check function must be enabled separately for each task, this function is included in the EFLAGS register because each task has its own "copy" of "EFLAGS".

次に第3図に関して説明する。第3図には、整列マス
ク制御ビツト(AM)を記憶する制御レジスタ(CRO)が
示されている。制御レジスタCROは、マイクロプロセツ
サのページング及び数値コプロセツサ動作を調整するい
くつかの制御レジスタの中の1つである。第3図に示す
ように、整列マスク制御ビツトはCROのビツト位置18に
ある。AMビツトは、EFLAGSにおけるACビツトが整列故障
を許容できるか否かを制御する。AM=0のとき、検査は
デイスエーブルされる(たとえば、80386マイクロプロ
セツサの互換性)が、AM=1のときには検査はイネーブ
ルされる。AMビツトは、特権レベル0でだけ、おそらく
はオペレーテイングシステムによつてのみアクセス可能
である。オペレーテイングシステムは、それが適切な割
込みハンドラを含んでいる場合に限り、整列故障をイネ
ーブルするために、このビツトを1に設定する。
Next, FIG. 3 will be described. FIG. 3 shows a control register (CRO) for storing the alignment mask control bit (AM). The control register CRO is one of several control registers that regulate the paging and numerical coprocessor operation of the microprocessor. As shown in FIG. 3, the alignment mask control bit is at bit position 18 of the CRO. The AM bit controls whether the AC bit in EFLAGS can tolerate an alignment fault. When AM = 0, the test is disabled (eg, 80386 microprocessor compatibility), but when AM = 1, the test is enabled. AM bits are accessible only at privilege level 0, and probably only by the operating system. The operating system sets this bit to one to enable alignment faults only if it contains the appropriate interrupt handler.

整列検査をイネーブルするために2つのビツトを使用
することにより、大きな融通性が得られる。AMビツト
は、全てのタスクに対して大域的(グローバル)である
レジスタCROの中に位置しているので、大域的(グロー
バル)にオペレーテイングシステムを制御し、オペレー
テイングシステムによつてのみ参照可能である。オペレ
ーテイングシステムが適切な割込みハンドラ(たとえ
ば、CROのビツト17)を含んでいるならば、AMビツト
は、通常、オペレーテイングシステムが初期設定される
ときにセツトされる。
Great flexibility is obtained by using two bits to enable alignment checking. The AM bit is located in the register CRO, which is global for all tasks, so it controls the operating system globally and can only be referenced by the operating system. It is. If the operating system includes a suitable interrupt handler (eg, bit 17 of the CRO), the AM bits are normally set when the operating system is initialized.

ACビツトはアプリケーシヨンレベルの制御を実行す
る。このビツトは、タスクスイツチでスワツプされ且つ
レベル3で実行中のアプリケーシヨンによりアクセス可
能であるEFAGSレジスタにある。EFLAGSはタスクスイツ
チにおいてスワツプされるので、各タスクが専用のEFLA
GSのコピーを有するかのように、従つて、独自の整列検
査器のコピーを有するかのように見える。通常、AIプロ
グラムはレベル3、すなわち、アプリケーシヨンレベル
でのみ整列検査を実行させれば良い。2つのマスクビツ
トに対するアクセスを可能にすることにより、プログラ
マーは、整列検査が実行されるか否かを選択するための
2つの機会、すなわち、アプリケーシヨンレベルにおけ
る機会(EFLAGSレジスタをプログラムによりクリア又は
セツトすることができる)と、オペレーテイングシステ
ムレベルにおける機会(AMビツトがクリア又はセツトさ
れる)とを有することになる。尚、2つのビツトは共に
全てのレベルでマスキングを実行する。しかしながら、
ACはレベル3以外の全てのレベルで暗示的にマスクされ
るが、AMビツトはレベル0でセツト/リセツト(すなわ
ち、制御)可能となるだけである。
The AC bits perform application level control. This bit is in the EFAGS register, which is swapped at the task switch and is accessible by the application running at level 3. Since EFLAGS are swapped in the task switch, each task has its own dedicated EFLAGS
It looks as though it has a copy of the GS, and therefore has its own copy of the alignment checker. Usually, the AI program only needs to execute the alignment check at level 3, that is, at the application level. By allowing access to the two mask bits, the programmer has two opportunities to select whether an alignment check is to be performed, i.e., at the application level (by clearing or setting the EFLAGS register programmatically). And the opportunity at the operating system level (AM bit is cleared or set). Note that both bits perform masking at all levels. However,
AC is implicitly masked at all levels except level 3, but the AM bit can only be set / reset (ie, controlled) at level 0.

本発明の整列検査器は、整列していないデータへのア
クセスを認識することを中心として実現されている。こ
れは、32ビツト線形アドレスバス20(第4図を参照)の
下位3ビツトと、バスサイクルの長さとを使用して、命
令デコーダ装置15又は制御装置19による命令に従つて実
行される。整列していないデータの参照による故障は、
線形アドレスも発生するセグメンテーシヨン装置14の中
で発生される。故障は制御装置19によりサービスされ
る。
The alignment checker of the present invention is realized mainly by recognizing access to unaligned data. This is performed according to an instruction by the instruction decoder unit 15 or the control unit 19, using the lower three bits of the 32-bit linear address bus 20 (see FIG. 4) and the length of the bus cycle. Failure due to reference to unaligned data
The linear address is also generated in the segmentation device 14 where it is also generated. The fault is serviced by the controller 19.

以下の表は、異なる長さのバスサイクルについて、整
列していないデータのアクセスをLAバス20の下位3ビツ
トの値との関係で規定したものである。バスサイクルの
長さは、命令デコーダ装置15又は制御装置19からの「バ
ス要求型」フイールドを復号することにより決定され
る。
The following table defines the access of unaligned data in relation to the values of the lower three bits of the LA bus 20 for bus cycles of different lengths. The length of the bus cycle is determined by decoding the "bus request type" field from the instruction decoder unit 15 or the control unit 19.

整列していないアクセスが起こつたことが判定されて
しまえば、故障を発生するために必要な他の条件を判定
するのは比較的簡単である。第5図に関連して説明する
と、第5図には、整列検査論理回路の回路図が示されて
いる。論理ゲート40〜44と、ラツチ41及び45とは、セグ
メンテーシヨン装置14がLAバス20を駆動しており且つバ
スサイクルは打切りとならないことを確実に保証するた
めに、セグメンテーシヨン装置14から受信した信号を復
号する目的で使用される。LAバス20の最下位の3ビツト
は信号線51〜53に現われる。それらの信号は、命令デコ
ーダ装置15又は制御装置19からのバス要求型フイールド
信号と、ゲート46及び69の入力端子において組合され
る。概して、ゲート46,48,49及び67〜72は組合されて、
第2表に従つて整列していない参照のバイト長さを示す
一連の信号を発生する。たとえば、ゲート46は、2バイ
トの整列していない参照を意味する信号を信号線80に発
生し;ゲート67は、4バイトの整列していない参照を意
味する信号を信号線81に発生し;ゲート71は、8バイト
の整列していない参照を意味する信号を信号線82に発生
し;ゲート49は、4NDの整列していない参照を意味する
信号を信号線83に発生す9。信号線80〜83のそれぞれの
信号はケート47によりORされ、その結果はラツチ50に蓄
積される。(第5図のラツチと関連する記号P1及びP2
は、それぞれのラツチがクロツクされる位相を示す。た
とえば、ラツチ41及び59がシステムクロツクの位相2で
クロツクされるのに対し、ラツチ45,50及び62は次のク
ロツクパルスの位相1でクロツクされる。) 信号線54及び55に現われるAMビツトとACビツトは、AN
Dゲート57に入力される。整列していなときの故障を発
生するためには、それらのビツトは共に「1」でなけれ
ばならない。ゲート57の出力は、信号線56に供給される
プログラムの特権レベルと共に、ラツチ45及び50の出力
とゲート63においてANDされる。現時点で好ましい実施
例における特権レベルは、制御装置19のCPLビツトによ
る決定に従つて、レベル3でなければならない。ゲート
58〜62は、バスサイクルの型がAC違反を許容する型であ
ることを確実に保証するために、ANDゲート63にさらに
入力を供給する。(あるサイクルでは、AC違反が許容さ
れない。たとえば、分岐サイクルは、定義上、1バイト
のサイクルであるので、分岐サイクルではAC違反は許さ
れない。) ゲート63の出力はANDゲート65の一方の入力端子に結
合される。ゲート65に対する他方の入力は、故障信号が
発生される前にマイクロプロセツサのパイブラインが解
放されていることを示す信号を供給する信号線66から得
られる。要するに、ACビツトとAMビツトとのAND演算に
加えて、第5図の論理は、いずれのシステムセグメント
に対してもアクセスが実行されていないこと及び適正な
バスサイクルが実行されていることを確実に保証するよ
うに設計されている。ANDゲート65は、SINTR(セグメン
テーシヨン装置割込み)と呼ばれる信号を信号線67に発
生する。この信号は、上記の条件の全てに適合したと
き、必ず制御装置19に結合される。
Once it is determined that an unaligned access has occurred, it is relatively easy to determine other conditions necessary to cause a failure. Referring to FIG. 5, FIG. 5 shows a circuit diagram of the alignment check logic circuit. Logic gates 40-44 and latches 41 and 45 are connected to segmentation device 14 to ensure that segmentation device 14 is driving LA bus 20 and that the bus cycle is not aborted. Used for decoding received signals. The three least significant bits of the LA bus 20 appear on signal lines 51-53. These signals are combined at the input terminals of gates 46 and 69 with a bus request type field signal from the instruction decoder unit 15 or the control unit 19. Generally, gates 46, 48, 49 and 67-72 are combined
It generates a series of signals indicating the byte length of the references that are not aligned according to Table 2. For example, gate 46 generates a two-byte unaligned reference signal on signal line 80; gate 67 generates a four-byte unaligned reference signal on signal line 81; Gate 71 generates an 8-byte signal indicating an unaligned reference on signal line 82; gate 49 generates a 4ND signal indicating an unaligned reference on signal line 839. The signals on the signal lines 80 to 83 are ORed by the gate 47, and the result is stored in the latch 50. (The symbols P1 and P2 related to the latch in FIG. 5
Indicates the phase at which each latch is clocked. For example, latches 41 and 59 are clocked at phase 2 of the system clock, while latches 45, 50 and 62 are clocked at phase 1 of the next clock pulse. The AM and AC bits appearing on signal lines 54 and 55 are
Input to D gate 57. Both bits must be "1" to cause a misalignment failure. The output of gate 57 is ANDed at gate 63 with the outputs of latches 45 and 50, along with the privilege level of the program supplied to signal line 56. The privilege level in the presently preferred embodiment must be level 3, as determined by the CPL bits of controller 19. Gate
58-62 provide further inputs to AND gate 63 to ensure that the type of bus cycle is of the type that allows AC violations. (An AC violation is not allowed in a certain cycle. For example, since a branch cycle is a 1-byte cycle by definition, an AC violation is not allowed in a branch cycle.) The output of the gate 63 is one input of the AND gate 65. Connected to terminal. The other input to gate 65 is derived from signal line 66 which provides a signal indicating that the microprocessor's pipeline is open before a fault signal is generated. In short, in addition to the AND operation of the AC and AM bits, the logic of FIG. 5 ensures that no access is being made to any system segment and that the proper bus cycle is being performed. Designed to guarantee. The AND gate 65 generates a signal called SINTR (segmentation device interrupt) on the signal line 67. This signal is coupled to the controller 19 whenever all of the above conditions are met.

制御装置は、SINTRを受信すると、直ちに全ての実行
を停止させ、この整列検査故障をサービスするために措
置を構じる。制御装置は2つのノー・オペレーシヨン
(NOP)フロツクを挿入し、次に、整列検査故障に関す
る入口点にマイクロコードを押入れる。その後、マイク
ロコードは、戻りアドレスを記憶し且つユーザープログ
ラムに故障を報知するために必要であることの全ての実
行を引継ぐ。
As soon as the controller receives the SINTR, it stops all execution and takes action to service this alignment check failure. The controller inserts two no-operation (NOP) blocks and then pushes the microcode to the entry point for the alignment check failure. Thereafter, the microcode stores the return address and takes over all the necessary work to notify the user program of the failure.

以上、選択可能な整列検査を実行するマイクロプロセ
ツサを開示した。
Thus, a microprocessor that performs a selectable alignment test has been disclosed.

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

第1図は、本発明によるマイクロプロセツサにより提供
される4つの特権レベルを、最も保護性の高いレベルを
レベル0として、また、最も保護性の低いレベルをレベ
ル3として示す図、第2図は、本発明によるマイクロプ
ロセツサの内部に配置され、特権レベル3における整列
していないデータへのアクセス時の故障を支援するため
の、上位16ビツト中に規定された余分のビツト(ACビツ
ト)を有するEFLAGSレジスタを示す図、第3図は、EFLA
GS中のACビツトが整列故障を許容できるか否かを制御す
る整列マスキンクビツト(AM)を蓄積する機械状態制御
レジスタ(CRO)を示す図、第4図は、本発明のマイク
ロプロセツサの全体ブロツク線図、第5図は、本発明の
現時点で好ましい実施例において整列検査がどのように
して論理的に実現されるかを示す図である。 10……バスインターフエース装置、11……先取り装置、
12……キヤツシユ装置、13……ページング装置、14……
セグメンテーシヨン装置、15……命令デコーダ装置、17
……浮動小数点装置、18……データ装置、19……制御装
置、20………32ビツト線形アドレスバス、30……32ビツ
ト外部データバス、31……アドレスバス。
FIG. 1 shows the four privilege levels provided by the microprocessor according to the invention, the highest protection level being level 0 and the least protection level being level 3. FIG. Are extra bits (AC bits) defined in the upper 16 bits, which are arranged inside the microprocessor according to the present invention and support a failure when accessing unaligned data at privilege level 3. FIG. 3 shows the EFLAGS register having EFLAGS.
FIG. 4 shows a machine state control register (CRO) for storing an alignment mask bit (AM) for controlling whether or not an AC bit in the GS can tolerate an alignment fault. FIG. FIG. 5 is a diagram showing how alignment checking is logically implemented in the presently preferred embodiment of the present invention. 10 ... bus interface device, 11 ... prefetching device,
12 ... Cashing device, 13 ... Paging device, 14 ...
Segmentation device, 15 …… Instruction decoder device, 17
… Floating point device, 18… Data device, 19… Control device, 20… 32 bit linear address bus, 30… 32 bit external data bus, 31… Address bus.

フロントページの続き (56)参考文献 特開 昭54−129934(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06F 12/14 Continuation of the front page (56) References JP-A-54-129934 (JP, A) (58) Fields investigated (Int. Cl. 7 , DB name) G06F 12/14

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】コンピュータシステムのオペレーションを
制御するオペレーティングシステムを備え、 最上位特権レベルから最下位特権レベルまでの複数の特
権レベルを有する保護メカニズムに従ってプログラムを
実行するプロセシングユニットを備え、前記コンピュー
タシステム内での前記プログラムの優先度を特定する現
在特権レベルで前記プログラムは実行され、 前記プロセシングユニットに結合されてデータを記憶す
るメモリ手段を備え、 前記メモリ手段において前記プログラムにより定められ
るアドレスに記憶されているデータを参照する参照手段
を備え、この参照手段は前記プロセシングユニットによ
って制御され、 前記プログラムによって定められるメモリ参照が不整列
のアドレスに向けられているときにおける整列フォルト
の発生を制御する手段であって、最下位特権レベルから
アクセスできて整列フォルトの発生を選択的に可能とす
る第1ビットと、最上位特権レベルのみからアクセスで
きてグローバルな整列フォルトの発生を選択的に可能と
する第2ビットとを含んでいる、整列フォルトの発生を
制御する手段を備える ことを特徴とするコンピュータシステム。
An operating system for controlling the operation of a computer system, comprising: a processing unit for executing a program according to a protection mechanism having a plurality of privilege levels from a highest privilege level to a lowest privilege level; The program is executed at a current privilege level that specifies the priority of the program at the memory unit, the memory unit being coupled to the processing unit to store data, the memory unit being stored at an address defined by the program. Reference means for referring to data stored in the memory, the reference means being controlled by the processing unit, and an alignment fault when a memory reference defined by the program is directed to an unaligned address. A first bit accessible from the lowest privilege level and selectively enabling the generation of an alignment fault, and a first bit accessible from only the highest privilege level and controlling the occurrence of a global alignment fault. A computer system, comprising: means for controlling the occurrence of an alignment fault, including a second bit that is selectively enabled.
【請求項2】オペレーションレベルからアプリケーショ
ンレベルまでの特権レベルの階層を含んでいて、オブジ
ェクトへの選択的なアクセスを許可する保護レベルに従
ってプログラムを実行する制御ユニットを備え、前記コ
ンピュータシステム内での前記プログラムの優先度を特
定する現在特権レベルで前記プログラムは実行され、 前記制御ユニットに結合されてデータを記憶するメモリ
手段を備え、 前記メモリ手段において前記プログラムにより定められ
るアドレスに記憶されているデータを参照する参照手段
を備え、この参照手段は前記制御手段に結合されてお
り、 前記制御ユニットに結合されていて、セグメント化され
たアドレスを線形アドレスに変換するセグメンテーショ
ンユニットを備え、このセグメンテーションユニットに
は、不整列のデータに対する参照を検出する手段が含ま
れており、 不整列のデータに対する参照が検出されたときに、整列
フォルトの発生を制御する手段であって、アプリケーシ
ョンレベルからアクセスできて整列フォルトの発生を選
択的に可能とする第1ビットと、オペレーションレベル
のみからアクセスできてグローバルな整列フォルトの発
生を選択的に可能とする第2ビットとを含んでいる、整
列フォルトの発生を制御する手段を備える ことを特徴とするコンピュータシステム。
2. A control unit comprising a hierarchy of privilege levels from an operation level to an application level, the control unit executing a program according to a protection level allowing selective access to an object, wherein the control unit executes the program in the computer system. The program is executed at a current privilege level for specifying a priority of the program, the memory unit coupled to the control unit to store data, and the data stored in the memory unit at an address determined by the program is stored. Reference means coupled to said control means, said reference means coupled to said control means, comprising: a segmentation unit for converting a segmented address into a linear address, said segmentation unit comprising: Means for detecting a reference to unaligned data; means for controlling the occurrence of an alignment fault when a reference to unaligned data is detected; Means for controlling the occurrence of an alignment fault, including a first bit selectively enabling the generation and a second bit accessible only from the operation level and selectively enabling the generation of a global alignment fault. A computer system comprising:
【請求項3】命令を実行する特権レベルとしてレベル0
〜レベル3を有しているマイクロプロセッサ装置であっ
て、メモリ要求を発生するメモリ要求発生システムを含
んでおり、このメモリ要求発生システムはメモリ要求に
ついての整列検査も行うものであり、 特権レベル3で実行されている命令によって書き込み得
るフラグレジスタを備え、前記フラグレジスタには、整
列フォルトの発生を可能とする整列検査ビットが含まれ
ており、 特権レベル0で実行されている命令によって書き込み得
るが、特権レベル3で実行されている命令によっては書
き込み得ない制御レジスタを備え、前記制御レジスタに
は、マスキングビットが含まれ、 前記フラグレジスタおよび前記制御レジスタの双方の内
容を受けるよう結合されていて、前記フラグレジスタお
よび前記制御レジスタの双方がセットされているときに
のみイネーブル信号を生じる論理回路を備え、このイネ
ーブル信号は前記メモリ要求発生システムに結合され
て、整列していないメモリ要求が発生され且つ前記イネ
ーブル信号が生じた場合において整列フォルトが発生さ
れるよう構成されている ことを特徴とするマイクロプロセッサ装置。
3. The privilege level for executing an instruction is level 0.
A microprocessor device having a memory request generation system for generating a memory request, the memory request generation system also performing an alignment check for the memory request, and a privilege level 3 A flag register that can be written by an instruction executed at privilege level 0, the flag register includes an alignment check bit that enables an alignment fault to occur, and can be written by an instruction executed at privilege level 0. A control register that cannot be written by an instruction executed at privilege level 3, wherein the control register includes a masking bit and is coupled to receive the contents of both the flag register and the control register. The flag register and the control register are both set. Logic circuitry for generating an enable signal only when the enable signal is coupled to the memory request generation system to generate an unaligned memory request and to generate an alignment fault if the enable signal occurs. A microprocessor device configured as described above.
JP2085074A 1989-04-05 1990-04-02 A microprocessor that performs selectable alignment checking on memory references. Expired - Lifetime JP3055031B2 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US33407489A 1989-04-05 1989-04-05
US334.074 1989-04-05

Publications (2)

Publication Number Publication Date
JPH02287741A JPH02287741A (en) 1990-11-27
JP3055031B2 true JP3055031B2 (en) 2000-06-19

Family

ID=23305466

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2085074A Expired - Lifetime JP3055031B2 (en) 1989-04-05 1990-04-02 A microprocessor that performs selectable alignment checking on memory references.

Country Status (6)

Country Link
JP (1) JP3055031B2 (en)
DE (1) DE4010733C2 (en)
FR (1) FR2645664B1 (en)
GB (1) GB2230118B (en)
HK (1) HK107393A (en)
SG (1) SG55493G (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB9716240D0 (en) * 1997-07-31 1997-10-08 Tricorder Technology Plc Scanning apparatus and methods
US6772372B2 (en) * 2001-03-06 2004-08-03 Hewlett-Packard Development Company, L.P. System and method for monitoring unaligned memory accesses
GB2482710A (en) 2010-08-12 2012-02-15 Advanced Risc Mach Ltd Enabling stack access alignment checking independently of other memory access alignment checking

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4654781A (en) * 1981-10-02 1987-03-31 Raytheon Company Byte addressable memory for variable length instructions and data

Also Published As

Publication number Publication date
GB9003354D0 (en) 1990-04-11
FR2645664B1 (en) 1993-12-17
HK107393A (en) 1993-10-22
DE4010733C2 (en) 1995-08-31
DE4010733A1 (en) 1990-10-11
GB2230118B (en) 1992-12-23
FR2645664A1 (en) 1990-10-12
GB2230118A (en) 1990-10-10
JPH02287741A (en) 1990-11-27
SG55493G (en) 1993-08-06

Similar Documents

Publication Publication Date Title
US5201043A (en) System using both a supervisor level control bit and a user level control bit to enable/disable memory reference alignment checking
US5517651A (en) Method and apparatus for loading a segment register in a microprocessor capable of operating in multiple modes
US9524163B2 (en) Computer processor employing hardware-based pointer processing
US6205560B1 (en) Debug system allowing programmable selection of alternate debug mechanisms such as debug handler, SMI, or JTAG
US6295600B1 (en) Thread switch on blocked load or store using instruction thread field
US5659679A (en) Method and apparatus for providing breakpoints on taken jumps and for providing software profiling in a computer system
JP6095682B2 (en) Converting program event recording events to runtime instrumentation events
US10747536B2 (en) Program loop control
US6631460B1 (en) Advanced load address table entry invalidation based on register address wraparound
US5838897A (en) Debugging a processor using data output during idle bus cycles
KR100190252B1 (en) Branch performance in high speed processor
US5148528A (en) Method and apparatus for simultaneously decoding three operands in a variable length instruction when one of the operands is also of variable length
US7962729B2 (en) Dynamic runtime range checking of different types on a register using upper and lower bound value registers for the register
JPS63193230A (en) High performance microprocessor integrated circuit and reference of memory
US10768938B2 (en) Branch instruction
US20130246769A1 (en) Run-time instrumentation monitoring for processor characteristic changes
KR20080028827A (en) Enabling multiple instruction stream/multiple data stream extensions on microprocessors
US20070118696A1 (en) Register tracking for speculative prefetching
NL2030804B1 (en) Flexible return and event delivery
JP3055031B2 (en) A microprocessor that performs selectable alignment checking on memory references.
US5742755A (en) Error-handling circuit and method for memory address alignment double fault
Ryan Intel's 80960: An architecture optimized for embedded control
JP4978914B2 (en) Method and system enabling expansion of multiple instruction streams / multiple data streams on a microprocessor
US20230281016A1 (en) Software-controlled flag to require a stack switch during execution
US20230315444A1 (en) Synchronous microthreading

Legal Events

Date Code Title Description
R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090414

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090414

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100414

Year of fee payment: 10

EXPY Cancellation because of completion of term