JPS62182959A - I/o emulation circuit - Google Patents

I/o emulation circuit

Info

Publication number
JPS62182959A
JPS62182959A JP2629686A JP2629686A JPS62182959A JP S62182959 A JPS62182959 A JP S62182959A JP 2629686 A JP2629686 A JP 2629686A JP 2629686 A JP2629686 A JP 2629686A JP S62182959 A JPS62182959 A JP S62182959A
Authority
JP
Japan
Prior art keywords
address
input
output
instruction
output instruction
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.)
Granted
Application number
JP2629686A
Other languages
Japanese (ja)
Other versions
JPH0555905B2 (en
Inventor
Akira Kuwata
桑田 明
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 JP2629686A priority Critical patent/JPS62182959A/en
Publication of JPS62182959A publication Critical patent/JPS62182959A/en
Publication of JPH0555905B2 publication Critical patent/JPH0555905B2/ja
Granted legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)

Abstract

PURPOSE:To generate an interruption without executing an erroneous input/ output instruction, by performing the detection of an input/output instruction, or a control for the generation of the interruption within a CPU. CONSTITUTION:Addresses set at registers 107 and 108, and a generated I/O address are compared at a comparator 106, and when the generated I/O address is within the range of set addresses, an I/O trap flag 109 is set at '1', and when it is '0', an address output control line 110 is activated, and the I/O address is outputted to an external address bus 103, and an I/O bus cycle is made run, then the execution of an I/O instruction is completed. On the other hand, when the I/O trap flag 109 is '1', a microprogram 112 starts up the microprogram of an interruption process, and branches it to an interruption process routine, and investigates the address where the interruption is generated from the value of an instruction pointer, and exchanges a stored input/output instruction with a correct input/output instruction, and issues again the I/O address.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はマイクロコンピュータに関し、特に入出力vt
fflのエミュレーション回路に関する。
[Detailed Description of the Invention] [Industrial Application Field] The present invention relates to a microcomputer, and particularly to an input/output
This relates to an ffl emulation circuit.

〔従来の技術〕[Conventional technology]

あるコンピュータ:システムに他の既存のシステムから
ソフトウェアを移植しようとする場合の問題点の1つに
、そのソフトウェア中で使用しているIloの問題があ
る。すなわち、新しいシステムで使用しているIloの
アドレスが既存のシステムで使用しているIloのアド
レスと異なる場合、その部分のI/Oアドレスをすべて
書き換えてやらなければならない、しかしこの場合、ハ
ードウェア的には全く変更がいらないが、ソフトウェア
の修正が大変である。そこでソフトウェアを全く変更せ
ずに移植するため、ハードウェア的に対処する方法があ
る。
One of the problems when trying to port software to a computer system from another existing system is the Ilo used in the software. In other words, if the Ilo address used in the new system is different from the Ilo address used in the existing system, all I/O addresses in that part must be rewritten, but in this case, the hardware Generally speaking, there is no need to change anything, but it is difficult to modify the software. Therefore, there is a way to deal with this problem in terms of hardware in order to port it without changing the software at all.

その従来例を第3図と第4図を参照しながら説明する。A conventional example will be explained with reference to FIGS. 3 and 4.

CPO301はプログラムを解読し実行する。ここでC
PU301が解読した命令が入出力命令であるとアドレ
ス生成器302によりアドレスを計算して、外部アドレ
スバス303を通してI/Oアドレスを出力し、I/O
バスサイクルを走らせる。レジスタ307およびレジス
タ308にはエミュレーションすべきI/Oアドレスの
範囲があらかじめ設定されている。すなわち、レジスタ
307にはエミュレーションすべき上限のI/Oアドレ
スが、レジスタ308には下限のアドレスがあらかじめ
設定されている。
The CPO 301 decodes and executes the program. Here C
If the instruction decoded by the PU 301 is an input/output instruction, the address generator 302 calculates the address, outputs the I/O address through the external address bus 303, and outputs the I/O address.
Run a bus cycle. The range of I/O addresses to be emulated is set in advance in register 307 and register 308. That is, the upper limit I/O address to be emulated is preset in the register 307, and the lower limit address is preset in the register 308.

次に、CPU301がエミュレーションすべj1/O7
ドレスに対するI/O命令を実行し、I/Oバスサイク
ルを走らせたとする。このとき、外部アドレスバス30
3を通して比較器30Bに!/Oアドレスが入力する。
Next, the CPU 301 emulates j1/O7.
Assume that an I/O instruction for the address is executed and an I/O bus cycle is run. At this time, the external address bus 30
3 to comparator 30B! /O address is input.

