JP3027984B2 - Single chip microcomputer - Google Patents

Single chip microcomputer

Info

Publication number
JP3027984B2
JP3027984B2 JP2078110A JP7811090A JP3027984B2 JP 3027984 B2 JP3027984 B2 JP 3027984B2 JP 2078110 A JP2078110 A JP 2078110A JP 7811090 A JP7811090 A JP 7811090A JP 3027984 B2 JP3027984 B2 JP 3027984B2
Authority
JP
Japan
Prior art keywords
interrupt processing
operation mode
cpu
circuit
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.)
Expired - Lifetime
Application number
JP2078110A
Other languages
Japanese (ja)
Other versions
JPH03278132A (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 JP2078110A priority Critical patent/JP3027984B2/en
Publication of JPH03278132A publication Critical patent/JPH03278132A/en
Application granted granted Critical
Publication of JP3027984B2 publication Critical patent/JP3027984B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)
  • Microcomputers (AREA)

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、単一半導体基盤上にコンピュータ機能及び
中央処理装置(以下CPUと呼ぶ)のエミュレーション機
能を内蔵したシングルチップマイクロコンピュータにお
いて、割込み処理を行なうCPUを指定可能なシングルチ
ップマイクロコンピュータに係わる。
DETAILED DESCRIPTION OF THE INVENTION [Industrial Application Field] The present invention relates to a single-chip microcomputer having a computer function and an emulation function of a central processing unit (hereinafter referred to as a CPU) on a single semiconductor substrate. The present invention relates to a single-chip microcomputer capable of designating a CPU for performing the operation.

〔従来の技術〕[Conventional technology]

近年はLSI製造技術の進歩により、シングルチップマ
イクロコンピュータの分野においても高集積化が進み、
単位機能当たりのコストの低下も著しくなってきてい
る。
In recent years, with the advancement of LSI manufacturing technology, high integration has progressed even in the field of single-chip microcomputers,
The cost per unit function has been significantly reduced.

それに伴い、シングルチップマイクロコンピュータの
利用分野も拡大し、膨大なソフトウェアが蓄積されてき
ている。
Along with this, the field of use of single-chip microcomputers has also expanded, and enormous amounts of software have been accumulated.

上述したソフトウェア資産を有効に活用するために
は、アーキテクチャにおいて互換性のあるCPUを使用す
る必要があるが、性能向上、低コストの要求などの様々
な条件のため命令コードレベルで互換性のあるCPUを使
用することが不可能なことがある。
In order to make effective use of the above-mentioned software assets, it is necessary to use a CPU that is compatible in the architecture, but it is compatible at the instruction code level due to various conditions such as performance improvement and low cost requirements. Sometimes it is impossible to use the CPU.

このような場合、従来命令機能をエミュレートする機
能を内蔵し、過去のCPU用に作成したプログラムをその
まま使用可能とすることにより解決してきた。
In such a case, the problem has been solved by incorporating a function for emulating the conventional instruction function and enabling a program created for the past CPU to be used as it is.

つまり、ネイテイブモードのCPUが第一のCPUで、エミ
ュレーションモードのCPUが第二のCPUであるとすると、
ネイテイブモードからエミュレーションモードに切り換
えて第二のCPUの命令コードを実行する。他の場合には
第一のCPUのモード(ネイテイブモード)にて実行す
る。このようにして、第二のCPUに対して作成した過去
のソフトウェア資産を有効に活用し、ソフトウェア新規
作成の工数を削減してきた。
In other words, if the CPU in native mode is the first CPU and the CPU in emulation mode is the second CPU,
Switch from the native mode to the emulation mode and execute the instruction code of the second CPU. In other cases, it is executed in the mode of the first CPU (native mode). In this way, the past software assets created for the second CPU are effectively used, and the man-hours for creating new software have been reduced.

この際、割込み処理をどちらのモードで行なうかとい
う問題が存在するが、従来のシングルチップマイコンに
おいては、ネイテイブモードにて実行する構成であった
ため、第二のCPUの命令で書いた割込み処理プログラム
が使用できず、第一のCPUの命令を使用して新たに書き
直す必要があるためソフトウェア作成の工数が余分に必
要であるという欠点があった。以下、従来のシングルチ
ップマイクロコンピュータの例について第5図のマイク
ロコンピュータのブロック図を用いて説明する。
In this case, there is a problem in which mode the interrupt processing is performed. However, since the conventional single-chip microcomputer is configured to execute in the native mode, the interrupt processing program written by the instruction of the second CPU is used. However, it cannot be used, and it is necessary to newly rewrite using an instruction of the first CPU, so that there is a disadvantage that extra steps of software creation are required. Hereinafter, an example of a conventional single-chip microcomputer will be described with reference to a block diagram of the microcomputer shown in FIG.

まず構成要素の説明を行なう。 First, the components will be described.

第5図においてCPU3は中央処理装置である。 In FIG. 5, a CPU 3 is a central processing unit.

メモリ部9は、読み出し専用メモリROM(Read Only M
emory)および読み出し書込み共に可能なメモリRAM(Ra
ndom Access Memory)から構成し、ユーザープログラム
格納及びデータ処理の際にワーキングエリアとして用い
る。
The memory unit 9 includes a read-only memory ROM (Read Only M)
emory) and memory RAM (Ra
ndom Access Memory) and used as a working area when storing user programs and processing data.

内部バス6はアドレス及びデータを時分割に転送する
8ビットバスである。
The internal bus 6 is an 8-bit bus that transfers addresses and data in a time-division manner.

メインデコーダ4はネイテイブモードの際に使用する
命令デコーダである。サブデコーダ5は、エミュレーシ
ョンモードの際に使用する命令デコーダである。
The main decoder 4 is an instruction decoder used in the native mode. The sub-decoder 5 is an instruction decoder used in the emulation mode.

CPU3は、メモリ部9に格納した命令を内部バス6を介
してフェッチし、ネイテイブモードの時はメインデコー
ダ4にてデコードし、エミュレーションモードの際に
は、サブデコーダ5にてデコードすることにより、命令
を実行する。
The CPU 3 fetches the instruction stored in the memory unit 9 via the internal bus 6, decodes the instruction in the main decoder 4 in the native mode, and decodes the instruction in the sub-decoder 5 in the emulation mode. Execute the instruction.

周辺部10は、チップ外部とのデータ通信を行なうため
の入出力ポートで、内部バス6のデータをチップ外部に
出力し、チップ外部からの入力データを内部バス6に出
力する機能を持つ。
The peripheral section 10 is an input / output port for performing data communication with the outside of the chip, and has a function of outputting data of the internal bus 6 to the outside of the chip and outputting input data from the outside of the chip to the internal bus 6.

割込み制御回路2はチップ外部から入力される外部割
込み要求信号35に従って、CPUに割込み処理を実行させ
る。なお、割込み要求のプライオリテイは2レベルで、
ソフトウェアにより指定可能とする。
The interrupt control circuit 2 causes the CPU to execute interrupt processing according to an external interrupt request signal 35 input from outside the chip. The priority of the interrupt request is two levels.
It can be specified by software.

すなわち、割込み制御回路2はチップ外部から割込み
要求信号35を入力すると、割込み処理要求信号7及び割
込み要求のプライオリテイを指定するプライオリテイ指
定信号11をCPU3に出力する。この時CPU3は、割込み処理
受け付け信号8を出力し、割込み処理を実行する。
That is, upon receiving the interrupt request signal 35 from outside the chip, the interrupt control circuit 2 outputs to the CPU 3 the interrupt processing request signal 7 and the priority specifying signal 11 for specifying the priority of the interrupt request. At this time, the CPU 3 outputs the interrupt processing acceptance signal 8 and executes the interrupt processing.

なお、プライオリテイ指定信号11は、0の時プライオ
リテイが高いとする。
It is assumed that when the priority designation signal 11 is 0, the priority is high.

フラグ12は、割込み処理中にそのプライオリテイレベ
ルを保持する1ビットフラグで、CPU3が割込み処理要求
を受け付けるとプライオリテイ指定信号11の値を格納す
る。
The flag 12 is a 1-bit flag that holds the priority level during interrupt processing, and stores the value of the priority designation signal 11 when the CPU 3 receives an interrupt processing request.

上記構成要素を用いて動作説明を行なう。 The operation will be described using the above components.

CPU3は、命令コードをメモリ部9から読み出し、内部
バス6を介してフェッチする。フェッチした命令コード
は、ネイテイブモードの時はメインデコーダ4でデコー
ドし、エミュレーションモードの時は、サブデコーダ5
でデコード後実行する。命令実行が終了すると、メモリ
部9から次の命令をフェッチし、上述した処理を継続実
行する。
The CPU 3 reads the instruction code from the memory unit 9 and fetches the instruction code via the internal bus 6. The fetched instruction code is decoded by the main decoder 4 in the native mode, and is decoded by the sub-decoder 5 in the emulation mode.
Execute after decoding. When the execution of the instruction is completed, the next instruction is fetched from the memory unit 9 and the above-described processing is continuously executed.

命令デコーダの切り換えは、CPUの特殊命令によって
行なう。
The instruction decoder is switched by a special instruction of the CPU.

すなわち、CPUの特殊命令の実行により、命令デコー
ダをサブデコーダ5に切換えて、エミュレーションモー
ドにてプログラムを実行する。エミュレーションモード
におけるプログラムの実行終了時には、さらに特殊命令
によりメインデコーダ4に切換えて、ネイテイブモード
にてプログラムを実行する。
That is, the instruction decoder is switched to the sub-decoder 5 by executing the special instruction of the CPU, and the program is executed in the emulation mode. When the execution of the program in the emulation mode is completed, the program is switched to the main decoder 4 by a special instruction, and the program is executed in the native mode.

プライオリテイ付き割込み処理の実行及び命令による
CPUの動作モード切換えに関しては、日本電気(株)半
導体マーケティング本部発行のデータブック“Vシリー
ズマイクロプロセッサ/周辺1988"のP860−P875及びP11
4−P116におのおの詳しく述べてある。
Execution of priority interrupt processing and instruction
Regarding the switching of the CPU operation mode, refer to P860-P875 and P11 of the data book "V Series Microprocessor / Peripheral 1988" issued by Semiconductor Marketing Division of NEC Corporation.
Details are described in 4-P116.

次に、割込み処理時の動作を説明する。 Next, the operation at the time of interrupt processing will be described.

チップ外部から割込み要求が生じると、割込み制御回
路2はCPU3に対して、割込み処理要求信号7を出力す
る。
When an interrupt request is generated from outside the chip, the interrupt control circuit 2 outputs an interrupt processing request signal 7 to the CPU 3.

この時フラグ12にて指定する、CPUにて処理中の割込
み処理のプライオリテイがプライオリテイ信号11で指定
するプライオリテイより低いか同等の場合、CPU3は、命
令実行処理の最終タイミングで割込み処理要求を受け付
け、割込み処理受け付け信号8を出力する。このときCP
Uの動作モードがなんであろうと、CPU3は命令デコーダ
をメインデコーダ4に設定し、ネイテイブモードにて割
込み処理を実行すると同時に、プライオリテイレベルを
フラグ12に格納する。
At this time, if the priority of the interrupt processing being processed by the CPU specified by the flag 12 is lower than or equal to the priority specified by the priority signal 11, the CPU 3 requests the interrupt processing at the final timing of the instruction execution processing. And outputs an interrupt processing acceptance signal 8. At this time CP
Regardless of the operation mode of U, the CPU 3 sets the instruction decoder to the main decoder 4, executes the interrupt processing in the native mode, and stores the priority level in the flag 12 at the same time.

割込み処理からの復帰時(例えば、RETI命令実行時)
には、再び割込み処理前の動作モードに戻る。
When returning from interrupt processing (for example, when executing a RETI instruction)
Returns to the operation mode before the interrupt processing.

上記シングルチップマイクロコンピュータにおいて
は、割込み処理に際して、必らずネイテイブモードにて
処理を行なうので、エミュレーションモードCPUの命令
にて作成したプログラムがそのまま使用できる場合で
も、ネイテイブモードCPUの命令を用いて新規に割込み
制御プログラムを作成する必要がある。さらに検査も行
なわなければならず、ソフトウェアの新規作成に伴う工
数が膨大になる。これは、エミュレーションモードを内
蔵した効果を弱める結果となる。
In the above single-chip microcomputer, the interrupt processing is always performed in the native mode, so even if the program created by the instruction of the emulation mode CPU can be used as it is, a new instruction is executed using the instruction of the native mode CPU. Need to create an interrupt control program. In addition, inspection must be performed, and the number of steps involved in newly creating software is enormous. This has the consequence of weakening the effect of incorporating the emulation mode.

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

上述したように、従来のシングルチップマイクロコン
ピュータにおいては、割込み処理実行時に必ずネイテイ
ブモードとなるため、エミュレーションCPUの命令で記
述したプログラムをネイテイブモードのCPUの命令を用
いて作成しなおす必要があり、プログラムのデバッグ及
び検査作業も考慮に入れると、膨大な工数が必要になる
という欠点があった。
As described above, in the conventional single-chip microcomputer, since the mode is always set to the native mode when executing the interrupt processing, it is necessary to re-create the program described by the instruction of the emulation CPU using the instruction of the native mode CPU. Considering the debugging and inspection work of the program, there is a disadvantage that a huge number of man-hours are required.

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

本発明に係わるシングルチップマイクロコンピュータ
は、単一半導体基盤上にコンピュータ機能を集積し、中
央処理装置のエミュレーション機能を内蔵したシングル
チップマイクロコンピュータにおいて、割込み処理別に
前記中央処理装置の動作モードを指定するレジスタ,割
込み処理中に出力される割込ベクタ情報との論理積和を
とり出力する論理積和回路,前記論理積和回路の出力を
保持する1ビットのラッチ回路から構成する動作モード
指定回路を内蔵し、前記動作モード指定回路の出力によ
って割込み処理時の前記中央処理装置の動作モードを指
定する手段を内蔵したことを特徴とする。
A single-chip microcomputer according to the present invention has a computer function integrated on a single semiconductor substrate and designates an operation mode of the central processing unit for each interrupt processing in a single-chip microcomputer having a built-in emulation function of a central processing unit. An operation mode designating circuit comprising a register, an AND circuit for calculating and adding a logical sum of the interrupt vector information output during interrupt processing, and a 1-bit latch circuit for holding the output of the logical sum circuit. And a means for designating an operation mode of the central processing unit at the time of interrupt processing by an output of the operation mode designating circuit.

または、上記シングルチップマイクロコンピュータに
おいて、前記動作モード指定回路に対し、前記中央処理
装置の命令によりセット及びクリアの可能な1ビットの
ラッチ回路を付加し、前記ラッチ回路の値により割込み
処理要求の優先順位に応じて前記動作モード指定回路の
出力値を決定する手段を内蔵したことを特徴とする。
Alternatively, in the single-chip microcomputer, a 1-bit latch circuit that can be set and cleared by an instruction from the central processing unit is added to the operation mode designating circuit, and the priority of an interrupt processing request is determined by the value of the latch circuit. A means for determining an output value of the operation mode designating circuit according to the order is incorporated.

このように、本発明に係わるシングルチップマイクロ
コンピュータにおいては、割込み処理時のCPUの動作モ
ードを、割込み要求単位で指定可能な機能を内蔵してお
り、必要に応じて割込み処理を行なうCPUをエミュレー
ションCPUに指定することにより、エミュレーショCPUの
命令で記述したソフトウェアをそのまま使用可能であ
り、ソフトウェア作成の工数も大幅に削減する。
As described above, the single-chip microcomputer according to the present invention has a function capable of designating the operation mode of the CPU at the time of interrupt processing in units of interrupt requests, and emulating the CPU that performs interrupt processing as necessary. By specifying to the CPU, the software described by the emulation CPU instruction can be used as it is, and the man-hour for software creation is greatly reduced.

〔実施例〕〔Example〕

第1図は本発明に係わる第1の実施例のシングルチッ
プマイクロコンピュータのブロック図である。
FIG. 1 is a block diagram of a single-chip microcomputer according to a first embodiment of the present invention.

本発明に係わる第1の実施例のシングルチップマイク
ロコンピュータにおいては、動作モード指定回路を付加
し、割込み処理時のCPUの動作モードを割込み処理要求
単位に指定する機能を付加した以外は、第5図に示す従
来例と相違がない。よって、以下動作モード指定回路を
中心に第1図を用いて説明する。本実施例においては、
エミュレーションCPUを1個として説明を行なう。
The single-chip microcomputer according to the first embodiment of the present invention has a fifth mode except that an operation mode designating circuit is added and a function of designating the operation mode of the CPU at the time of interrupt processing in interrupt processing request units is added. There is no difference from the conventional example shown in the figure. Therefore, the operation mode designating circuit will be mainly described below with reference to FIG. In this embodiment,
The description will be made with one emulation CPU.

第1図に示す第1の実施例のシングルチップマイクロ
コンピュータは、割込み処理時のCPUの動作モードを、
割込み処理要求単位に指定する機能を従来のシングルチ
ップマイコンに付加した構成である。
The single-chip microcomputer according to the first embodiment shown in FIG.
This is a configuration in which a function to specify an interrupt processing request unit is added to a conventional single-chip microcomputer.

CPU3は、動作モード設定命令を実行すると、動作モー
ドを指定する8ビットデータを内部バス6に出力すると
ともに、動作モード指定回路20に対し、動作モード設定
信号7を出力する。
When the CPU 3 executes the operation mode setting instruction, it outputs 8-bit data specifying the operation mode to the internal bus 6 and outputs an operation mode setting signal 7 to the operation mode specifying circuit 20.

CPU3は、割込み処理からの復帰命令(例えば、RETI命
令)実行終了時に割込み処理実行前の動作モードに復帰
する。
The CPU 3 returns to the operation mode before the execution of the interrupt processing when the execution of the return instruction from the interrupt processing (for example, the RETI instruction) is completed.

動作モード指定回路20は、割込み処理時にデコーダ切
り換え信号24をCPU3に出力すると共に、内蔵の動作モー
ド指定レジスタ23の格納値に従って、割込み処理要求単
位で割込み処理時の動作モードを指定する。
The operation mode designating circuit 20 outputs the decoder switching signal 24 to the CPU 3 at the time of interrupt processing, and designates the operation mode at the time of interrupt processing in units of interrupt processing requests according to the value stored in the built-in operation mode specification register 23.

以下、動作を説明する。 Hereinafter, the operation will be described.

割込み処理要求が発生すると、割込み制御回路2は割
込み処理要求信号7及びプライオリテイ指定信号11をCP
U3に出力する。CPU3は、命令実行の最終タイミングで割
込み処理要求を受け付け、割込み処理受け付け信号8を
割込み制御回路2及び動作モード指定回路20に出力す
る。
When an interrupt processing request occurs, the interrupt control circuit 2 outputs the interrupt processing request signal 7 and the priority designation signal 11 to the CP.
Output to U3. The CPU 3 receives an interrupt processing request at the final timing of instruction execution, and outputs an interrupt processing reception signal 8 to the interrupt control circuit 2 and the operation mode designating circuit 20.

この時、割込み制御回路2は、割込み処理受け付け信
号8に同期して割込みベクタ情報を内部バス6を介して
CPU3に対し出力する。
At this time, the interrupt control circuit 2 transmits the interrupt vector information via the internal bus 6 in synchronization with the interrupt processing acceptance signal 8.
Output to CPU3.

ここで、前記割込みベクタ情報は8ビット長のデータ
であり、最大8個の割込み処理要求に応じて、1ビット
のみ1で他の7ビットは0の8種類の情報であるとす
る。
Here, the interrupt vector information is 8-bit data, and it is assumed that there are eight types of information, one bit being 1 and the other 7 bits being 0 in response to a maximum of eight interrupt processing requests.

この時、動作モード指定回路20は、動作モード指定レ
ジスタ23の内容と、内部バス6を介して転送する割込み
ベクタ情報とで、ビット単位での論理積和を論理積和回
路26でとり、結果を割込み処理受け付け信号8に同期し
てラッチ回路25に格納する。
At this time, the operation mode designating circuit 20 takes the logical sum of each bit by the logical sum circuit 26 based on the contents of the operation mode designating register 23 and the interrupt vector information transferred via the internal bus 6, and Is stored in the latch circuit 25 in synchronization with the interrupt processing acceptance signal 8.

従って、CPU3はラッチ回路25の出力である動作モード
指定信号24に従って、CPUの動作モードをネイテイブモ
ードまたはエミュレーションモードに切り換え、割込み
処理を実行する。
Therefore, the CPU 3 switches the operation mode of the CPU to the native mode or the emulation mode according to the operation mode designation signal 24 output from the latch circuit 25, and executes the interrupt processing.

CPU3は、割込み処理からの復帰命令実行時に、割込み
処理実行前の動作モードに復帰し、命令処理を続行す
る。
When executing the return instruction from the interrupt processing, the CPU 3 returns to the operation mode before the execution of the interrupt processing, and continues the instruction processing.

動作モード指定信号24は、割込み処理中のみ有効な信
号である。
The operation mode designation signal 24 is a signal that is valid only during interrupt processing.

次に、動作モード指定回路20について第2図を使用し
て説明する。
Next, the operation mode designating circuit 20 will be described with reference to FIG.

まず、構成要素を説明する。 First, the components will be described.

動作モード指定レジスタ23は、8ビットのレジスタで
ありCPU3の動作モード指定命令によってライトする。
The operation mode designation register 23 is an 8-bit register and is written by an operation mode designation instruction of the CPU 3.

つまり、CPU3が動作モード指定命令を実行するとレジ
スタ設定信号21を出力し、内部バス6上のデータをライ
トする。
That is, when the CPU 3 executes the operation mode designation instruction, the CPU 3 outputs the register setting signal 21 and writes the data on the internal bus 6.

動作モード指定レジスタ23のあるビットに1をライト
すると、対応する割込み処理要求が生じると、論理積和
回路26は、1を出力し、割込み処理受け付け信号8に同
期してラッチ回路25に1をセットする。従って、割込み
処理においてCPU3はデコーダをサブデコーダ5に設定し
て割込み処理を実行する。
When 1 is written to a certain bit of the operation mode designating register 23, when a corresponding interrupt processing request occurs, the AND circuit 26 outputs 1 and 1 is input to the latch circuit 25 in synchronization with the interrupt processing acceptance signal 8. set. Therefore, in the interrupt processing, the CPU 3 sets the decoder to the sub-decoder 5 and executes the interrupt processing.

第6図に、論理積和回路26の構成を示す。 FIG. 6 shows the configuration of the AND circuit 26.

論理積和回路26は、8個の2入力ANDゲート及び1個
の8入力ORゲートからなり、動作モード指定レジスタ23
の格納値及び内部バス6上の値との間で、対応するビッ
ト間で論理積をとり、結果を全て論理和して出力する。
The AND circuit 26 comprises eight 2-input AND gates and one 8-input OR gate.
Between the corresponding bit and the stored value of the internal bus 6 and the value on the internal bus 6, and ORs all the results and outputs the result.

動作モード指定レジスタ23のあるビットに0をライト
すると、対応する割込み処理において、論理積和回路26
は、0を出力し、ラッチ回路25に0をセットする。従っ
て、割込み処理CPU3はデコーダをメインデコーダ4に設
定して割込み処理を実行する。
When 0 is written to a certain bit of the operation mode designating register 23, the logical product sum circuit 26
Outputs 0, and sets 0 to the latch circuit 25. Therefore, the interrupt processing CPU 3 sets the decoder to the main decoder 4 and executes the interrupt processing.

上記構成要素を用いて、以下に割込み処理動作を説明
する。
The interrupt processing operation will be described below using the above components.

CPU3が割込み処理受け付け信号8を出力すると、割込
み制御回路20は、割込み処理ベクタ情報を内部バス6に
出力する。
When the CPU 3 outputs the interrupt processing acceptance signal 8, the interrupt control circuit 20 outputs the interrupt processing vector information to the internal bus 6.

この時、論理積和回路26は、動作モード設定レジスタ
23の内容と割込み処理ベクタ情報とで、ビット単位に論
理積及びその結果を論理和としてラッチ回路25に対し出
力する。
At this time, the logical sum circuit 26 operates in the operation mode setting register.
Based on the contents of 23 and the interrupt processing vector information, a logical product and the result of the logical product are output as a logical sum to the latch circuit 25 in bit units.

この時、割込み処理受け付け信号8が1であるから、
ラッチ回路25は、前記信号をラッチし、動作モード指定
信号24として、CPU3に対して出力する。
At this time, since the interrupt processing acceptance signal 8 is 1,
The latch circuit 25 latches the signal and outputs the signal to the CPU 3 as the operation mode designation signal 24.

従って、CPU3はデコーダ切り換え信号40が出力されて
いるため、外部端子11の入力レベルに従って、エミュレ
ーションモードもしくはネイテイブモードにて割込み処
理を実行する。
Therefore, since the decoder switching signal 40 is output, the CPU 3 executes the interrupt processing in the emulation mode or the native mode according to the input level of the external terminal 11.

すなわち、割込み処理ベクタ情報における値が1のビ
ット位置に対応した動作モード指定レジスタのビットの
格納データ=0の時、動作モード指定信号24=0となる
ためネイテイブモードにて実行し、動作モード指定レジ
スタの対応したビットの格納データ=1の時動作モード
指定信号24=1となるためエミュレーションモードにて
実行する。
That is, when the data stored in the bit of the operation mode designating register corresponding to the bit position where the value in the interrupt processing vector information is 1 is 0, the operation mode designating signal 24 becomes 0, so that the operation is executed in the native mode. When the storage data of the corresponding bit of the register = 1, the operation mode designating signal 24 becomes 1, so that the operation is executed in the emulation mode.

CPU3は、割込み処理からの復帰命令実行時に、割込み
要求処理実行前の動作モードに復帰し、命令処理を続行
することとなる。
When executing the return instruction from the interrupt processing, the CPU 3 returns to the operation mode before the execution of the interrupt request processing, and continues the instruction processing.

上述したように、第1の実施例に係わるシングルチッ
プマイクロコンピュータにおいては、簡単な構成から成
る動作モード指定回路を付加することにより、割込み処
理を行なうCPUを割込み処理単位で指定可能であり、対
応する動作モード指定レジスタのビットを1に設定する
ことにより、エミュレーションCPUの命令で記述した割
込み処理プログラムをそのまま使用可能である。
As described above, in the single-chip microcomputer according to the first embodiment, by adding an operation mode designating circuit having a simple configuration, it is possible to designate a CPU that performs interrupt processing in units of interrupt processing. By setting the bit of the operation mode designating register to 1 to 1, the interrupt processing program described by the instruction of the emulation CPU can be used as it is.

従って、蓄積したソフトウェアをそのまま使用できる
ため、エミュレーションモード内蔵の効果が向上する。
Therefore, since the stored software can be used as it is, the effect of incorporating the emulation mode is improved.

また、割込み処理にネイテイブモードCPUのプログラ
ムを用いたい場合でも、対応する動作モード指定レジス
タのビットを0に設定することにより、ネイテイブモー
ドのCPUで処理することが可能であり、フレキシブルな
構成が実現できる。
Even if you want to use the native mode CPU program for interrupt processing, you can set the bit of the corresponding operation mode specification register to 0 to process it in the native mode CPU, realizing a flexible configuration. it can.

上記第1の実施例においては、エミュレーション可能
なCPUを1個として説明したが、複数の場合も同様に考
えることが可能である。
In the first embodiment described above, the number of CPUs which can be emulated is one, but a plurality of CPUs can be similarly considered.

次に本発明に係わるシングルチップマイクロコンピュ
ータの第2の実施例について、第3図を用いて説明す
る。
Next, a second embodiment of the single-chip microcomputer according to the present invention will be described with reference to FIG.

第3図は本発明における第2の実施例のシングルチッ
プマイクロコンピュータのブロック図である。
FIG. 3 is a block diagram of a single-chip microcomputer according to a second embodiment of the present invention.

本発明に係わる第2の実施例のシングルチップマイク
ロコンピュータにおいては、割込み処理を行なうCPUの
指定を割込み処理要求単位にて行なうのみではなく、さ
らにプライオリテイ指定信号のレベルに応じて行なう点
で、第1の実施例に係わるシングルチップマイコンと異
なる。
In the single-chip microcomputer according to the second embodiment of the present invention, the CPU that performs interrupt processing is specified not only in units of interrupt processing requests but also in accordance with the level of a priority specification signal. This is different from the single-chip microcomputer according to the first embodiment.

以下、第3図を用いて説明する。本実施例において
は、エミュレーション可能なCPUは1個として説明す
る。
Hereinafter, description will be made with reference to FIG. In the present embodiment, the description will be made assuming that one CPU can be emulated.

第3図に示す第2の実施例のシングルチップマイクロ
コンピュータは、割込み処理時のCPUの動作モードを割
込み処理要求単位で指定する機能に加え、さらに割込み
処理要求のプライオリテイレベルに応じて指定する機能
を第一の実施例に係わるシングルチップマイコンに付加
した構成である。
The single-chip microcomputer according to the second embodiment shown in FIG. 3 has a function of designating the operation mode of the CPU at the time of interrupt processing in units of interrupt processing requests, and further specifies the operation mode according to the priority level of the interrupt processing request. This is a configuration in which functions are added to the single-chip microcomputer according to the first embodiment.

CPU3は、セット命令実行時にセット信号45を動作モー
ド指定回路40に出力し、リセット命令実行時にリセット
信号46を動作モード指定回路40に出力する。
The CPU 3 outputs a set signal 45 to the operation mode designating circuit 40 when the set instruction is executed, and outputs a reset signal 46 to the operation mode designating circuit 40 when the reset instruction is executed.

CPU3は、割込み処理からの復帰命令(例えば、RETI命
令)実行終了時に割込み処理前の動作モードに復帰す
る。
The CPU 3 returns to the operation mode before the interrupt processing at the end of the execution of the return instruction from the interrupt processing (for example, the RETI instruction).

動作モード指定回路40は、割込み処理時にプライオリ
テイ指定信号11に応じて、割込み処理受け付け信号8に
同期して動作モード指定信号41を出力し、割込み処理時
のCPU3の動作モードを指定する。
The operation mode designating circuit 40 outputs an operation mode designating signal 41 in synchronization with the interrupt processing accepting signal 8 according to the priority designating signal 11 at the time of interrupt processing, and designates an operation mode of the CPU 3 at the time of interrupt processing.

以下、割込み処理動作を説明する。 Hereinafter, the interrupt processing operation will be described.

割込み処理要求が発生すると、割込み制御回路2は割
込み処理要求信号7及びプライオリテイ指定信号11をCP
U3に出力する。CPU3は、命令実行の最終タイミングで割
込み処理要求を受け付け、割込み処理受け付け信号8を
割込み制御回路2及び動作モード指定回路40に出力す
る。
When an interrupt processing request occurs, the interrupt control circuit 2 outputs the interrupt processing request signal 7 and the priority designation signal 11 to the CP.
Output to U3. The CPU 3 receives an interrupt processing request at the final timing of instruction execution, and outputs an interrupt processing reception signal 8 to the interrupt control circuit 2 and the operation mode designating circuit 40.

動作モード指定回路40は、動作モード指定信号41を割
込み処理受け付け信号8に同期してCPU3に出力する。CP
U3は、動作モード指定信号41に従って、動作モード指定
信号41=0の時ネイテイブモードにて、動作モード指定
信号41=1の時エミュレーションモードにて割込み処理
を実行する。
The operation mode designating circuit 40 outputs the operation mode designating signal 41 to the CPU 3 in synchronization with the interrupt processing accepting signal 8. CP
According to the operation mode designation signal 41, U3 executes the interrupt processing in the native mode when the operation mode designation signal 41 = 0 and in the emulation mode when the operation mode designation signal 41 = 1.

CPU3は、割込み処理からの復帰命令(例えばRETI命
令)実行終了時に割込み処理実行前の動作モードに復帰
し、命令処理を続行する。
When the return instruction from the interrupt processing (for example, the RETI instruction) has been executed, the CPU 3 returns to the operation mode before the execution of the interrupt processing, and continues the instruction processing.

CPU3は、割込み処理中のみ動作モード指定信号41にし
たがって、命令デコーダを切り換えるものとする。
The CPU 3 switches the instruction decoder according to the operation mode designation signal 41 only during the interrupt processing.

次に、動作モード指定回路40について第4図を使用し
て説明する。
Next, the operation mode designating circuit 40 will be described with reference to FIG.

まず、構成要素を説明する。 First, the components will be described.

動作モード指定回路40は、第一の実施例に係わるシン
グルチップマイコンの動作モード指定回路20に対し、割
込み処理要求のプライオリテイに従って、動作モード指
定信号41の出力を制御する手段を付加したものである。
The operation mode designating circuit 40 is different from the operation mode designating circuit 20 of the single chip microcomputer according to the first embodiment in that a means for controlling the output of the operation mode designating signal 41 according to the priority of the interrupt processing request is added. is there.

したがって、第一の実施例に係わるシングルチップマ
イコンの動作モード指定回路20との相違点を中心に以下
説明する。
Therefore, the following description focuses on differences from the operation mode designating circuit 20 of the single-chip microcomputer according to the first embodiment.

動作モード指定回路40は、動作モード指定回路20にた
いし、ANDゲート42,ORゲート43及び1ビットラッチ回路
44及びセット信号45及びクリア信号46を付加した構成で
ある。
The operation mode designating circuit 40 includes an AND gate 42, an OR gate 43, and a 1-bit latch circuit.
44, a set signal 45 and a clear signal 46 are added.

ラッチ回路44は、セット信号45によりセット,リセッ
ト信号46によりリセットする1ビットフラグであり、格
納値をORゲート43に出力する。1ビットのラッチ回路25
は、割込み処理受け付け信号8に同期してANDゲート42
の出力を格納するフラグであり、動作モード指定信号41
としてCPU3に格納値を出力する。
The latch circuit 44 is a 1-bit flag that is set by a set signal 45 and reset by a reset signal 46, and outputs a stored value to the OR gate 43. 1-bit latch circuit 25
Is synchronized with the interrupt processing acceptance signal 8 by the AND gate 42.
Is a flag that stores the output of
And outputs the stored value to CPU3.

ANDゲート42は、論理積和回路26の出力及びORゲート4
3の出力を入力とする2入力ANDゲートであり、結果をラ
ッチ回路25に対し出力する。
The AND gate 42 outputs the output of the AND circuit 26 and the OR gate 4
This is a two-input AND gate having the output of 3 as an input, and outputs the result to the latch circuit 25.

ORゲート43はラッチ回路44の出力及びプライオリテイ
指定信号11を入力とする2入力ORゲートであり、ANDゲ
ート42に対して結果を出力する。
The OR gate 43 is a two-input OR gate to which the output of the latch circuit 44 and the priority designation signal 11 are input, and outputs the result to the AND gate 42.

上記構成要素を用いて、以下に割込み処理動作を説明
する。
The interrupt processing operation will be described below using the above components.

CPU3が割込み処理受け付け信号8を出力すると、割込
み制御回路20は、割込み処理ベクタ情報を内部バス6に
出力する。
When the CPU 3 outputs the interrupt processing acceptance signal 8, the interrupt control circuit 20 outputs the interrupt processing vector information to the internal bus 6.

この時、論理積和回路26は、動作モード設定レジスタ
23の内容と割込み処理ベクタ情報とで、ビット単位に論
理積及びその結果を論理和としてANDゲート42に対し出
力する。
At this time, the logical sum circuit 26 operates in the operation mode setting register.
Based on the content of 23 and the interrupt processing vector information, a logical product and the result of the logical product are output to the AND gate 42 as a logical sum in bit units.

ANDゲート42は論理積和回路26の出力及びORゲート43
の出力を入力として、結果をラッチ回路25に出力する。
The AND gate 42 outputs the output of the AND circuit 26 and the OR gate 43.
, And outputs the result to the latch circuit 25.

ORゲート43は、割込み処理要求のプライオリテイレベ
ルが0の時、ラッチ回路44の格納値をそのまま出力し、
1の時1を出力する。
When the priority level of the interrupt processing request is 0, the OR gate 43 outputs the stored value of the latch circuit 44 as it is,
When it is 1, 1 is output.

従って、ANDゲート42は割込み処理要求のプライオリ
テイレベルが0の時ラッチ回路44の値と論理積和回路26
の出力のANDを出力し、割込み処理要求のプライオリテ
イレベルが1の時論理積和回路26の出力をそのまま出力
する。
Therefore, when the priority level of the interrupt processing request is 0, the AND gate 42 and the value of the latch circuit 44 and the logical product sum circuit 26
And outputs the output of the AND circuit 26 as it is when the priority level of the interrupt processing request is 1.

即ち、割込み処理要求のプライオリテイレベルが0の
時のみ、ラッチ回路44の値に従って、割込み処理におけ
るCPU3の動作モードを指定可能である。
That is, the operation mode of the CPU 3 in the interrupt processing can be designated according to the value of the latch circuit 44 only when the priority level of the interrupt processing request is 0.

例えば、ラッチ回路44=0の時のみ、ANDゲート42の
出力を常に0に設定可能であるため、CPU3の動作モード
をネイテイブモードに指定可能である。
For example, the output of the AND gate 42 can always be set to 0 only when the latch circuit 44 = 0, so that the operation mode of the CPU 3 can be designated as the native mode.

従って、一般的にエミュレーションモードにおける処
理より、ネイテイブモードにおける処理のほうが高速に
行なえるため、割込み処理要求のプライオリテイの高い
ものを全てネイテイブモードにて実行したい時、割込み
処理の高速化が容易に実現できる。
Therefore, in general, the processing in the native mode can be performed faster than the processing in the emulation mode. Therefore, when it is desired to execute all interrupt processing requests having high priority in the native mode, the speed of the interrupt processing can be easily increased. realizable.

つまり、プライオリテイの高い割込み処理を全てネイ
テイブモードにて実行するかどうか、前記ラッチ回路44
の設定により簡単に指定できる。
That is, whether or not to execute all the high-priority interrupt processing in the native mode is determined by the latch circuit 44.
You can easily specify by setting.

従って、プライオリテイの高い割込み処理プログラム
を高速実行の可能なネイテイブモードにて実行したい場
合、前もってネイテイブモードにてクリア命令を実行
し、ラッチ回路44の格納値を0に設定することにより動
作モード指定レジスタ23の格納値に拘らず全てネイテイ
ブモードにて実行させることが可能である。
Therefore, when it is desired to execute a high-priority interrupt processing program in the native mode capable of high-speed execution, execute the clear instruction in the native mode in advance and set the stored value of the latch circuit 44 to 0 to specify the operation mode. Regardless of the value stored in the register 23, it is possible to execute all in the native mode.

上述したように、第2の実施例に拘わるシングルチッ
プマイクロコンピュータにおいては、簡単な構成から成
る動作モード指定回路を付加することにより、ネイテイ
ブCPUの命令により割込み処理を行なうCPUモードを割込
み処理要求単位で指定可能であり、エミュレーションCP
Uの命令で記述した割込み処理プログラムをそのまま使
用可能である。
As described above, in the single-chip microcomputer according to the second embodiment, by adding the operation mode designating circuit having a simple configuration, the CPU mode in which the interrupt processing is performed by the instruction of the native CPU is set in the unit of the interrupt processing request. And emulation CP
The interrupt processing program described by the U instruction can be used as it is.

従って、蓄積したソフトウェアをそのまま使用できる
ため、エミュレーションモード内蔵の効果が向上する。
Therefore, since the stored software can be used as it is, the effect of incorporating the emulation mode is improved.

また、プライオリテイの高い割込み処理を全てネイテ
イブモードのCPUで行なうことも簡単に指定可能であ
り、フレキシブルな構成が実現できる。
It is also possible to easily specify that all high-priority interrupt processing is performed by the CPU in the native mode, and a flexible configuration can be realized.

上記第2の実施例においては、エミュレーション可能
なCPUを1個として説明したが、複数の場合も上記動作
モード指定回路の構成を拡張することにより簡単に対応
可能である。
In the above-described second embodiment, one emulation-capable CPU has been described. However, a plurality of CPUs can be easily coped with by extending the configuration of the operation mode designating circuit.

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

以上説明したように本発明においては、簡単な構成か
ら成る動作モード指定回路を内蔵することにより、割込
み処理要求単位で割込み処理を行なうCPUを指定可能で
あり、従来ネイテイブモードに固定されていたために使
用できなかったエミュレーションCPUに対し作成済みの
割込み処理プログラムをそのまま使用可能であり、ネイ
テイブモードCPUの命令を用いて新たに割込み処理プロ
グラムを作成する工数を削減可能である。さらに、プロ
グラムの検査も行なう必要がなくなるため、効果は非常
に大きい。
As described above, in the present invention, by incorporating an operation mode designating circuit having a simple configuration, it is possible to designate a CPU that performs interrupt processing in units of interrupt processing requests, and since the CPU is conventionally fixed to the native mode, The interrupt processing program created for the emulation CPU that could not be used can be used as it is, and the man-hour for creating a new interrupt processing program using the instructions of the native mode CPU can be reduced. Further, the effect is very large because it is not necessary to check the program.

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

第1図は本発明の第1の実施例におけるシングルチップ
マイクロコンピュータのブロック図、第2図は第1の実
施例における動作モード指定回路のブロック図、第3図
は第2の実施例におけるシングルチップマイクロコンピ
ュータのブロック図、第4図は第2の実施例における動
作モード指定回路のブロック図、第5図は従来のシング
ルチップマイクロコンピュータのブロック図、第6図は
本実施例に係わるシングルチップマイクロコンピュータ
の論理積和回路の構成図である。 1……シングルチップマイコン、2……割込み制御回
路、3……CPU、4……メインデコーダ、5……サブデ
コーダ、6……内部バス、7……割込み処理要求信号、
8……割込み処理受け付け信号、9……メモリ部、10…
…周辺部、11……プライオリテイ指定信号、12……プラ
イオリテイ指定フラグ、20,40……動作モード指定回
路、21……動作モード指定レジスタ設定信号、23……動
作モード指定レジスタ、24,41……動作モード指定信
号、25,44……ラッチ回路、26……論理積和回路、42…
…ANDゲート、45……セット信号、46……クリア信号、4
3……ORゲート。
FIG. 1 is a block diagram of a single-chip microcomputer according to a first embodiment of the present invention, FIG. 2 is a block diagram of an operation mode designating circuit according to the first embodiment, and FIG. FIG. 4 is a block diagram of an operation mode designating circuit in the second embodiment, FIG. 5 is a block diagram of a conventional single chip microcomputer, and FIG. 6 is a single chip according to the present embodiment. FIG. 2 is a configuration diagram of a logical sum circuit of the microcomputer. 1 single-chip microcomputer, 2 ... interrupt control circuit, 3 ... CPU, 4 ... main decoder, 5 ... sub-decoder, 6 ... internal bus, 7 ... interrupt processing request signal,
8: Interrupt processing acceptance signal, 9: Memory unit, 10 ...
... Peripheral part, 11 ... Priority designation signal, 12 ... Priority designation flag, 20, 40 ... Operation mode designation circuit, 21 ... Operation mode designation register setting signal, 23 ... Operation mode designation register, 24, 41 …… Operation mode designation signal, 25,44 …… Latch circuit, 26 …… Logic sum circuit, 42…
... AND gate, 45 ... Set signal, 46 ... Clear signal, 4
3 …… OR gate.

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】単一半導体基盤上にコンピュータ機能を集
積し、中央処理装置のエミューレーション機能を内蔵し
たシングルチップマイクロコンピュータにおいて、割込
み処理別に前記中央処理装置の動作モードを指定するレ
ジスタ,割込み処理中に出力される割込ベクタ情報との
論理積和をとり出力する論理積和回路,前記の論理積和
回路の出力を保持する1ビットのラッチ回路から構成す
る動作モード指定回路を内蔵し、前記動作モード指定回
路の出力によって割込み処理時の前記中央処理装置の動
作モードを指定する手段を内蔵したことを特徴とするシ
ングルチップマイクロコンピュータ。
1. A single-chip microcomputer having a computer function integrated on a single semiconductor substrate and having a built-in emulation function of a central processing unit, a register for designating an operation mode of the central processing unit for each interrupt processing, and an interrupt processing. An operation mode designating circuit comprising a logical product sum circuit for taking a logical product sum with the interrupt vector information outputted therein and outputting the logical product sum, and a 1-bit latch circuit holding the output of the logical product sum circuit; A single-chip microcomputer including means for designating an operation mode of the central processing unit at the time of interrupt processing by an output of the operation mode designation circuit.
【請求項2】請求範囲第1項に係わるシングルチップマ
イクロコンピュータにおいて、前記動作モード指定回路
に対し、前記中央処理装置の命令によりセット及びクリ
アの可能な1ビットのラッチ回路を付加し、前記ラッチ
回路の値により割込み処理要求の優先順位に応じて前記
動作モード指定回路の出力値を決定する手段を内蔵した
ことを特徴とするシングルチップマイクロコンピュー
タ。
2. The single-chip microcomputer according to claim 1, wherein a one-bit latch circuit that can be set and cleared by an instruction from said central processing unit is added to said operation mode designating circuit. A single-chip microcomputer including means for determining an output value of the operation mode designating circuit in accordance with a priority of an interrupt processing request based on a circuit value.
JP2078110A 1990-03-27 1990-03-27 Single chip microcomputer Expired - Lifetime JP3027984B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2078110A JP3027984B2 (en) 1990-03-27 1990-03-27 Single chip microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2078110A JP3027984B2 (en) 1990-03-27 1990-03-27 Single chip microcomputer

Publications (2)

Publication Number Publication Date
JPH03278132A JPH03278132A (en) 1991-12-09
JP3027984B2 true JP3027984B2 (en) 2000-04-04

Family

ID=13652748

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2078110A Expired - Lifetime JP3027984B2 (en) 1990-03-27 1990-03-27 Single chip microcomputer

Country Status (1)

Country Link
JP (1) JP3027984B2 (en)

Also Published As

Publication number Publication date
JPH03278132A (en) 1991-12-09

Similar Documents

Publication Publication Date Title
US6374353B1 (en) Information processing apparatus method of booting information processing apparatus at a high speed
US4715013A (en) Coprocessor instruction format
US4729094A (en) Method and apparatus for coordinating execution of an instruction by a coprocessor
EP0135753B1 (en) Storage selection override apparatus for a multi-microprocessor implemented data processing system
KR100272937B1 (en) Microprocessor and multiprocessor system
JPH0430053B2 (en)
US4731736A (en) Method and apparatus for coordinating execution of an instruction by a selected coprocessor
US4562538A (en) Microprocessor having decision pointer to process restore position
KR20010080349A (en) Processing arrangements
US5021991A (en) Coprocessor instruction format
JP2822782B2 (en) Single chip microcomputer
GB2024475A (en) Memory access controller
US6986028B2 (en) Repeat block with zero cycle overhead nesting
JPH0232659B2 (en)
US5842012A (en) Efficient soft reset in a personal computer
US4914578A (en) Method and apparatus for interrupting a coprocessor
US5003468A (en) Guest machine execution control system for virutal machine system
JP3027984B2 (en) Single chip microcomputer
US4758978A (en) Method and apparatus for selectively evaluating an effective address for a coprocessor
JP2826309B2 (en) Information processing device
JPH02181282A (en) Single chip microcomputer
JPH056281A (en) Information processor
JPH05334258A (en) Multiprocessor type one chip microcomputer
US6026480A (en) Processor having bug avoidance function and method for avoiding bug in processor
US20050216708A1 (en) Processor for performing context switching, a method for performing context switching, a computer program for perform context switching