JPH0638236B2 - Interrupt control method - Google Patents

Interrupt control method

Info

Publication number
JPH0638236B2
JPH0638236B2 JP62111922A JP11192287A JPH0638236B2 JP H0638236 B2 JPH0638236 B2 JP H0638236B2 JP 62111922 A JP62111922 A JP 62111922A JP 11192287 A JP11192287 A JP 11192287A JP H0638236 B2 JPH0638236 B2 JP H0638236B2
Authority
JP
Japan
Prior art keywords
interrupt
flag
emulation mode
mode
emulation
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
JP62111922A
Other languages
Japanese (ja)
Other versions
JPS63276635A (en
Inventor
陽一 矢野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP62111922A priority Critical patent/JPH0638236B2/en
Publication of JPS63276635A publication Critical patent/JPS63276635A/en
Publication of JPH0638236B2 publication Critical patent/JPH0638236B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は情報処理装置における中央処理装置に関し、特
にネイティブモードとエミュレーションモードという2
つの命令実行状態を持つ中央処理装置における、エミュ
レーションモードでの割り込み制御方式に関する。
The present invention relates to a central processing unit in an information processing apparatus, and particularly to a native mode and an emulation mode.
An interrupt control method in an emulation mode in a central processing unit having two instruction execution states.

〔従来の技術〕[Conventional technology]

計算機システムの発展にともない、計算機には高速な処
理のみならず、高度な処理も要求されるようになってき
ている。半導体技術を応用したマイクロプロセッサ(M
PUと略す)の分野でも、非常に高度な処理が同様に要
求されており、特に、32ビットMPU(例えばV6
0)と呼ばれる分野においても、その傾向は顕著であ
る。
With the development of computer systems, not only high-speed processing but also high-level processing is required for computers. Microprocessor (M
In the field of PU as well, very high-level processing is similarly required, and in particular, 32-bit MPU (for example, V6).
The tendency is remarkable also in the field called 0).

高度な処理の1つに、従来ソフトウェアとの互換性を提
供するエミュレーションモード(EMと略す)がある。
これは、新しいアーキテクチャを導入する際に、古いア
ーキテクチャ上で開発されていたソフトウェアを変更な
しに動かすことにより、ソフトウェア資産を引き継ぎ、
生かしていこうとするアプローチである。これに対し、
新しいアーキテクチャで命令実行を行なうモードをネイ
ティブモード(NMと略す)と呼ぶ。このアプローチを
採用することにより、スムーズに新しいアーキテクチャ
に移行することができるばかりでなく、古いソフトウェ
アも引続き使用できるため、新しいソフトウェア環境と
古いソフトウェア環境を共存させることもでき、ソフト
ウェアに対する投資を有効に活用できる。
One of the advanced processes is an emulation mode (abbreviated as EM) that provides compatibility with conventional software.
This is because when introducing a new architecture, the software assets that have been developed on the old architecture are kept unchanged, and software assets are taken over.
It is an approach that tries to keep it alive. In contrast,
A mode for executing instructions in the new architecture is called a native mode (abbreviated as NM). This approach not only provides a smooth transition to the new architecture, but also allows the old software to continue to be used, allowing the new and old software environments to coexist, thus making the software investment more efficient. Can be utilized.

引続き利用したいソフトウェアには、いわゆるアプリケ
ーション・プログラム(適用業務)だけでなく、管理プ
ログラム、すなわちオペレーティング・システム(OS
と略す)自身の場合もある。すなわち、古いプログラム
の実行環境を提供するソフトウェア群である。
Not only so-called application programs (applications) but also management programs, that is, operating systems (OS)
There is also a case of itself. That is, it is a software group that provides an execution environment for old programs.

特に、EMを備えるMPUでは、周辺機器の制御をどの
ようにNMとEMで分担し、ソフトウェアの互換性を提
供するかが重要となるが、そのなかでも、周辺機器の管
理の基本となる割込みの管理が最も重要である。
In particular, in an MPU equipped with an EM, it is important how the NM and EM share control of peripheral devices and provide software compatibility. Among them, interrupts that are the basis of peripheral device management are important. Management is the most important.

EMを持つMPUでは、まず、現在どちらの実行モード
で実行しているかを示すフラグを持つ。これを、モード
フラグと呼ぶが、このモードフラグより、どちらの実行
モードで命令を実行しているかを制御、表示する。これ
以外に、NMの割込み可/不可を制御するフラグと、E
Mでの割込み可/不可を制御するフラグの2つを持つ。
前者をNM割込みステータス(NM.ISと略す)と呼
び、後者をEM割込みステータス(EM.ISと略す)
とする。それぞれ、NM、EMから参照できる、いわゆ
るプログラム・ステータス・ワード(PSWと略す)内
に存在する。NM用のPSWをネイティブPSW、EM
用のPSWをエミュレーションPSWと呼ぶ。NM.I
Sは、MPU自身の割込み可/不可の状態を制御するこ
とを目的とするのに対し、EM.ISはEMでの割込み
可/不可の状態を表示することを目的とする。
First, an MPU having an EM has a flag indicating in which execution mode it is currently executing. This is called a mode flag. The execution mode is controlled and displayed by the mode flag. In addition to this, a flag that controls whether the NM interrupt is enabled or disabled, and E
It has two flags that control whether interrupts in M can be enabled or disabled.
The former is called NM interrupt status (abbreviated as NM.IS), and the latter is EM interrupt status (abbreviated as EM.IS).
And They exist in so-called program status words (abbreviated as PSW) that can be referred to by NM and EM, respectively. Native PSW, EM for NM PSW
The PSW for use is called an emulation PSW. NM. I
The S is intended to control the interrupt enable / disable state of the MPU itself, while the EM. IS is intended to display the interrupt enable / disable status in EM.

一般に、割込みは、NMに対する割込みとEMに対する
割込みの2種類に分類することができるが、NMに対す
る割込みは、EM.ISの状態にかかわらず、NM.I
Sに従って処理される。それは、NMのOSが責任を持
ちシステムの管理を行なっているからである。一方、E
Mに対する割込みは、EMに対して通知されるべき性質
のものであるが、EMの命令実行状態に応じて、もしE
M.ISが割込み可になっていれば、EMの命令実行に
割込み、もしEM.ISが割込み不可であれば、割込み
があったことを記憶しておき、EM.ISが割込み可の
状態になったときに、割込みを通知することになる。こ
れは、非同期な事象の通知方法として、OSでは一般に
使われている方式である。
In general, interrupts can be classified into two types: interrupts for NM and interrupts for EM, but interrupts for NM are EM. NM. I
It is processed according to S. This is because the NM OS is responsible for managing the system. On the other hand, E
The interrupt for M is of a nature that should be notified to EM, but if E
M. If the IS is interruptable, interrupt the execution of the EM instruction, and if the EM. If the IS is not interruptable, the fact that an interrupt has occurred is stored, and the EM. When the IS is in the interrupt enabled state, the interrupt is notified. This is a method generally used in the OS as an asynchronous event notification method.

このとき、EMで走行しているプログラムがEM.IS
を操作しようとしたときには、その動きをなんらかの方
法でエミュレートしなければならない。このために考え
られる方法として3つある。
At this time, the program running on the EM is EM. IS
When you try to control the, you have to emulate that movement in some way. There are three possible methods for this.

第1の方法として、EM.ISの割込み可/不可の状態
に連動して、NM.ISも同様の状態に設定する、とい
うものがある。EM.ISお操作する命令をエミュレー
トするわけである。すなわち、EMで割込み不可にした
場合に、NMで無条件に割込み不可にしてしまうやりか
たであるが、この方式をとった場合、タイマ割込みのよ
うなNMに対する重要な割込み要求を逃してしまう可能
性が出てきてしまう。これは、MPUに対する割込みの
制御のような、いわばシステムの実行環境を変更する意
味合いを持つ動作に関して、NMが責任を持つて管理し
ているにもかかわらず、その制御をEMに開放してしま
ったために起こる問題である。したがって、NM.IS
の状態をEM.ISに連動して変化させるわけにはいか
ない。
As a first method, EM. In conjunction with the interrupt enable / disable state of the IS, the NM. There is a method of setting the IS in the same state. EM. IS emulates the instruction to operate. In other words, if the EM disables interrupts, the NM unconditionally disables interrupts. With this method, however, important interrupt requests to the NM such as timer interrupts may be missed. Comes out. This leaves the control open to the EM, although the NM is responsible for managing operations that have the meaning of changing the execution environment of the system, such as controlling interrupts to the MPU. This is a problem that occurs because Therefore, NM. IS
EM. It cannot be changed in conjunction with IS.

第2の方法として、NM.ISの割込み可/不可の状態
に無関係にEM.ISを操作するEM内の命令を実行す
る。すなわち、EM.ISの状態は命令実行により変え
るものの、NM.ISの状態は変えない、というやりか
たがある。この方式では、EMでいつ割込みを受け付け
るかが分からないという問題がある。いま、EM.IS
が割込みの状態でEMを動かしているとき、命令実行に
より、EM.ISを割込み不可にしたとする。この後、
EMへの割込み要求がMPUに対して発生したとすると
き、EMでは割込み不可の状態で走行していると仮定し
ているので、NMのOSは、EMの命令実行シーケンス
に対して割込まず、EMに対する割込み要求が発生して
いることのみを記録しておき、EMの命令実行シーケン
スに制御を戻す。問題となるのは、これ以降の動きであ
る。EMでは命令実行にともないEM.ISを割込み可
の状態に戻すかもしれないが、それを戻した時点がいつ
なのか、ということがNMのOSに通知できない。なぜ
ならば、EMでは、EM.ISを操作する命令を実行し
てしまうので、いつEM.ISを割込み可にしたのかが
判断できず、従って、NMのOSはEMに割込み要求が
存在することを通知ができないからである。
As a second method, NM. The EM. Execute instructions in EM to operate IS. That is, EM. Although the state of IS changes depending on the instruction execution, NM. There is a way to keep the IS state unchanged. This method has a problem that the EM does not know when to accept an interrupt. Now, EM. IS
While the EM is moving in the interrupt state, the execution of the instruction causes the EM. Assume that the IS has been disabled. After this,
When an interrupt request to the EM is issued to the MPU, it is assumed that the EM is running in an interrupt-disabled state, so the NM OS does not interrupt the EM instruction execution sequence. , EM is recorded only when an interrupt request is generated, and control is returned to the EM instruction execution sequence. The problem is the subsequent movement. In EM, EM. The IS may return to the interrupt-enabled state, but it is not possible to notify the OS of the NM when it is returned. Because, in EM, EM. When the EM. This is because it is not possible to determine whether the IS has been enabled to interrupt, and therefore the NM OS cannot notify the EM that there is an interrupt request.

第3方法としては、EM.ISを操作する命令をエミュ
レートせず、命令実行をしようとした場合に、NMにト
ラップ起こして戻る、という方式がある。この方式で
は、割込みの制御をNMのソフトウェアがコントロール
できるので上記のような問題は発生せず、NMのOSが
完全にコントロールできる。
As a third method, EM. There is a method in which when an instruction is executed without emulating an instruction for operating the IS, a trap is generated in the NM and the instruction is returned. In this method, since the control of the interrupt can be controlled by the software of the NM, the above problem does not occur and the OS of the NM can be completely controlled.

従来のエミュレーションでは、EM.ISを操作する命
令の実行をエミュレーションせず、特権的な命令処理で
あるとみなし、例外としてNMに処理をもどす第3の方
法を採用していた。
In the conventional emulation, EM. The third method in which the execution of the instruction for operating the IS is regarded as privileged instruction processing without emulation and the processing is returned to the NM as an exception has been adopted.

〔発明が解決しようとする問題点〕[Problems to be solved by the invention]

上述した従来のエミュレーションモードでの割込み方式
は、もしEMで走行するプログラムがそれほど頻繁E
M.ISを制御しない場合は、エミュレーションの性能
低下のことを心配する必要はないが、キーボード入力の
ような処理では、1文字入力の度ごとにEM.ISを制
御し、割込み可/不可の制御を繰り返す場合があり、こ
のようなプログラムをEMで動かそうとした場合には、
頻繁に例外が発生し、EMからNMへの状態遷移が数多
く起こることになるので、能率的なエミュレーションが
できないという欠点がある。
In the conventional interrupt method in the emulation mode described above, if the program running on the EM is not so frequent E
M. If the IS is not controlled, it is not necessary to worry about the performance degradation of the emulation, but in processing such as keyboard input, the EM. In some cases, the IS is controlled and the interrupt enable / disable control is repeated. If you try to run such a program with EM,
Since exceptions occur frequently and many state transitions from EM to NM occur, there is a drawback that efficient emulation cannot be performed.

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

本発明の割り込み制御方法は、2つの命令実行状態であ
るネイティブモードとエミュレーションモードとを持
ち、ネイティブモードでの割り込み可/不可の状態を示
す第1のフラグと、エミュレーションモードでの割り込
み可/不可の状態の示を第2のフラグとを有し、割り込
み要求が発生した時は第1のフラグに従って割り込みを
受け付ける割り込み制御方法において、エミュレーショ
ンモードの割り込み保留状態を示し、エミュレーション
モードから参照できる割り込みペンディングフラグを有
し、第2のフラグが割り込み不可を示しているときにエ
ミュレーションモードへの割り込み要求があると、第1
のフラグが割り込み可であれば割り込みを受け付けるス
テップと、実際のエミュレーションモードでの割り込み
処理は保留として、この割り込み要求があったことのみ
を記憶するように割り込みペンディングフラグをセット
するステップと、次にエミュレーションモードで実行し
ているプログラムが第2のフラグを操作して割り込み不
可から割り込み可にした時点で割り込みペンディングフ
ラグがセットされていると、エミュレーションモードへ
の割り込み要求があったことをエミュレーションモード
で検知するステップとを有することを特徴とする。
The interrupt control method of the present invention has two instruction execution states, a native mode and an emulation mode, a first flag indicating an interrupt enable / disable state in the native mode, and an interrupt enable / disable in the emulation mode. In the interrupt control method, which has a second flag indicating the state of, and accepts an interrupt in accordance with the first flag when an interrupt request occurs, the interrupt pending state of the emulation mode can be indicated and can be referred to from the emulation mode. If an interrupt request to the emulation mode is made when the second flag has a flag and the second flag indicates that interruption is not possible, the first flag
If the flag of interrupt is enabled, the step of accepting the interrupt, the step of setting the interrupt pending flag so that only the interrupt request in the actual emulation mode is held, and only this interrupt request is stored, and then If the interrupt pending flag is set when the program running in emulation mode operates the second flag to change from interrupt disabled to interrupt enabled, it means that an emulation mode interrupt request was issued. And a detecting step.

〔作用〕[Action]

したがって、EMにおいて、EM.ISを制御する命令
実行に際し、ペンディングフラグが立っているかどうか
によって、EMにたいする割込み要求があったかどうか
を検知することができるので、毎回NMにトラップする
必要がない。
Therefore, in EM, EM. When the instruction for controlling the IS is executed, it is possible to detect whether or not there is an interrupt request for the EM depending on whether or not the pending flag is set, so that it is not necessary to trap in the NM every time.

〔実施例〕〔Example〕

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

第1図は本発明のエミュレーションモードにおける割り
込み制御方式が適用されている第1の実施例である中央
処理装置の主要部を示す構成図、第2図(a) 、(b) はそ
れぞれ第1図の中央処理装置100に設けられているネ
イティブPSW120とエミュレーションPSW130
の内容を示す説明図、第3図、第4図は割込みに対する
各部動作を示すフローチャートである。
FIG. 1 is a block diagram showing a main part of a central processing unit which is a first embodiment to which an interrupt control system in an emulation mode of the present invention is applied, and FIGS. 2 (a) and 2 (b) respectively show the first part. Native PSW 120 and emulation PSW 130 provided in the central processing unit 100 shown in the figure.
FIG. 3, FIG. 3 and FIG. 4 are flowcharts showing the operation of each part in response to an interrupt.

中央処理装置100は、アドレスバスとデータバスから
なるシステムバス120に接続されたバス・インターフ
ェース103と、割込み要求を割込み要求端子101に
入力すると、割込み要求に従って割込み処理を開始する
マイクロプログラム・シーケンサ104と、マイクロプ
ログラム・シーケンサ104が実行するマイクロプログ
ラムを格納しているマイクロプログラムメモリ105
と、32ビットのネイティブPSW120、エミュレー
ションPSW130を含むとともにレジスタ、ALU
(不図示)などの資源をも含むデータパスである実行ユ
ニット106とから構成されている。
The central processing unit 100 has a bus interface 103 connected to a system bus 120 composed of an address bus and a data bus, and a microprogram sequencer 104 which starts an interrupt process according to an interrupt request when an interrupt request is input to an interrupt request terminal 101. And a microprogram memory 105 storing a microprogram executed by the microprogram sequencer 104.
And 32-bit native PSW120, emulation PSW130, register, ALU
The execution unit 106 is a data path including resources such as (not shown).

ネイティブPSW120は第2図(a) のように、ネイテ
ィブモード(以降NMと記す)とエミュレーションモー
ド(以降EMと記す)との間の遷移状態を制御するモー
ドフラグ110、ネイティブモードにおける割込み可/
不可の状態を示し、割込みを制御するフラグであるネイ
ティブモード割込みステータス111(以降NM.IS
111と記す)などのフラグを保持している、モードフ
ラグ110はネイティブPSW120のビット26から
ビット31(以降ビットはBと記す)であり、命令実行
ペンディングフラグIP、シングルステップトラップペ
ンディングフラグTP、割込みスタック使用中フラグI
S、エミュレーションモードフラグEM、非同期タスク
トラップ処理中フラグATA、非同期システムトラップ
処理中フラグASAを有し、B16からB18がNM.
IS111であり、シングルステップトラップ可フラグ
TE、アドレストラップ可フラグAE、インターラプト
イネーブルフラグIEを有し、B8からB12まではそ
れぞれ浮動小数点精度落ち例外フラグFRP、浮動小数
点アンダフロー例外フラグFUD、浮動小数点オーバー
フロー例外フラグFOV、浮動小数点ゼロ除算例外フラ
グFZD、浮動小数点無効演算例外フラグFIVであ
り、B1からB4はそれぞれゼロフラグZ、サインフラ
グS、オーバーフローフラグOV、キャリフラグCYで
あり、“−”印のビットは予約済フィールドである。
The native PSW 120 has a mode flag 110 for controlling a transition state between a native mode (hereinafter referred to as NM) and an emulation mode (hereinafter referred to as EM) as shown in FIG.
Native mode interrupt status 111 (hereinafter referred to as NM.IS) indicating a disabled state and being a flag for controlling interrupts.
The mode flag 110 is a bit 26 to a bit 31 of the native PSW 120 (hereinafter, the bit is referred to as B), an instruction execution pending flag IP, a single step trap pending flag TP, and an interrupt. Stack in-use flag I
S, emulation mode flag EM, asynchronous task trap processing flag ATA, and asynchronous system trap processing flag ASA, and B16 to B18 are NM.
IS111 has a single-step trap enable flag TE, an address trap enable flag AE, and an interrupt enable flag IE. B8 to B12 have floating point precision loss exception flag FRP, floating point underflow exception flag FUD, and floating point, respectively. An overflow exception flag FOV, a floating point division by zero exception flag FZD, and a floating point invalid operation exception flag FIV. B1 to B4 are a zero flag Z, a sine flag S, an overflow flag OV, and a carry flag CY, respectively. Bits are reserved fields.

エミュレーションPSW130は第2図(b) に示すよう
に、エミュレーションPSW130のB8からB10が
エミュレーションモード割込みステータス113(以降
EM.IS113と記す)であり、B8,B9,B10
はそれぞれシングルステップトラップ可フラグBRK、
インタラプトイネーブルフラグIE、、転送方向制御フ
ラグである。B0,B2,B4はそれぞれキャリフラグ
CY、パリティフラグP、下位キャリフラグAC、であ
り、B6,B7,B11はそれぞれゼロフラグZ、サイ
ンフラグS、オーバーフローフラグVである。B25は
本実施例において重要な役割を担う割込みペンディング
フラグIRPである。また“−”はネイティブモードP
SW200におけると同様に予約済フィールドである。
In the emulation PSW 130, as shown in FIG. 2B, B8 to B10 of the emulation PSW 130 are emulation mode interrupt status 113 (hereinafter referred to as EM.IS113), and B8, B9, B10.
Are single step trap enable flags BRK,
These are an interrupt enable flag IE and a transfer direction control flag. B0, B2 and B4 are a carry flag CY, a parity flag P and a lower carry flag AC, respectively, and B6, B7 and B11 are a zero flag Z, a sign flag S and an overflow flag V, respectively. B25 is an interrupt pending flag IRP which plays an important role in this embodiment. Also, "-" is the native mode P
It is a reserved field as in SW200.

次に本実施例の動作について第3,第4図により説明す
る。
Next, the operation of this embodiment will be described with reference to FIGS.

割込み要求が割込み要求端子101に入力された場合、
NM.IS111の割込みイネーブルフラグIEが立っ
ているかどうか調べ割込み可/不可を判断し(ステップ
11)、割込みイネーブルフラグIEが立っていないと
きは割込みは受付けず、イネーブルフラグIEが立って
いると割込みを受付け(ステップ12)、次にNMで命
令実行中であったかどうか判断する(ステップ13)。
NMで命令実行中と判断すると、NMの割込み処理ルー
チンを実行し(ステップ14)、ステップ11にもど
る。ステップ13で、EMで命令実行中と判断すると、
EM.IS113の割込みイネーブルフラグIEが立っ
ているか調べて、割込み可/不可の判断を行う(ステッ
プ15)。割込み可であれば、EMでの割込み処理ルー
チンに制御を渡せるように準備し(ステップ16)、一
方EMのプログラムはEM.IS113を操作して、割
込み不可の状態にする(ステップ17)。ステップ17
において、EMのプログラムはNMへのトラップを行わ
ないで命令を実行する。ステップ17が終了すると、N
Mで受付けた割込みをEMでの割込み処理ルーチンの制
御に移し(ステップ18)、ステップ11にもどる。ス
テップ15で割込み不可の場合、例えばステップ17の
後に他の割込み要求が発生した場合、EMの割込み制御
状態にかかわらず、NMの割込み制御状態に従い、NM
の状態遷移をし割込みを受け付ける。NMの割込み処理
ルーチンが起動される。このとき、モードフラグ110
はNMで実行中となる。この割込みが、EMに対する割
込み要求だったとする。しかしステップ17でEMは割
込み不可状態で命令実行を行なっているので、EMの命
令実行を中断してEMの割込み処理ルーチンに制御を移
すわけにはいかない。
When an interrupt request is input to the interrupt request terminal 101,
NM. It is checked whether the interrupt enable flag IE of IS111 is set or not and it is determined whether or not the interrupt is possible (step 11). If the interrupt enable flag IE is not set, the interrupt is not accepted. If the enable flag IE is set, the interrupt is accepted. (Step 12) Then, it is judged whether or not the instruction is being executed by the NM (Step 13).
When the NM determines that the instruction is being executed, the NM interrupt processing routine is executed (step 14) and the process returns to step 11. If it is determined in step 13 that the EM is executing the instruction,
EM. It is determined whether or not the interrupt enable flag IE of the IS 113 is set, and it is determined whether or not the interrupt is possible (step 15). If the interrupt is possible, preparation is made so that control can be passed to the interrupt processing routine in the EM (step 16), while the program of the EM is EM. The IS 113 is operated to make it in an interrupt-disabled state (step 17). Step 17
At, the EM program executes the instruction without trapping to the NM. When step 17 ends, N
The interrupt accepted by M is transferred to the control of the interrupt processing routine by EM (step 18), and the process returns to step 11. If the interrupt cannot be made in step 15, for example, if another interrupt request is generated after step 17, the NM follows the interrupt control state of the NM regardless of the interrupt control state of the EM.
The state transition of is performed and the interrupt is accepted. The NM interrupt processing routine is started. At this time, the mode flag 110
Is running on the NM. It is assumed that this interrupt is an interrupt request to the EM. However, since the EM executes the instruction in the interrupt-disabled state in step 17, the instruction execution of the EM cannot be interrupted and the control cannot be transferred to the interrupt processing routine of the EM.

そこで、エミュレーションモードPSW300の割込み
ペンディングフラグIRPをセットし、EMへの割込み
要求が存在することを記録して、ステップ11にもど
る。NMからは、EMにそのまま戻る。モードフラグ1
10はEMで実行中となる。EMは、割込まれたところ
から、命令実行を再開する。
Therefore, the interrupt pending flag IRP of the emulation mode PSW300 is set, the presence of an interrupt request to the EM is recorded, and the process returns to step 11. From NM, it returns to EM as it is. Mode flag 1
10 is being executed by EM. The EM resumes instruction execution from where it was interrupted.

ステップ18の後、EMで命令が実行され、EMで割込
みを可にしようとしているかどうか判断し(ステップ2
1)、割込み可にしようとしていなければEM.IS1
13を割込み不可とし(ステップ22)、終了する。
After step 18, the EM executes the instruction and determines whether the EM is trying to enable interrupts (step 2
1), EM. IS1
Interruption is disabled for step 13 (step 22), and the process ends.

ステップ21で割込みを可にしようとしている場合は割
込みペンディングフラグIRPが立っているかどうか判
断する(ステップ23)。ステップ23で割込みペンデ
ィングフラグIRPが立っていないと判断されるとステ
ップ22に移り、終了し、割込みペンディングフラグI
RPが立っていると判断すると、EM.IS113を割
込み可とし(ステップ24)、NMにトラップする(ス
テップ25)。ステップ25により、NMではEMに対
する割込み要求を解析し、割込み番号、および複数の割
込み要求があったときには、その順序付けを行ない、制
御を移すべきEMの割込み処理ルーチンを探し出し、そ
の後、必要な情報をスタックにEMのスタックに格納
し、EMの割込み処理ルーチンに制御を移す(ステップ
26〜28)。
If the interruption is enabled in step 21, it is determined whether or not the interruption pending flag IRP is set (step 23). When it is determined in step 23 that the interrupt pending flag IRP is not set, the process proceeds to step 22 and ends, and the interrupt pending flag I
If it is determined that the RP is standing, the EM. The IS 113 is enabled for interruption (step 24) and is trapped in the NM (step 25). In step 25, the NM analyzes the interrupt request to the EM, and when there is an interrupt number and a plurality of interrupt requests, the NM performs an ordering process to find the interrupt processing routine of the EM to which control is to be transferred, and then the necessary information is provided. The stack is stored in the EM stack and the control is transferred to the EM interrupt processing routine (steps 26 to 28).

ここで注意しなければならないことは、実際のプロセッ
サの割込み可/不可の状態はNM.IS111に従うこ
とである。すなわち、インタラプトペンディングフラグ
IRPおよびEM.IS113はプロセッサの割込み状
態の制御はせずEMで動作しているプログラムの意向を
表している。
It should be noted here that the interrupt enable / disable state of the actual processor is NM. According to IS111. That is, the interrupt pending flags IRP and EM. IS113 represents the intention of the program operating in the EM without controlling the interrupt state of the processor.

第5図は本発明が適用されている第2の実施例である中
央処理装置の主要部を示す構成図、第6図(a) 、(b) は
それぞれ第5図の中央処理装置200に設けられている
ネイティブPSW220とエミュレーションPSW23
0の内容を示す説明図、第7図、第8図は割込みに対す
る各部動作を示すフローチャートである。
FIG. 5 is a block diagram showing the main part of a central processing unit according to the second embodiment of the present invention, and FIGS. 6 (a) and 6 (b) are respectively the central processing unit 200 of FIG. Native PSW 220 and emulation PSW 23 provided
An explanatory diagram showing the contents of 0, FIG. 7 and FIG. 8 are flowcharts showing the operation of each part in response to an interrupt.

本実施例は第1の実施例と比較して、エミュレーション
PSW230のB16からB23にペンディング割込み
要求レベル114(以降IRL114と記す)を保持す
るフィールドが確保されている点が異なっている。IR
L114は、ペンディングフラグIRPをセットしたと
きの割込みがどの割込み要求レベルに相当するか、つま
りEMにおいてどの割込み処理ルーチンに制御を移すか
を指示するものである。その他の構成については第1の
実施例の場合と同様なので省略する。
This embodiment is different from the first embodiment in that a field for holding a pending interrupt request level 114 (hereinafter referred to as IRL 114) is secured in B16 to B23 of the emulation PSW 230. IR
L114 is for instructing to which interrupt request level the interrupt when the pending flag IRP is set, that is, to which interrupt processing routine in EM the control is transferred. The rest of the configuration is similar to that of the first embodiment, and will be omitted.

次に本実施例の動作について説明する。Next, the operation of this embodiment will be described.

ステップ31,32,〜,39はそれぞれ第3図のそれ
ぞれステップ11,12,〜,19と同じなので説明は
省略する。ステップ39が終了後、IRL114に割込
みレベルをセットしてステップ31にもどる。ステップ
41,42,〜,44は第4図のそれぞれステップ2
1,22,〜,24と同じなので説明は省略する。ステ
ップ44が終了し、EMの状態が割込み可になったと
き、割込みペンディングフラグIRPを参照して割込み
要求がペンディングにされていることを検知し、EM.
IS213を割込み不可にする(ステップ45)。ステ
ップ45が完了するとIRL114が示す割込みレベル
に従って、該当する割込み処理ルーチンに制御を移し
(ステップ46)、終了する。ステップ46においては
NMにトラップせずIRL114が示す割込みレベルに
従っている。
Steps 31, 32, ..., 39 are the same as steps 11, 12, ..., 19 of Fig. 3, respectively, and therefore their description is omitted. After step 39 is completed, the interrupt level is set in the IRL 114 and the process returns to step 31. Steps 41, 42, ..., 44 are step 2 of FIG. 4 respectively.
The description is omitted because it is the same as 1, 22 ,. When step 44 ends and the EM state becomes interrupt enabled, it is detected that the interrupt request is pending by referring to the interrupt pending flag IRP, and EM.
The IS 213 is disabled for interruption (step 45). When step 45 is completed, control is transferred to the corresponding interrupt processing routine according to the interrupt level indicated by the IRL 114 (step 46), and the process ends. In step 46, the NM is not trapped and the interrupt level indicated by the IRL 114 is followed.

第1の実施例と同様にここで、注意しなればならないこ
とは、実際のプロセッサの割込み可/不可の状態はN
M.IS211に従うことである。すなわち、IRPお
よびEM.IS213はプロセッサの割込み状態の制御
はせず、EMで動作しているプログラムの意向を表して
いる。
As in the first embodiment, it should be noted that the actual processor interrupt enable / disable state is N.
M. According to IS211. That is, IRP and EM. IS213 does not control the interrupt state of the processor, but represents the intention of the program operating in EM.

〔発明の効果〕〔The invention's effect〕

以上説明したように本発明は、割込みペンディングフラ
グを設け、エミュレーションモードにおいて、割込みペ
ンディングフラグが立っているかどうかによって、エミ
ュレーションモードの割込み要求があったかどうか検知
することにより、次のような効果がある。
As described above, the present invention has the following effects by providing the interrupt pending flag and detecting whether or not there is an interrupt request in the emulation mode depending on whether or not the interrupt pending flag is set in the emulation mode.

(1) EMの割込み制御フラグEM.ISを制御するEM
での命令実行を、毎回NMにトラップする必要がないた
めに、エミュレーションの高速化を図ることができる。
(1) EM interrupt control flag EM. EM controlling IS
Since it is not necessary to trap the instruction execution in the NM every time, the emulation can be speeded up.

(2) EMへの割込み要求を、割込み可状態になったEM
へ通知するオーバーヘッドが小さくなる。
(2) An EM that has enabled interrupt requests to the EM
The overhead to notify to becomes small.

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

第1図は本発明のエミュレーションモードにおける割込
み方式が適用された第1の実施例の中央処理装置の主要
部を示す構成図、第2図(a) 、(b) はそれぞれ第1図の
中央処理装置100のネイティブPSW120、エミュ
レーションPSW130の内容を示す説明図、第3図,
第4図は第1図への割込みに対する各部動作を示すフロ
ーチャート、第5図は第2の実施例の中央処理装置の主
要部を示す構成図、第6図(a) 、(b) はそれぞれ第5図
の中央処理装置200のネイティブPSW220、エミ
ュレーションPSW230の内容を示す説明図、第7
図,第8図は第5図への割込みに対する各部動作を示す
フローチャートである。 100,200……中央処理装置、 101……割込み要求端子、 102……システムバス、 103、203……バスインターフェース、 104,204……マイクロプログラムシーケンサ、 105,205……マイクロプログラムメモリ、 106,206……実行ユニット、 120,220……ネイティブPSW、 130,230……エミュレーションPSW。
FIG. 1 is a block diagram showing the main part of the central processing unit of the first embodiment to which the interrupt method in the emulation mode of the present invention is applied, and FIGS. 2 (a) and 2 (b) are respectively the center of FIG. Explanatory diagram showing the contents of the native PSW 120 and the emulation PSW 130 of the processing device 100, FIG.
FIG. 4 is a flow chart showing the operation of each part in response to the interruption in FIG. 1, FIG. 5 is a block diagram showing the main parts of the central processing unit of the second embodiment, and FIGS. 6 (a) and 6 (b) are respectively Explanatory drawing showing the contents of native PSW 220 and emulation PSW 230 of central processing unit 200 in FIG.
FIGS. 8 and 9 are flowcharts showing the operation of each part in response to the interruption shown in FIG. 100, 200 ... Central processing unit, 101 ... Interrupt request terminal, 102 ... System bus, 103, 203 ... Bus interface, 104, 204 ... Micro program sequencer, 105, 205 ... Micro program memory, 106, 206 ... Execution unit, 120, 220 ... Native PSW, 130, 230 ... Emulation PSW.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】2つの命令実行状態であるネイティブモー
ドとエミュレーションモードとを持ち、ネイティブモー
ドでの割り込み可/不可の状態の示す第1のフラグと、
エミュレーションモードでの割り込み可/不可の状態を
示す第2のフラグとを有し、割り込み要求が発生した時
は第1のフラグに従って割り込みを受け付ける割り込み
制御方法において、エミュレーションモードの割り込み
保留状態を示し、エミュレーションモードから参照でき
る割り込みペンディングフラグを有し、第2のフラグが
割り込み不可を示しているときにエミュレーションモー
ドへの割り込み要求があると、第1のフラグが割り込み
可であれば割り込みを受け付けるステップと、実際のエ
ミュレーションモードでの割り込み処理は保留として、
この割り込み要求があったことのみを記憶するように割
り込みペンディングフラグをセットするステップと、次
にエミュレーションモードで実行しているプログラムが
第2のフラグを操作して割り込み不可から割り込み可に
した時点で割り込みペンディングフラグがセットされて
いると、エミュレーションモードへの割り込み要求があ
ったことをエミュレーションモードで検知するステップ
とを有することを特徴とする割り込み制御方法。
1. A first flag which has two instruction execution states, a native mode and an emulation mode, and which indicates an interrupt enable / disable state in the native mode,
In an interrupt control method that has a second flag indicating an interrupt enable / disable state in the emulation mode, and that accepts an interrupt in accordance with the first flag when an interrupt request occurs, indicates an interrupt pending state in the emulation mode, A step of accepting an interrupt if the first flag has an interrupt request when there is an interrupt request to the emulation mode while having an interrupt pending flag that can be referred to from the emulation mode and the second flag indicates that interrupt is disabled; , Interrupt processing in the actual emulation mode is suspended,
At the step of setting the interrupt pending flag so that only this interrupt request is stored, and when the program running in emulation mode next manipulates the second flag to change from interrupt disabled to interrupt enabled And a step of detecting in the emulation mode that there is an interrupt request to the emulation mode when the interrupt pending flag is set.
JP62111922A 1987-05-08 1987-05-08 Interrupt control method Expired - Lifetime JPH0638236B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62111922A JPH0638236B2 (en) 1987-05-08 1987-05-08 Interrupt control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62111922A JPH0638236B2 (en) 1987-05-08 1987-05-08 Interrupt control method

Publications (2)

Publication Number Publication Date
JPS63276635A JPS63276635A (en) 1988-11-14
JPH0638236B2 true JPH0638236B2 (en) 1994-05-18

Family

ID=14573481

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62111922A Expired - Lifetime JPH0638236B2 (en) 1987-05-08 1987-05-08 Interrupt control method

Country Status (1)

Country Link
JP (1) JPH0638236B2 (en)

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS55112651A (en) * 1979-02-21 1980-08-30 Fujitsu Ltd Virtual computer system

Also Published As

Publication number Publication date
JPS63276635A (en) 1988-11-14

Similar Documents

Publication Publication Date Title
US10073711B2 (en) Virtual machine monitor configured to support latency sensitive virtual machines
US9304794B2 (en) Virtual machine control method and virtual machine system using prefetch information
US8504703B2 (en) Systems and methods for instruction sequence compounding in a virtual machine environment
JP4430716B2 (en) An adaptive algorithm for selecting a virtualization algorithm in a virtual machine environment
JP5244160B2 (en) A mechanism for instruction set based on thread execution in multiple instruction sequencers
WO2017112149A1 (en) Thread and/or virtual machine scheduling for cores with diverse capabilities
US12014199B1 (en) Virtualization extension modules
US9009716B2 (en) Creating a thread of execution in a computer processor
WO2007053980A1 (en) Method and apparatus to support virtualization with code patches
JPS61286931A (en) Information processor
US20160253196A1 (en) Optimized extended context management for virtual machines
JP2004258840A (en) Computer system with virtualized i/o device
JPH05216689A (en) Computer apparatus and computer-apparatus operating method
JPH02153434A (en) Data processing system
EP0290942B1 (en) Guest machine execution control system for virtual machine system
US20060064528A1 (en) Privileged resource access
JP5235900B2 (en) Using buffers to facilitate instruction execution
JPH0638236B2 (en) Interrupt control method
JPH0192843A (en) Data processing apparatus and method
JPS61184643A (en) Starting control system for virtual computer
JPS6273333A (en) Emulation control system
US20230418509A1 (en) Switching memory consistency models in accordance with execution privilege level
JPH0447854B2 (en)
JPS61184644A (en) Control system of virtual computer system
JPH03142532A (en) Input/output executing device for computer system