一方、比較器306にはレジスタ3G?およびレジスタ
308が入力し、実行されたI/Oアドレスがレジスタ
307およびレジスタ308の範囲に入っていればその
I/OバスサイクルがエミュレーションすべきI/O命
令であると判断し、CPU301に対し割込み線301
1を活性化して知らせる。信号線305は実行中のバス
サイクルがI/Oバスサイクルであるときのみ活性化さ
れ、比較器306に入力する。信号[305が不活性時
は比較器306 も比較動作をしない。すなわち比較器
30BはI/O命令命令時のみ、そのI/Oアドレスが
レジスタ307および308に設定されたアドレスの範
囲内に入っているかどうかを判断し、入っていればCP
U301に対し割込み線308を活性化する。
On the other hand, the register 3G? and register 308, and if the executed I/O address is within the range of register 307 and register 308, it is determined that the I/O bus cycle is an I/O instruction to be emulated, and the CPU 301 Interrupt line 301
Activate and notify 1. Signal line 305 is activated and input to comparator 306 only when the bus cycle being executed is an I/O bus cycle. When the signal [305 is inactive, the comparator 306 also does not perform a comparison operation. In other words, the comparator 30B determines whether the I/O address is within the address range set in the registers 307 and 308 only when an I/O instruction is issued, and if it is, the CP
Activate interrupt line 308 for U301.

次に、cpu3旧は割込み線308より割込み要求と検
知すると第4図に示すフローで割込み処理を行なう、す
なわち、割込みが発生すると、 CPU301は割込み
が起きたときのプログラムのアドレスを退避するため、
この情報により、割込み処理ルーチン内で実行された命
令がどのような入出力命令であったのかを判別する(ス
テップ401)、次に実行された入出力命令を正しい入
出力命令に変換して(ステップ402)それを実行する
(ステップ403)。
Next, when the old CPU 3 detects an interrupt request from the interrupt line 308, it processes the interrupt according to the flow shown in Figure 4. That is, when an interrupt occurs, the CPU 301 saves the address of the program at the time the interrupt occurred.
Based on this information, it is determined what kind of input/output instruction the instruction executed within the interrupt handling routine was (step 401), and then the executed input/output instruction is converted into the correct input/output instruction ( Step 402) Execute it (Step 403).

その後再び元のプログラムに戻る。このような方法をと
ることで、誤った入出力命令を正しい入出力命令に変換
して再実行する。
Then return to the original program again. By adopting such a method, an incorrect input/output instruction is converted into a correct input/output instruction and re-executed.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

上述した従来のI/Oエシュレーシ、ン回路では、CP
U外部で入出力命令の検出と割込みの発生制御を行なっ
ており、一度誤った入出力命令を実行して、その後再び
正しい入出力命令を実行するため、もし、誤って実行さ
れた入出力命令のアドレスに何か他の入出力装置が割当
てられていた場合はそのシステムが誤動作する可能性が
あるという欠点がある。l!!fに、それが出力命令の
場合は入出力装置を誤プログラシングにしまい、正しい
出力命令を実行する前に誤動作する可能性が大きい。
In the conventional I/O estimation circuit described above, the CP
Detection of input/output instructions and control of interrupt generation are performed outside the U, and once an incorrect input/output instruction is executed, the correct input/output instruction is executed again, so if an incorrectly executed input/output instruction The disadvantage is that if some other input/output device is assigned to this address, the system may malfunction. l! ! f, if it is an output command, there is a high possibility that the input/output device will be programmed incorrectly and malfunction before the correct output command is executed.

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

本発明のI/Oエミュレーション回路は入出力命令検出
手段と、第1.第2のデータ保持手段と、入出力命令検
出手段によって入出力命令が検出されると、第1.第2
のデータ保持手段内に格納されているデータと実行中の
前記入出力命令のI/Oアドレスとを比較する比較手段
と、比較手段の比較により、入出力命令のI/Oアドレ
スが第1と第2のデータ保持手段に格納されたデータの
範囲外であれば、入出力バスサイクルを起動して入出力
命令の実行を継続させる入出力バスサイクル制御手段と
、比較手段の比較により、入出力命令のI/Oアドレス
が第1と第2のデータ保持手段内に格納されたデータの
範囲内であれば、内部割込みを発生する内部割込み発生
手段を有する。
The I/O emulation circuit of the present invention includes an input/output instruction detection means, a first . When an input/output command is detected by the second data holding means and the input/output command detection means, the first . Second
A comparison means compares the data stored in the data holding means with the I/O address of the input/output instruction being executed, and the comparison between the comparison means determines that the I/O address of the input/output instruction is the first one. If the data is outside the range of the data stored in the second data holding means, the input/output bus cycle control means activates the input/output bus cycle and continues execution of the input/output instruction, and the comparison means compares the input/output It has internal interrupt generating means for generating an internal interrupt if the I/O address of the instruction is within the range of data stored in the first and second data holding means.

すなわち、入出力命令を実行する前にCPu内部で正し
い入出力命令か否かを判断し、もし誤った入出力命令で
あれば誤ったI/Oバスサイクルを実行せずに、割込み
を起し、正しい入−出力命令だけを実行することができ
る。
In other words, before executing an input/output instruction, it is determined within the CPU whether it is a correct input/output instruction, and if it is an incorrect input/output instruction, an interrupt is generated without executing an incorrect I/O bus cycle. , only correct input-output instructions can be executed.

〔実施例〕〔Example〕

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

第1図は本発明のI/Oエミュレーション回路の一実施
例を内臓したマイクロプロセッサ(CPU)のブロック
図である。 CPU/O1内には、エミュレーションす
べきI/Oアドレスの範囲つまりエミュレーションすべ
き上限のI/Oアドレス、下限の1/Oアドレスが予め
設定されたレジスタ/O7,/O8と、 CPUl0I
が解読した命令が入出力命令のときに1/Oアドレスを
生成するアドレス発生器/O2と、I/Oトラップフラ
グ/O8と、I/O命令識別信号/O5が活性時、アド
レス生成器/O2で生成されたI/Oアドレスをレジス
タ/O7,/O8に設定したアドレスと比較し、エミュ
レーションすべきI/Oアドレスの範囲内にあれば”l
”を、範囲外であればOf′を■/Oトラップフラグ/
O9にセットする比較器/OBと、入出力命令が検出さ
れるとI/O命令識別信号/O5を活性化し、また、I
/Oトラップ/O8力(”Q”であればアドレス出力制
御°線1/Oを活性化してゲート111を開き、”1″
であれば割込み処理のマイクロプログラムを起動するマ
イクロプログラム112が設られている。
FIG. 1 is a block diagram of a microprocessor (CPU) incorporating an embodiment of the I/O emulation circuit of the present invention. Within the CPU/O1, there are registers /O7 and /O8 in which the range of I/O addresses to be emulated, that is, the upper limit I/O address and lower limit 1/O address to be emulated are set in advance, and the CPU10I.
The address generator /O2 generates a 1/O address when the instruction decoded by the input/output command, the I/O trap flag /O8, and the I/O instruction identification signal /O5 are activated. Compare the I/O address generated by O2 with the addresses set in registers /O7 and /O8, and if it is within the range of I/O addresses to be emulated,
”, and if it is outside the range, set Of' / O trap flag /
The comparator /OB is set to O9, and when an input/output command is detected, the I/O command identification signal /O5 is activated, and the I/O command is activated.
/O trap /O8 force (if "Q", activate address output control ° line 1/O and open gate 111, "1"
If so, a microprogram 112 is provided that starts a microprogram for interrupt processing.

次に、本実施例の動作を説明する。Next, the operation of this embodiment will be explained.

CPUl0Iはフェッチした命令を解読し実行する。CPUl0I decodes and executes the fetched instruction.

CPUl0Iは命令を解読するとマイクロプログラム1
12を実行する。ここで解読した命令が入出力命令であ
る場合、マイクロプログラム112の中の入出力命令用
のマイクロプログラムが走る。第2図はこの入出力命令
用マイクロプログラムのフローチャートである。初期状
態においてアドレス出力制御線1/Oは不活性状態であ
り、ゲートl11によりアドレスの外部への出力を強制
的に抑えている。まず、アドレス生成器によりI/Oア
ドレスを発生する0次に、レジスタ/O7とレジスタ/
O8にあらかじめ設定されているアドレスと、発生した
I/Oアドレスを比較器/O6で比較し、発生したI/
Oアドレスが設定されているアドレスの範囲内に入って
いれば■/Oトラップフラグ/O9をl″にセットする
6次にマイクロプログラムはIlo トラップフラグ/
O9を調べ(ステップ201)、”o”であればアドレ
ス出力制御線1/Oを活性化し、ゲー) 111をあけ
て前記I/Oアドレスを外部アドレスバス/O3へ出力
し、I/Oバスサイクルを走らせ、I/O命令の実行を
完了する(ステップ204)、 一方、Ilo )ラッ
プフラグ/O8カシ1″あれば、アドレス出力制御線1
/Oは不活性状態のままであり。
CPU10I decodes the instruction and executes microprogram 1.
Execute 12. If the instruction decoded here is an input/output instruction, a microprogram for input/output instructions in the microprogram 112 is run. FIG. 2 is a flowchart of this input/output instruction microprogram. In the initial state, the address output control line 1/O is inactive, and the output of the address to the outside is forcibly suppressed by the gate l11. First, an address generator generates an I/O address. Next, register /O7 and register /
The address preset in O8 and the generated I/O address are compared by comparator/O6, and the generated I/O address is
If the O address is within the set address range, ■/O trap flag/O9 is set to l''.6 Next, the microprogram sets Ilo trap flag/
Checks O9 (step 201), and if it is "o", activates address output control line 1/O, opens gate 111, outputs the I/O address to external address bus /O3, and outputs the I/O address to external address bus /O3. The cycle is run and the execution of the I/O instruction is completed (step 204). On the other hand, if the wrap flag /O8 is 1", the address output control line 1 is
/O remains inactive.

外部アドレスバス/O3にI/Oアドレスを出力しない
、さらに、I/Oトラップフラグ/O9が′1″である
ためマイクロプログラム112は割込み処理のマイクロ
プログラムを起動し、割込み処理ルーチンへ分岐する(
ステップ203)、割込み処理ルーチンへ分岐後は割込
みの発生したアドレスを、割込み時にスタッフに退避し
た命令ポインタの値から調べ、そこに格納されている誤
った入出力命令を正しい入出力命令に交換して、再度I
/Oアドレスを発行する。新たに発行された正しいI/
Oアドレスはレジスタ/O7.とレジスタ/O8に設定
されたアドレスの範囲には入っていないため、比較器l
O8は!IOトラップフラグ/O9を′″1″にセット
しない。
Since the I/O address is not output to the external address bus /O3 and the I/O trap flag /O9 is '1'', the microprogram 112 starts the interrupt processing microprogram and branches to the interrupt processing routine (
Step 203) After branching to the interrupt processing routine, the address where the interrupt occurred is checked from the value of the instruction pointer saved in the stuff at the time of the interrupt, and the incorrect input/output instruction stored there is replaced with the correct input/output instruction. Then I again
Issues /O address. Newly issued correct I/
The O address is register /O7. Since it is not within the address range set in register /O8, comparator l
O8 is! Do not set the IO trap flag /O9 to ``1''.

そのため、アドレス出力制御線1/Oは活性化されゲー
ト111をあけてI/Oアドレスを外部アドレスバス/
O3へ出力し、■/Oバスサイクルを実行し、入出力命
令の実行を完了する。
Therefore, the address output control line 1/O is activated and the gate 111 is opened to transfer the I/O address to the external address bus/
Outputs to O3, executes the /O bus cycle, and completes the execution of the input/output instruction.

〔発明の効果〕〔Effect of the invention〕

以上説明したように本発明は、入出力命令の検出や割込
みの発生制御をCpu内部で行なうことにより、誤った
入出力命令を実行せずに割込みを発生することができそ
のため、そのシステムに対し誤動作を引き起すこともな
く、効果的なIloのエミュレーションが可能となる効
果がある。
As explained above, the present invention detects input/output instructions and controls the generation of interrupts within the CPU, thereby making it possible to generate interrupts without executing erroneous input/output instructions. This has the effect of enabling effective Ilo emulation without causing malfunctions.

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

第1図は本発明のI/Oエミュレーション回路の一実施
例を有するCPuのブロック図、第2図は第1図の実施
例の入出力命令のマイクロプログラムのフローチャート
、第3図は従来のI/Oエミュレーション回路を示すC
Puのブロック図、第4図は割込み処理ルーチン内での
処理フローチャートである。 /O1・・・・・・cpu 。 1G2・・・・・・アドレス生成器。 /O3・・・・・・外部アドレスバス。 /O5・・・・・・I/O命令識別信号、/OB・・・
・・・比較器、 /O?・・・・・・上限アドレスのレジスタ、/O8・
・・・・・下限アドレスのレジスタ、/O9・・・・・
・!lOトラップフラグ、1/O・・・・・・アドレス
出力制御線、111 ・・・・・・ゲート、 112・・・・・・マイクロプログラム。
FIG. 1 is a block diagram of a CPU having an embodiment of the I/O emulation circuit of the present invention, FIG. 2 is a flowchart of a microprogram of input/output instructions in the embodiment of FIG. /O C showing emulation circuit
The block diagram of Pu, FIG. 4, is a processing flowchart in the interrupt processing routine. /O1...cpu. 1G2...Address generator. /O3...External address bus. /O5...I/O command identification signal, /OB...
... Comparator, /O?・・・・・・Upper address register, /O8・
...lower limit address register, /O9...
・! lO trap flag, 1/O... address output control line, 111... gate, 112... micro program.

Claims (1)

【特許請求の範囲】 入出力命令検出手段と、 第1、第2のデータ保持手段と、 入出力命令検出手段によって出力命令が検出されると、
第1、第2のデータ保持手段に格納されたデータと実行
中の前記入出力命令のI/Oアドレスとを比較する比較
手段と、 比較手段の比較により、入出力命令のI/Oアドレスが
第1と第2のデータ保持手段に格納されたデータの範囲
外であれば、入出力バスサイクルを起動して入出力命令
の実行を継続させる入出力バスサイクル制御手段と、 比較手段の比較により、入出力命令のI/Oアドレスが
第1と第2のデータ保持手段内に格納されたデータの範
囲内であれば、内部割込みを発生する内部割込み発生手
段を有するI/Oエミュレーション回路。
[Claims] When an output command is detected by the input/output command detection means, the first and second data holding means, and the input/output command detection means,
Comparing means for comparing the data stored in the first and second data holding means with the I/O address of the input/output instruction being executed, and the comparison between the comparing means determines the I/O address of the input/output instruction. If the data is outside the range of the data stored in the first and second data holding means, the input/output bus cycle control means activates the input/output bus cycle and continues execution of the input/output instruction, and the comparing means compares the data. . An I/O emulation circuit having internal interrupt generating means for generating an internal interrupt if the I/O address of the input/output instruction is within the range of data stored in the first and second data holding means.
JP2629686A 1986-02-07 1986-02-07 I/o emulation circuit Granted JPS62182959A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2629686A JPS62182959A (en) 1986-02-07 1986-02-07 I/o emulation circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2629686A JPS62182959A (en) 1986-02-07 1986-02-07 I/o emulation circuit

Publications (2)

Publication Number Publication Date
JPS62182959A true JPS62182959A (en) 1987-08-11
JPH0555905B2 JPH0555905B2 (en) 1993-08-18

Family

ID=12189361

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2629686A Granted JPS62182959A (en) 1986-02-07 1986-02-07 I/o emulation circuit

Country Status (1)

Country Link
JP (1) JPS62182959A (en)

Also Published As

Publication number Publication date
JPH0555905B2 (en) 1993-08-18

Similar Documents

Publication Publication Date Title
JP3176093B2 (en) Microprocessor interrupt controller
KR920003044B1 (en) Control system for guest execution of virtual computer system
US4914578A (en) Method and apparatus for interrupting a coprocessor
US5819078A (en) Addressing extended memory using millicode by concatenating a small millicode address and address extension data
JPS62182959A (en) I/o emulation circuit
JPH05250161A (en) Microcomputer device
JPS63129427A (en) Conversion circuit for interruption response logic
JP2572821B2 (en) Operation processing method by instruction re-execution
JP2503210B2 (en) Micro program controller
JPS63155330A (en) Microprogram controller
JPH03208132A (en) Single chip microcomputer
JPH0331940A (en) Microprogram controller
JPH0258128A (en) Data processor
JPH05257751A (en) Microcomputer
JPS60142428A (en) Emulation system
JPH04364531A (en) Microprocessor
JPS6349941A (en) Arithmetic processing unit
JPS6325736A (en) Interruption control system for virtual computer system
JPS59744A (en) Data processor
JPS63316137A (en) Information processor
JPH01175052A (en) Microaddress register mechanism
JPS62219032A (en) Initial diagnostic system
JPH01240941A (en) Information processor
JPS61251936A (en) Virtual computer system
JPS60198648A (en) Inspector for instruction code fetch address

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees