JPH08263290A - Data processor - Google Patents

Data processor

Info

Publication number
JPH08263290A
JPH08263290A JP7060797A JP6079795A JPH08263290A JP H08263290 A JPH08263290 A JP H08263290A JP 7060797 A JP7060797 A JP 7060797A JP 6079795 A JP6079795 A JP 6079795A JP H08263290 A JPH08263290 A JP H08263290A
Authority
JP
Japan
Prior art keywords
instruction
register
signal
data processing
multiplication
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.)
Withdrawn
Application number
JP7060797A
Other languages
Japanese (ja)
Inventor
Eiji Sakakibara
栄二 榊原
Naomiki Mitsuishi
直幹 三ツ石
Hisashi Kajiwara
久志 梶原
Susumu Ue
晋 宇枝
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.)
Hitachi Engineering Co Ltd
Hitachi Ltd
Original Assignee
Hitachi Engineering Co Ltd
Hitachi Ltd
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 Hitachi Engineering Co Ltd, Hitachi Ltd filed Critical Hitachi Engineering Co Ltd
Priority to JP7060797A priority Critical patent/JPH08263290A/en
Publication of JPH08263290A publication Critical patent/JPH08263290A/en
Withdrawn legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE: To obtain multiplication performance corresponding to needs while maintaining compatibility and to improve processing performance by providing a control means controlling an execution means and a multiplication means, providing the instruction of parallel operation of the control means and the multiplication means and the instruction of the operation of the multiplication means and incorporating the multiplication means to the control means. CONSTITUTION: CPU 1 incorporates a multiplier 2 and CPU 1 and the multiplier 2 are connected through a bus switch 34. The bus switch 34 executes interface with an internal data bus and gives a control signal from CPU 1 to the multiplier 2. On the other hand, the status signal BUSY and the flag detection signal of the multiplier 2 are given to CPU 1 and a TESTMODE signal is given from a timing SYSC 3. CPU 1 gives the multiplier 2 with an MUL signal as a signal showing multiplication, an UNSINP signal as a signal showing whether a code is attatched or not, a BYTE signal as a signal showing a byte/word size and an MAC signal as the starting signal of the sum of products operation.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、データ処理装置に関
し、特に、半導体集積回路装置によって構成される高速
かつ小型のシングルチップマイクロコンピュータに利用
して有効な技術に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data processing device, and more particularly, to a technique effectively applied to a high speed and small single chip microcomputer constituted by a semiconductor integrated circuit device.

【0002】[0002]

【従来の技術】半導体集積回路装置の製造技術の高度化
に伴って、半導体単結晶からなるシングルチップに、中
央演算処理装置(Central Processin
g Unit;以下、単にCPUと称する)、プログラ
ムを格納するROM(ReadOnly Memor
y)、書き替え可能に各種データを格納するRAM(R
andom Access Memory)等を含む構
成素子を集積して製造した、小型のシングルチップマイ
クロコンピュータ(以下、単にマイクロコンピュータと
称する)が広範囲に普及してきており、種々の目的のデ
ータ処理装置として使用されてきている。このマイクロ
コンピュータは、CPUが同時に処理し得る情報の量に
よって性能が異なり、例えば4ビット、8ビット、16
ビット、32ビット等のマイクロコンピュータとして区
分されている。
2. Description of the Related Art With the advancement of manufacturing technology of semiconductor integrated circuit devices, a central processing unit (Central Processing Unit) is formed on a single chip made of a semiconductor single crystal.
g Unit; hereinafter simply referred to as CPU), ROM (Read Only Memory) for storing programs
y), a RAM (R that stores various data rewritably)
A small single-chip microcomputer (hereinafter, simply referred to as a microcomputer), which is manufactured by integrating constituent elements including an and Access Memory, etc., has been widely spread and has been used as a data processing device for various purposes. ing. The performance of this microcomputer differs depending on the amount of information that can be processed by the CPU at the same time.
It is classified as a 32-bit or 32-bit microcomputer.

【0003】このようなマイクロコンピュータは、アド
レス空間の拡張や、命令セットの拡大、高速化等が図ら
れてきている。また、CPUは、ソフトウエアによって
その性能が定義されているから、前記のようにアドレス
空間の拡張や、命令セットの拡大、高速化等を図ったマ
イクロコンピュータにおいても、既存のマイクロコンピ
ュータのソフトウエア資産を有効に利用できることが望
ましい。
In such a microcomputer, expansion of address space, expansion of instruction set, speedup, etc. have been attempted. In addition, since the performance of the CPU is defined by software, the software of the existing microcomputer can be used even in a microcomputer designed to expand the address space, expand the instruction set, and speed up as described above. It is desirable that the assets can be used effectively.

【0004】このため、オブジェクトレベルで互換性を
保ちつつ、アドレス空間の拡張や、命令セットの拡大、
高速化等を実現した例として、例えば本出願人が先に提
案した特開平6−51981号公報、あるいは平成5年
6月(株)日立製作所発行、「H8/300Hシリーズ
プログラミングマニュアル」等がある。
Therefore, while maintaining compatibility at the object level, the address space is expanded and the instruction set is expanded.
Examples of realization of higher speed and the like include, for example, Japanese Patent Laid-Open No. 6-51981 proposed by the present applicant, or "H8 / 300H Series Programming Manual" issued by Hitachi, Ltd. in June 1993. .

【0005】前記CPUは、システムクロックの2周期
である、いわゆる2ステートで基本命令を実行してい
る。これに対して、1ステートで基本命令を実行するよ
うにし、さらに、CPUとは独立して乗算器を内蔵して
高速化を図った例として、例えば平成4年11月日経B
P社発行、「日経エレクトロニクスNO.568」、P
P99〜PP112、あるいは平成5年3月(株)日立
製作所発行、「SH7032、SH7034 ハードウ
エアマニュアル」等がある。このような乗算器は積和演
算と乗算に利用する。
The CPU executes basic instructions in so-called two states, which are two cycles of the system clock. On the other hand, as an example in which a basic instruction is executed in one state and a multiplier is built-in independently of the CPU to increase the speed, for example, November 1992 Nikkei B
Published by Company P, "Nikkei Electronics NO.568", P
P99 to PP112, or "SH7032, SH7034 Hardware Manual" issued by Hitachi, Ltd. in March 1993. Such a multiplier is used for multiply-add operation and multiplication.

【0006】このように高速化を図ることによって、マ
イクロコンピュータによって制御される各種機器の高速
化や高性能化、あるいは、従来においては複数の半導体
集積回路装置で構成していたものを、結合したりするこ
とにより小型化を図ることができるようになる。
By increasing the speed in this way, various devices controlled by the microcomputer can be speeded up or have higher performance, or those which are conventionally composed of a plurality of semiconductor integrated circuit devices are combined. By doing so, it becomes possible to reduce the size.

【0007】また、前記のような各種機器の高速化や高
性能化、あるいは小型化は、アドレス空間が比較的小さ
く、命令セットが比較的小さいCPUあるいはマイクロ
コンピュータにおいても要求されるから、前記特開平6
−51981号公報等に記載されるアドレス空間の広い
CPUと、アドレス空間の小さいCPUが存在する場合
には、その双方の高速化を図ることが望ましい。
Further, the above-mentioned various devices are required to have higher speed, higher performance, or smaller size, even in a CPU or a microcomputer having a relatively small address space and a relatively small instruction set. Kaihei 6
If a CPU having a wide address space and a CPU having a small address space are disclosed in Japanese Patent Publication No. 51981, it is desirable to increase the speed of both.

【0008】このような観点から、上位CPUを開発
し、これをベースにして下位CPUへ展開できれば都合
が良い。これによって、開発効率を向上することができ
る。さらに、半導体集積回路装置によって構成されるC
PU自体の他に、クロスアセンブラやCコンパイラ、シ
ミュレータ、リアルタイムOS等の開発ツール等の開発
も共通化して、開発効率を向上することが望ましい。
From this point of view, it would be convenient if an upper CPU could be developed and expanded to a lower CPU based on this. This can improve development efficiency. Furthermore, C composed of a semiconductor integrated circuit device
In addition to the PU itself, it is desirable to standardize development of development tools such as a cross assembler, a C compiler, a simulator, and a real-time OS to improve development efficiency.

【0009】[0009]

【発明が解決しようとする課題】前記のようなマイクロ
コンピュータにおいて、乗算器は専用の資源を必要とす
るから、必ずしも積和演算や乗算の高速化を必要としな
い場合には、費用対効果の点で得策でない。また、例え
ば前記平成5年3月(株)日立製作所発行、「SH70
32、SH7034 ハードウエアマニュアル」におい
ては、乗算結果は専用のレジスタ(MAC)に得られる
から、これを利用する場合には、別の命令によってそれ
をCPUの汎用レジスタに転送しなければならない。乗
算器を内蔵して乗算自体を高速化しても、そのように乗
算結果を使用するまでの時間が長くなっては意味がな
い。
In the above microcomputer, since the multiplier requires a dedicated resource, it is cost-effective if it is not always necessary to speed up multiply-accumulate operations and multiplications. Not a good idea in terms. In addition, for example, “SH70” issued by Hitachi, Ltd. in March 1993,
32, SH7034 Hardware Manual ", the multiplication result is obtained in a dedicated register (MAC). Therefore, when this is used, it must be transferred to a general-purpose register of the CPU by another instruction. Even if a multiplier is built in to speed up the multiplication itself, it does not make sense to take a long time until the multiplication result is used.

【0010】一方、従来のCPUとの互換性を維持する
ためには、前記のように命令の追加は困難であり、追加
する命令は最小限にしなければならない。また、演算結
果等のフラグも互換性を保持する必要がある。積和演算
についても、演算結果等のフラグを参照できれば使い勝
手が良くなる。フラグの状態を判定して分岐する、いわ
ゆる条件分岐命令などで演算結果を容易に判定し、処理
の内容を変更することができるからである。かかるフラ
グには、オーバフロー(V)、ゼロ(Z)、ネガティブ
(N)などがある。
On the other hand, in order to maintain compatibility with the conventional CPU, it is difficult to add an instruction as described above, and the added instruction must be minimized. In addition, it is necessary to maintain compatibility of flags such as calculation results. Concerning the product-sum calculation, the usability will be improved if the flags such as the calculation result can be referred to. This is because it is possible to easily determine the operation result with a so-called conditional branch instruction or the like, which branches depending on the state of the flag, and to change the processing content. Such flags include overflow (V), zero (Z), negative (N) and the like.

【0011】本発明の目的は、互換性を維持しつつニー
ズに応じた乗算性能が得られ、しかも処理性能の向上を
図ることが可能な技術を提供することにある。
It is an object of the present invention to provide a technique capable of obtaining multiplication performance according to needs while maintaining compatibility and improving processing performance.

【0012】本発明の他の目的は、制御手段に乗算手段
を内蔵して互換性を維持しつつ処理の高速化を図ること
が可能な技術を提供することにある。
Another object of the present invention is to provide a technique capable of increasing the processing speed while maintaining compatibility by incorporating a multiplication means in the control means.

【0013】本発明のその他の目的は、乗算手段を制御
手段から独立して設け、しかも制御手段に乗算機能を備
えさせることにより、製造費用の低減が可能な技術を提
供することにある。
Another object of the present invention is to provide a technique capable of reducing the manufacturing cost by providing the multiplication means independently of the control means and further providing the control means with the multiplication function.

【0014】本発明の前記ならびにそのほかの目的と新
規な特長は、本発明書の記述および添付図面から明らか
になるであろう。
The above and other objects and novel features of the present invention will be apparent from the description of the present specification and the accompanying drawings.

【0015】[0015]

【課題を解決するための手段】本願において開示される
発明のうち代表的なものの概要を簡単に説明すれば下記
の通りである。
The outline of the representative one of the inventions disclosed in the present application will be briefly described as follows.

【0016】(1)本発明のデータ処理装置は、命令を
実行する実行手段を制御する制御手段と乗算手段を設
け、前記制御手段と乗算手段とが並列動作する第1の命
令とともに、前記乗算手段が動作する第2の命令を有
し、乗算手段は前記制御手段に内蔵されている。また、
第1の命令は積和命令であるとともに、第2の命令は乗
算命令になっている。積和命令のアドレッシングモード
は、いわゆるポストインクリメントレジスタ間接とす
る。乗算手段には結果を判定するフラグ検出手段を設
け、乗算命令時はフラグ検出結果を制御手段に供給し
て、保持させる手段を設ける。
(1) The data processing device of the present invention is provided with a control means and a multiplication means for controlling the execution means for executing the instruction, and the multiplication is performed together with the first instruction in which the control means and the multiplication means operate in parallel. The means has a second instruction to operate and the multiplying means is built into the control means. Also,
The first instruction is a multiply-add instruction and the second instruction is a multiply instruction. The addressing mode of the multiply-accumulate instruction is so-called post-increment register indirect. The multiplying means is provided with a flag detecting means for judging the result, and a means for supplying the flag detecting result to the control means and holding it at the time of the multiplying instruction.

【0017】(2)本発明のデータ処理装置は、命令を
実行する実行手段を制御する制御手段と乗算手段を設
け、前記制御手段と乗算手段とが並列動作する第1の命
令とともに、前記乗算手段が動作する第2の命令を有
し、乗算手段は前記制御手段から独立して設けられてい
る。また、制御手段は乗算機能を備えている。
(2) The data processing device of the present invention is provided with a control means and a multiplication means for controlling the execution means for executing the instruction, and the multiplication is performed together with the first instruction in which the control means and the multiplication means operate in parallel. The means has a second instruction to operate and the multiplying means is provided independent of the control means. Further, the control means has a multiplication function.

【0018】(3)本発明のデータ処理装置は、命令を
実行する実行手段を制御する制御手段に指定可能な複数
のレジスタの組み合わせを固定にし、複数のレジスタの
退避/復帰命令を有している。
(3) The data processing device of the present invention has a fixed combination of a plurality of registers that can be designated in the control means for controlling the execution means for executing an instruction, and has a save / restore instruction for the plurality of registers. There is.

【0019】(4)本発明のデータ処理装置は、命令を
実行する実行手段を制御する制御手段に搭載されるコン
トロールレジスタの有効/無効を切り換える手段を有
し、コントロールレジスタの有効時には、例外処理の遷
移時、例外処理からの復帰時に、前記コントロールレジ
スタの待避/復帰を行い、前記コントロールレジスタの
無効時には、例外処理の遷移時、例外処理からの復帰時
に、前記コントロールレジスタの待避/復帰を行わな
い。
(4) The data processor of the present invention has means for switching between valid / invalid of the control register mounted in the control means for controlling the execution means for executing the instruction, and when the control register is valid, the exception processing is performed. The control register is saved / restored at the time of the transition from the exception process, and the control register is saved / restored at the time of the exception process transition or the return from the exception process when the control register is invalid. Absent.

【0020】(5)本発明のデータ処理装置は、命令を
実行する実行手段を制御する制御手段の搭載される固定
的なスタックレジスタを設け、エミュレーションプログ
ラムへの遷移時、エミュレーションプログラムからの復
帰時に、前記固定的なスタックレジスタ用いて、ユーザ
が使用するスタックポインタを無視あるいは保持するか
を指定する手段を有している。
(5) The data processing apparatus of the present invention is provided with a fixed stack register equipped with a control means for controlling the execution means for executing an instruction, and at the time of transition to the emulation program and at the time of returning from the emulation program. , Using the fixed stack register, has means for designating whether to ignore or hold the stack pointer used by the user.

【0021】[0021]

【作用】上記した(1)の手段によれば、乗算器(乗算
手段)を内蔵することによって、アドレッシングモード
の増加を最小限にして、かつ処理性能を低下させずに積
和演算を実行可能にすることができる。また、ポストイ
ンクリメントレジスタ間接により、多数のデータの積和
演算を連続して処理することができる。さらに、乗算の
結果(積、フラグ)を直ちに利用できるから、実質的な
乗算の実行速度を向上することができる。
According to the above-mentioned means (1), since the multiplier (multiplication means) is built in, it is possible to perform the sum-of-products operation with a minimum increase in the addressing mode and without lowering the processing performance. Can be In addition, the post-increment register indirect allows the sum-of-products calculation of a large number of data to be continuously processed. Furthermore, since the multiplication result (product, flag) can be immediately used, the execution speed of the multiplication can be substantially improved.

【0022】乗算器とCPU(制御手段)を一体に構成
して、乗算器・CPU間の配線を短縮して、物理的規模
を縮小する。また、高速化に寄与することができる。
The multiplier and the CPU (control means) are integrally configured to shorten the wiring between the multiplier and the CPU, thereby reducing the physical scale. It can also contribute to speeding up.

【0023】上記した(2)の手段によれば、乗算器を
取外し可能に(独立して)設けることによって、乗算器
を取外した場合は、積和演算をサポートしないことによ
って、容易に下位CPUを実現し、論理的・物理的規模
を縮小し、製造費用を低減した別のマイクロコンピュー
タを容易に開発することができる。また、乗算器を取外
したCPUにおいても、汎用的な乗算命令をサポートす
ることによって、使い勝手の低下を防止できる。さら
に、乗算器使用するか使用しないかの制御信号(有効/
無効)を与えて制御することによって、テスト性を向上
したり、エミュレータを共通化したりすることができ
る。さらにまた、全体的な開発効率を向上することがで
きる。
According to the above-mentioned means (2), by providing the multiplier detachably (independently), when the multiplier is removed, the product-sum operation is not supported, so that the lower CPU can be easily operated. It is possible to easily develop another microcomputer that realizes the above, reduces the logical / physical scale, and reduces the manufacturing cost. In addition, even in a CPU without a multiplier, it is possible to prevent deterioration in usability by supporting a general-purpose multiply instruction. In addition, the control signal (valid / invalid) whether the multiplier is used or not
By giving (invalid) and controlling, the testability can be improved and the emulator can be shared. Furthermore, the overall development efficiency can be improved.

【0024】乗算器を削除した場合、乗算は除算と同一
のシーケンスで実行できる。積和演算はサポートせず、
積和演算の特殊なシーケンスをサポートしないことによ
って論理規模の縮小を更に行うことができる。テスト命
令をサポートすることによって、論理規模の増加を最低
限にして、テストの容易性を向上することができる。
If the multiplier is omitted, the multiplication can be performed in the same sequence as the division. Does not support multiply-accumulate operation,
Further reduction in logical scale can be achieved by not supporting special sequences of multiply-accumulate operations. By supporting the test instructions, it is possible to minimize the increase in the logic scale and improve the testability.

【0025】上記した(3)の手段によれば、複数レジ
スタの退避/復帰命令を持ち、この組み合せを固定的に
することによって、論理規模の縮小を図ることができ、
また、高速化を図ることができる。レジスタの本数の異
なる命令を複数命令サポートすることによって、使い勝
手の低下を防ぐことができる。
According to the above-mentioned means (3), a logical scale can be reduced by having a save / restore instruction for a plurality of registers and fixing this combination.
In addition, the speed can be increased. By supporting a plurality of instructions having different numbers of registers, it is possible to prevent a reduction in usability.

【0026】さらに、内部動作のパイプラインに対応し
て、入出力タイミングの異なるレジスタ選択回路を複数
持つことにより、レジスタ間演算命令などの基本命令を
実質的に1命令/1ステート実行を行うことができる。
Further, by having a plurality of register selection circuits having different input / output timings corresponding to the pipeline of internal operations, basic instructions such as inter-register arithmetic instructions can be executed substantially in one instruction / one state. You can

【0027】上記した(4)の手段によれば、コントロ
ールレジスタの有効/無効を切り換えることで、スタッ
クの節約と、割込み応答時間の高速化に寄与することが
できる。また、互換性を維持することができる。
According to the above-mentioned means (4), it is possible to contribute to saving the stack and speeding up the interrupt response time by switching the valid / invalid of the control register. In addition, compatibility can be maintained.

【0028】上記した(5)の手段によれば、エミュレ
ータ専用の固定スタックポインタを持つことにより、エ
ミュレータのサポートを容易にすることができる。ま
た、論理規模の増加を最低限にして、エミュレータの設
計を容易にすることができる。エミュレータ専用スタッ
クポインタの一部のアドレスを、CPU外部から与える
ようにして、スタックレジスタをリロケータブルにし、
マイクロコンピュータのアドレス配置などに容易に対応
することができる。
According to the above-mentioned means (5), by having the fixed stack pointer dedicated to the emulator, it is possible to easily support the emulator. In addition, it is possible to minimize the increase in logic scale and facilitate emulator design. Part of the address of the stack pointer dedicated to the emulator is given from outside the CPU to make the stack register relocatable,
The address arrangement of the microcomputer can be easily dealt with.

【0029】以下、本発明について、図面を参照して実
施例とともに詳細に説明する。
Hereinafter, the present invention will be described in detail with reference to the drawings together with embodiments.

【0030】なお、実施例を説明するための全図におい
て、同一機能を有するものは同一符号を付け、その繰り
返しの説明は省略する。
In all the drawings for explaining the embodiments, parts having the same function are designated by the same reference numerals, and the repeated description thereof will be omitted.

【0031】[0031]

【実施例】図1に、本発明の適用されたデータ処理装置
の一例であるシングルチップマイクロコンピュータ(以
下、単にマイクロコンピュータと称する)のブロック図
を示す。マイクロコンピュータは、CPU1、乗算器
2、システムコントローラ(SYSC)3、割込コント
ローラ(INT)4、ROM5、RAM6、タイマA
7、タイマB8、シリアルコミュニケーションインタフ
ェース(SCI)9、A/D変換器10、第1乃至第9
入出力ポート(IOP1〜IOP9)11A〜11I、
クロック発振器(CPG)12の機能ブロック乃至はモ
ジュールから構成され、公知の半導体製造技術により1
つの半導体基板上に半導体集積回路装置として形成され
る。CPU1は、乗算器2を内蔵してなる。システムコ
ントローラ(SYSC)3は、システムコントロールレ
ジスタ(SYSCR)13および制御レジスタ(CPU
CR)14を内蔵している。
1 is a block diagram of a single-chip microcomputer (hereinafter, simply referred to as a microcomputer) which is an example of a data processing device to which the present invention is applied. The microcomputer includes a CPU 1, a multiplier 2, a system controller (SYSC) 3, an interrupt controller (INT) 4, a ROM 5, a RAM 6, and a timer A.
7, timer B8, serial communication interface (SCI) 9, A / D converter 10, first to ninth
I / O ports (IOP1 to IOP9) 11A to 11I,
The clock oscillator (CPG) 12 is composed of functional blocks or modules, and is formed by a known semiconductor manufacturing technique.
The semiconductor integrated circuit device is formed on one semiconductor substrate. The CPU 1 has a built-in multiplier 2. The system controller (SYSC) 3 includes a system control register (SYSCR) 13 and a control register (CPU
CR) 14 is built in.

【0032】かかるマイクロコンピュータは、電源端子
として、グランドレベル(Vss)、電源電圧レベル
(Vcc)、その他専用制御端子として、リセット(R
ES)、スタンバイ(STBY)、モード制御(MD0
〜2)、クロック入力(EXTAL、XTAL)端子を
有する。クロック入力(EXTAL、XTAL)端子に
接続される、図示はされない水晶振動子に基づいて、ク
ロック発振器が生成するシステムクロック(φ1、φ
2)に同期して、マイクロコンピュータは動作する。或
は外部クロックをEXTAL端子に入力してもよい。シ
ステムクロックの1周期を1ステートと呼ぶ。
In such a microcomputer, as a power supply terminal, a ground level (Vss), a power supply voltage level (Vcc) and other dedicated control terminals are reset (R).
ES), standby (STBY), mode control (MD0
~ 2), and has a clock input (EXTAL, XTAL) terminal. A system clock (φ1, φ) generated by a clock oscillator based on a crystal oscillator (not shown) connected to the clock input (EXTAL, XTAL) terminals.
The microcomputer operates in synchronization with 2). Alternatively, an external clock may be input to the EXTAL terminal. One cycle of the system clock is called one state.

【0033】これらの機能ブロックは、内部バスによっ
て相互に接続される。内部バスは内部アドレスバス(P
AB)・内部データバス(PDB)の他、リード信号・
ライト信号を含み、さらにバスサイズ信号或いはシステ
ムクロック(φ1、φ2)などを含む。
These functional blocks are connected to each other by an internal bus. The internal bus is the internal address bus (P
AB) ・ In addition to internal data bus (PDB), read signal ・
It includes a write signal and further includes a bus size signal or a system clock (φ1, φ2).

【0034】入出力ポートは、外部バス信号、入出力回
路の入出力信号と兼用とされている。これらは、動作モ
ードあるいはソフトウエアの設定により、機能を選択さ
れて、使用される。IOP1〜3はアドレスバス出力、
IOP4、5はデータバス入出力、IOP6はバス制御
信号入出力信号と兼用されている。外部アドレスは、そ
れぞれ、これらの入出力ポートに含まれるバッファ回路
を介して内部アドレスバスと接続されている。
The input / output port is also used as an external bus signal and an input / output signal of the input / output circuit. The functions of these are selected and used according to the operation mode or software settings. IOP1 to 3 are address bus outputs,
IOPs 4 and 5 are also used as data bus input / outputs, and IOP 6 is also used as a bus control signal input / output signal. The external address is connected to the internal address bus via the buffer circuits included in these input / output ports.

【0035】内部バスおよび外部バス共に16ビットバ
ス幅とし、バイトサイズ(8ビット)およびワードサイ
ズ(16ビット)のリード/ライトを可能にする。な
お、内部バスおよび外部バスのいずれも8ビット幅とす
ることもできる。バス制御信号入出力信号には、アドレ
スストローブ信号AS、リード信号RD、ライト信号H
WR・LWR、ウェイト信号WAIT、エリア0選択信
号CS0などがある。割込信号は、タイマ・SCI・I
OP8から要求され、割込コントローラ(INT)が調
停して、CPUに割込を要求する。このとき、CPUに
対し、割込要求信号とベクタ番号を与える。
Both the internal bus and the external bus have a 16-bit bus width, which enables read / write of byte size (8 bits) and word size (16 bits). Note that both the internal bus and the external bus can have a width of 8 bits. The bus control signal input / output signal includes an address strobe signal AS, a read signal RD, and a write signal H.
There are WR / LWR, wait signal WAIT, area 0 selection signal CS0, and the like. Interrupt signals are timer, SCI, I
Requested from OP8, the interrupt controller (INT) arbitrates and requests the CPU to interrupt. At this time, an interrupt request signal and a vector number are given to the CPU.

【0036】RES端子にリセット信号が加えられる
と、モード端子(MD0〜2)で与えられる動作モード
を取り込み、マイクロコンピュータはリセット状態にな
る。モード端子で設定する動作モードは、シングルチッ
プ/拡張、アドレス空間、内蔵ROMの有効/無効、デ
ータバス幅の初期値を8ビットまたは16ビットから選
択する。
When a reset signal is applied to the RES terminal, the operation mode given by the mode terminals (MD0 to 2) is fetched and the microcomputer enters the reset state. The operation mode set by the mode terminal selects an initial value of single chip / extension, address space, valid / invalid of built-in ROM, and data bus width from 8 bits or 16 bits.

【0037】図2に、システムコントロールレジスタ
(SYSCR)3の構成を示す。各ビットの内容を表1
乃至表4に示す。
FIG. 2 shows the configuration of the system control register (SYSCR) 3. Table 1 shows the contents of each bit
To Table 4.

【0038】なお、ビット2、1:リザーブビット リードすると常に”0”が読み出される。ライトは無効
である。
Bits 2, 1: Reserved bits When read, "0" is always read. Light is disabled.

【0039】[0039]

【表1】 [Table 1]

【0040】[0040]

【表2】 [Table 2]

【0041】[0041]

【表3】 [Table 3]

【0042】[0042]

【表4】 [Table 4]

【0043】以下に、表5にCPU1の命令セットを示
す。本実施例に用いられるCPU1の命令は合計で71
種類ある。表6に命令とアドレッシングモードとの組合
せを示す。表7に以下の各表に使用される記号(オペレ
ーションの記号)の意味を示す。表8乃至表15に各命
令の機能別一覧表を示す。
Table 5 below shows the instruction set of the CPU 1. The total number of commands of the CPU 1 used in this embodiment is 71.
There are types. Table 6 shows combinations of instructions and addressing modes. Table 7 shows the meaning of symbols (operation symbols) used in the following tables. Tables 8 to 15 show a list of each instruction by function.

【0044】[0044]

【表5】 [Table 5]

【0045】[0045]

【表6】 [Table 6]

【0046】[0046]

【表7】 [Table 7]

【0047】[0047]

【表8】 [Table 8]

【0048】[0048]

【表9】 [Table 9]

【0049】[0049]

【表10】 [Table 10]

【0050】[0050]

【表11】 [Table 11]

【0051】[0051]

【表12】 [Table 12]

【0052】[0052]

【表13】 [Table 13]

【0053】[0053]

【表14】 [Table 14]

【0054】[0054]

【表15】 [Table 15]

【0055】基本的な命令は平成5年6月(株)日立製
作所発行『H8/300Hシリーズプログラミングマニ
ュアル』などに記載のCPUと同様であり、いわゆる、
ロードストアアーキテクチャを採用している。命令とア
ドレッシングモードの組み合わせを削減し、CPUの命
令制御の論理規模・物理的規模を縮小できる。
The basic instructions are the same as those of the CPU described in "H8 / 300H Series Programming Manual" issued by Hitachi, Ltd. in June 1993.
Uses a load store architecture. It is possible to reduce the number of combinations of instructions and addressing modes and reduce the logical and physical scales of instruction control of the CPU.

【0056】本発明のCPUは、上記従来CPUに対し
て命令実行時間の高速化を実現している。
The CPU of the present invention realizes faster instruction execution time than the conventional CPU.

【0057】CPUの命令は、2バイト(ワード)を単
位にしている。各命令は下記のようなオペレーションフ
ィールド(op)、レジスタフィールド(r)、EA拡
張部(EA)、およびコンディションフィールド(c
c)から構成されている。
The instruction of the CPU has a unit of 2 bytes (word). Each instruction has the following operation field (op), register field (r), EA extension (EA), and condition field (c).
c).

【0058】(1)オペレーションフィールド 命令の機能を表し、アドレッシングモードの指定、オペ
ランドの処理内容を指定する。命令の先頭4ビットを必
ず含んでいる。2つのオペレーションフィールドを持つ
場合もある。
(1) Operation field Represents the function of an instruction, and specifies the addressing mode and the processing contents of the operand. The first 4 bits of the instruction are always included. It may have two operation fields.

【0059】(2)レジスタフィールド 汎用レジスタを指定する。アドレスレジスタのとき3ビ
ット、データレジスタのとき3ビットまたは4ビットで
ある。2つのレジスタフィールドを持つ場合、またはレ
ジスタフィールドを持たない場合もある。
(2) Register field A general-purpose register is designated. The address register has 3 bits, and the data register has 3 bits or 4 bits. It may or may not have two register fields.

【0060】(3)EA拡張部 イミディエイトデータ、絶対アドレスまたはディスプレ
ースメントを指定する。8ビット、16ビット、または
32ビットである。
(3) EA extension part Immediate data, absolute address or displacement is designated. It is 8 bits, 16 bits, or 32 bits.

【0061】(4)コンディションフィールド Bcc命令の分岐条件を示す。(4) Condition field Indicates a branch condition of the Bcc instruction.

【0062】図3に、命令の基本フォーマットの例を示
す。
FIG. 3 shows an example of the basic format of the instruction.

【0063】図4に、マイクロコンピュータにおいて、
CPU1に対し乗算器2を取外し可能に設けた概略ブロ
ック図を示す。命令レジスタ(IR)21、命令デコー
ダ・制御回路(CONT)22、レジスタセレクタ(R
SEL)23、ライトデータバッファ(DBW)24、
リードデータバッファ(DBR)25、演算器(AL
U)26、演算器(INC)27、汎用レジスタ(ER
0〜ER7)28A〜28H、エミュレータスタックポ
インタ(EMLSP)29、プログラムカウンタ(P
C)30、コンディションコードレジスタ(CCR)3
1、拡張レジスタ(EXR)32、アドレスバッファ
(MAB)33からなる。乗算器2なしのCPU1はこ
れらによって構成される。各バッファやレジスタ、演算
器の各ブロックの機能は、特開平5−241826号公
報に記載のCPUと概略同様である。また、乗算器2を
含むCPU1は、更に、バススイッチ34、乗算器2が
ある。
In FIG. 4, in the microcomputer,
A schematic block diagram in which the multiplier 2 is detachably provided for the CPU 1 is shown. Instruction register (IR) 21, instruction decoder / control circuit (CONT) 22, register selector (R
SEL) 23, write data buffer (DBW) 24,
Read data buffer (DBR) 25, arithmetic unit (AL
U) 26, arithmetic unit (INC) 27, general-purpose register (ER)
0-ER7) 28A-28H, emulator stack pointer (EMLSP) 29, program counter (P
C) 30, condition code register (CCR) 3
1, an extension register (EXR) 32, and an address buffer (MAB) 33. The CPU 1 without the multiplier 2 is configured by these. The functions of each block of each buffer, register, and arithmetic unit are approximately the same as those of the CPU described in Japanese Patent Laid-Open No. 5-241826. Further, the CPU 1 including the multiplier 2 further includes the bus switch 34 and the multiplier 2.

【0064】命令デコーダ・制御回路(CONT)22
には、制御信号CPUS、制御信号INTM1、そのほ
かの制御信号(割り込み要求など)が入力されている。
CONT22は各部を制御するための、出力タイミング
の相違する制御信号A、B、Cを出力する。
Instruction decoder / control circuit (CONT) 22
A control signal CPUS, a control signal INTM1, and other control signals (interrupt request, etc.) are input to.
The CONT 22 outputs control signals A, B, C having different output timings for controlling the respective parts.

【0065】なお、図中のC1およびC2は、当該信号
の同期タイミングを示す。例えば、RSEL入力1のC
1はφに同期して入力が行われることを示し、RSEL
入力2のC2はφ#(#は論理反転)に同期して入力が
行われることを示す。また、ALU入力のC1は、φの
期間に入力が行われることを示し、ALU出力のC2
は、φ#の期間に出力が行われることを示す。ALU2
6とINC27は、それぞれ動作タイミングの異なった
演算器であり、それぞれ、オーバラップしつつ演算可能
である。
Note that C1 and C2 in the figure indicate the synchronization timing of the signal. For example, C of RSEL input 1
1 indicates that input is performed in synchronization with φ, and RSEL
C2 of the input 2 indicates that the input is performed in synchronization with φ # (# is logical inversion). Further, C1 of the ALU input indicates that the input is performed during the period of φ, and C1 of the ALU output.
Indicates that the output is performed during the period of φ #. ALU2
6 and INC27 are arithmetic units having different operation timings, and can perform arithmetic while overlapping each other.

【0066】そのほかのレジスタなどは、φ、φ#の両
方でデータを入出力可能である。GB、DB、WBの各
バスはφ、φ#の両方で異なったデータを転送可能であ
る。
Data can be input / output to / from other registers such as φ and φ #. The GB, DB, and WB buses can transfer different data in both φ and φ #.

【0067】φ、φ#は互いにノーオーバラップの関係
の2相クロックとしてもよい。
Φ and φ # may be two-phase clocks having no overlap with each other.

【0068】レジスタセレクタ(RSEL)23には、
IR21乃至CONT22から命令コードの一部(レジ
スタ指定フィールド)が与えられる。この供給タイミン
グは、レジスタ指定フィールドの位置によって相違され
る。RSEL23は出力タイミングの相違するレジスタ
選択信号A、Bを出力する。
The register selector (RSEL) 23 has
A part of the instruction code (register designation field) is given from IR21 to CONT22. This supply timing differs depending on the position of the register designation field. The RSEL 23 outputs register selection signals A and B having different output timings.

【0069】例えば、平成5年6月(株)日立製作所発
行『H8/300Hシリーズプログラミングマニュア
ル』に記載のCPUにおいては、16ビット単位の命令
コードのビット7−4が、CONT22と同時に与えら
れ(RSEL入力1)、ビット11−8および3−0
(RSEL入力2)が、CONT22の内容と0.5ス
テート遅れて与えられる。RSEL入力2の反転制御信
号をRSELに与える。
For example, in the CPU described in "H8 / 300H Series Programming Manual" issued by Hitachi, Ltd. in June 1993, bits 7-4 of a 16-bit unit instruction code are given at the same time as CONT22 ( RSEL input 1), bits 11-8 and 3-0
(RSEL input 2) is provided 0.5 state behind the contents of CONT 22. The inverted control signal of RSEL input 2 is applied to RSEL.

【0070】CPU1内部のDBW24、DBR25、
ALU26、INC27、ER0〜ER7(28A〜2
8H)、PC30、CCR31、VAG、ABは、GB
バス、DBバス、WBバスによって相互に接続されてい
る。
DBW24, DBR25 inside the CPU1,
ALU26, INC27, ER0 to ER7 (28A to 2
8H), PC30, CCR31, VAG, AB is GB
They are mutually connected by a bus, a DB bus, and a WB bus.

【0071】2つの演算器ALU26、INC27に対
し、GB、DBバスからデータを入力し、WBバスにデ
ータを出力する。それぞれの入出力バスの数に対応した
数の内部バスとして、バス即ち配線の増加による物理的
規模の増加を抑止している。
Data is input from the GB and DB buses to the two arithmetic units ALU26 and INC27 and output to the WB bus. As a number of internal buses corresponding to the number of input / output buses, an increase in buses, that is, wiring, is prevented from increasing in physical size.

【0072】また、ライトデータバッファ(DBW)2
4は内部データバスへの出力、リードデータバッファ
(DBR)25は内部データバスからの入力、アドレス
バッファ(MAB)33は内部アドレスバスへの出力、
命令レジスタは内部データバスからの入力が可能であ
り、それぞれ内部バスに接続されている。ライトデータ
バッファ(DBW)24およびリードデータバッファ
(DBR)25は32ビット構成とされる。ライトデー
タは32ビット一括してライトデータバッファ(DB
W)24に書き込むことができ、所定のタイミングで、
16ビットの内部データバスに出力される。また、内部
データバスから読み出したデータを、リードデータバッ
ファ(DBR)25に一旦格納して、32ビットのリー
ドデータを一括して出力することができる。MABは+
2のインクリメント機能を有する。
The write data buffer (DBW) 2
Reference numeral 4 is an output to the internal data bus, read data buffer (DBR) 25 is an input from the internal data bus, address buffer (MAB) 33 is an output to the internal address bus,
The instruction register can be input from the internal data bus and is connected to the internal bus. The write data buffer (DBW) 24 and the read data buffer (DBR) 25 have 32 bits. Write data is written in a 32-bit batch write data buffer (DB
W) can be written in 24, at a predetermined timing,
It is output to the 16-bit internal data bus. Further, the data read from the internal data bus can be temporarily stored in the read data buffer (DBR) 25 and the 32-bit read data can be collectively output. MAB is +
It has an increment function of 2.

【0073】命令デコーダ・制御回路(CONT)22
が、IR21からの入力、CPUS信号、INTM1信
号やそのほかの入力信号に基づいて、動作制御を行な
う。制御回路の出力は所定のバッファを介して出力され
る。CONT22自身にも、ステート番号などがフィー
ドバックされる。
Instruction decoder / control circuit (CONT) 22
Controls the operation based on the input from the IR 21, the CPUS signal, the INTM1 signal and other input signals. The output of the control circuit is output via a predetermined buffer. The state number and the like are also fed back to the CONT 22 itself.

【0074】アドレスバッファ(MAB)33はインク
リメント機能(+2)を有する。ER0〜ER7(28
A〜28Hは)データレジスタまたはアドレスレジスタ
として使用することができる。
The address buffer (MAB) 33 has an increment function (+2). ER0 to ER7 (28
A-28H) can be used as a data register or an address register.

【0075】EMLSP29は、ユーザには公開されて
いないリソースで、エミュレータに搭載されて動作する
とき、ユーザプログラムとエミュレーションプログラム
の間の遷移時のスタックポインタとして使用する。その
内容を指定するために、一部の内容が、CPU外部から
与えられる。
The EMLSP 29 is a resource that is not disclosed to the user, and is used as a stack pointer at the time of transition between the user program and the emulation program when the emulator is mounted and operates. In order to specify the content, a part of the content is given from outside the CPU.

【0076】PC30は32ビットのカウンタであり、
CPU1が次に実行する命令のアドレスを示している。
コンデションコードレジスタ(CCR)31は割り込み
マスクビット(I)、キャリフラグ(C)、ゼロフラグ
(Z)、ネガティブフラグ(N)、オーバフローフラグ
(V)を含んでいる。
The PC 30 is a 32-bit counter,
The address of the instruction to be executed next by the CPU 1 is shown.
The condition code register (CCR) 31 includes an interrupt mask bit (I), a carry flag (C), a zero flag (Z), a negative flag (N), and an overflow flag (V).

【0077】CPU1と乗算器2は、バススイッチ34
を介して接続されている。また、バススイッチ34は内
部データバスとのインタフェースも行う。また、CPU
1から乗算器2への制御信号を与える。乗算器2のステ
ータス信号BUSYと、フラグ検出信号をCPU1に与
える。TESTMODE信号を、例えば、SYSC3か
ら与える。制御信号CPUSは、SYSCR14あるい
はそのほかのレジスタの制御ビットの出力にしてもよい
し、マイクロコンピュータの制御端子のようなもので指
定してもよい。
The CPU 1 and the multiplier 2 are connected to the bus switch 34.
Connected through. The bus switch 34 also interfaces with the internal data bus. Also, CPU
A control signal from 1 to the multiplier 2 is given. The status signal BUSY of the multiplier 2 and the flag detection signal are given to the CPU 1. The TESTMODE signal is given from, for example, SYSC3. The control signal CPUS may be the output of the control bit of the SYSCR14 or other register, or may be designated by a control terminal of a microcomputer.

【0078】図5に、制御信号CPUSを制御レジスタ
(CPUCR)14の制御ビットで構成した具体的な例
を示す。図は1ビットの構成を示している。CPUCR
14は、フリップフロップで構成される。フリップフロ
ップにはリセット信号が与えられる。フリップフロップ
のクロックは内部ライト信号と、アドレスをデコードし
て得られるCPUCR選択信号の論理積信号とされる。
データ入力はデータバスのビット8とされる。出力がC
PUS信号とされる。また、クロックトバッファCBF
6を介して、データバスに出力される。クロックトバッ
ファCBF6のクロックは内部ライト信号とCPUCR
選択信号の論理積信号とされる。
FIG. 5 shows a specific example in which the control signal CPUS is composed of the control bits of the control register (CPUCR) 14. The figure shows a 1-bit configuration. CPUCR
14 is composed of a flip-flop. A reset signal is given to the flip-flop. The clock of the flip-flop is a logical product signal of the internal write signal and the CPUCR selection signal obtained by decoding the address.
The data input is bit 8 of the data bus. Output is C
It is used as a PUS signal. In addition, the clocked buffer CBF
It is output to the data bus via 6. The clock of the clocked buffer CBF6 is the internal write signal and the CPUCR.
It is a logical product signal of the selection signals.

【0079】本レジスタのライトは、テストモードや、
エミュレータに搭載した場合のブレークモードなどでの
みライト可能にするとよい。ブレークモードなどについ
ては、特開平6−150026などに記載されている。
同様に、TESTMODE信号を生成することができ
る。同一のレジスタに配置することができる。
Writing to this register is performed in the test mode or
It is recommended to be able to write only in break mode when mounted on an emulator. The break mode and the like are described in JP-A-6-150026.
Similarly, a TESTMODE signal can be generated. It can be placed in the same register.

【0080】図6に、制御信号CPUSの設定方法の一
例として、エミュレーション用プロセッサおよびエミュ
レータをブロック図で示す。エミュレーション用プロセ
ッサ38は、マイクロコンピュータ部分にエミュレーシ
ョン用インタフェース39を加えて構成される。エミュ
レーション用インタフェース39には、エミュレーショ
ン用プロセッサ専用の制御レジスタ41を有する。メモ
リ42は、ROM、RAMを含み、I/OはI/Oポー
ト、タイマ、SCIなどを含む。
FIG. 6 is a block diagram showing an emulation processor and an emulator as an example of a method of setting the control signal CPUS. The emulation processor 38 is configured by adding an emulation interface 39 to the microcomputer part. The emulation interface 39 has a control register 41 dedicated to the emulation processor. The memory 42 includes a ROM and a RAM, and the I / O includes an I / O port, a timer and an SCI.

【0081】コネクタ部がマイクロコンピュータの代わ
りに応用システム(ユーザシステム)43に装着され
る。エミュレーション用プロセッサ38は上記コネクタ
部とインタフェースケーブル44を介し、ターゲットシ
ステムインタフェースを用いて上記応用システム43と
信号の入出力を行う。
The connector section is attached to the application system (user system) 43 instead of the microcomputer. The emulation processor 38 inputs and outputs signals to and from the application system 43 using the target system interface via the connector section and the interface cable 44.

【0082】応用システム(ユーザシステム)43に
は、特に制限はされないものの、ユーザバス45が存在
し、ユーザメモリ46が接続される。エミュレーション
用プロセッサ38が出力し、インタフェースケーブル4
4を介して供給されるユーザストローブ信号に従って、
ユーザメモリ46はリード/ライトされる。
The application system (user system) 43, although not particularly limited, has a user bus 45 and a user memory 46 connected thereto. Output from the emulation processor 38, and the interface cable 4
According to the user strobe signal supplied via
The user memory 46 is read / written.

【0083】一方、エミュレーション用プロセッサ38
は上記エミュレーションインタフェース39を用いてエ
ミュレーションバス47に接続される。エミュレーショ
ンバス47には図示はされない状態信号・制御信号など
を含む。上記エミュレーションバス47を用いて、エミ
ュレーション用プロセッサ38から、応用システム43
とエミュレーション用プロセッサ38の内部状態に応じ
た情報などが出力され、また、エミュレーション用プロ
セッサ38に対し、エミュレーションのための各種制御
信号が入力される。エミュレーション用プロセッサ38
の、図示はされないエミュレートモード端子が電源レベ
ルに固定され、エミュレーション用プロセッサ38内部
ではエミュレートモードが設定される。
On the other hand, the emulation processor 38
Is connected to the emulation bus 47 using the emulation interface 39. The emulation bus 47 includes status signals, control signals, etc. not shown. Using the emulation bus 47, the emulation processor 38 changes the application system 43.
Information corresponding to the internal state of the emulation processor 38 is output, and various control signals for emulation are input to the emulation processor 38. Emulation processor 38
The emulation mode terminal (not shown) is fixed to the power supply level, and the emulation mode is set inside the emulation processor 38.

【0084】さらに、上記エミュレーションバス47に
は、特に制限はされないものの、応用システム43また
はターゲットマイクロコンピュータ内蔵のメモリを代行
するためのRAMでなるようなエミュレーションメモリ
48がある。また、エミュレーション用プロセッサ38
の制御状態やエミュレーションバス47の状態を監視し
て、その状態が予め設定された状態に達した時に、上記
エミュレータ専用割込みを入力して、CPUによるユー
ザプログラムの実行を停止させ、エミュレーション用プ
ログラム実行状態に遷移させる(ブレーク)ためのブレ
ーク制御回路49と、上記CPUのリード動作またはラ
イト動作を示す信号、命令リード動作を示す信号などに
基づき、エミュレーションバス47に与えられるアドレ
スデータさらには制御情報を逐次蓄えるリアルタイムト
レース回路50などが接続される。
Further, the emulation bus 47 has an emulation memory 48 which is a RAM for substituting for the memory built in the application system 43 or the target microcomputer, although not particularly limited thereto. Also, the emulation processor 38
Control state and the state of the emulation bus 47, and when the state reaches a preset state, the emulator dedicated interrupt is input to stop the execution of the user program by the CPU and execute the emulation program execution. A break control circuit 49 for transitioning to a state (break) and address data and control information given to the emulation bus 47 based on a signal indicating a read operation or a write operation of the CPU, a signal indicating an instruction read operation, and the like. A real-time trace circuit 50, etc. for sequentially storing is connected.

【0085】上記エミュレーションバス47が、エミュ
レーションメモリ48、ブレーク制御回路49、リアル
タイムトレース回路50などに、それぞれ接続される。
これらでもってマイクロコンピュータ開発装置55が構
成されている。
The emulation bus 47 is connected to the emulation memory 48, the break control circuit 49, the real time trace circuit 50, etc., respectively.
The microcomputer development device 55 is configured with these.

【0086】上記エミュレーションメモリ48、ブレー
ク制御回路49、リアルタイムトレース回路50はコン
トロールバス51に接続され、コントロールバス51を
介してコントロールプロセッサ52の制御を受けるよう
になっている。上記コントロールバス51は、エミュレ
ーション用プロセッサ制御回路に接続されるとともに、
インタフェース回路を介して、特に制限はされないもの
のパーソナルコンピュータなどのシステム開発装置54
に接続される。例えば、システム開発装置54から入力
されたプログラムをエミュレーションメモリ48に転送
し、内蔵ROM上に配置されるべきかかるプログラムを
CPU1がリードすると、エミュレーションメモリ48
上のプログラムがリードされる。また、ブレーク条件
や、リアルタイムトレース条件などもシステム開発装置
54から与えることができる。
The emulation memory 48, the break control circuit 49, and the real-time trace circuit 50 are connected to the control bus 51, and are controlled by the control processor 52 via the control bus 51. The control bus 51 is connected to an emulation processor control circuit and
A system development device 54 such as a personal computer, though not particularly limited, via the interface circuit.
Connected to. For example, when the program input from the system development device 54 is transferred to the emulation memory 48 and the CPU 1 reads the program to be arranged in the built-in ROM, the emulation memory 48
The above program is read. In addition, break conditions, real-time trace conditions, etc. can be given from the system development device 54.

【0087】コントロールプロセッサ52は、CPUS
信号をエミュレーション用プロセッサ38に供給して、
乗算器の使用/不使用の選択を行うことができる。コン
トロールプロセッサ52は、システム開発装置54から
入力された情報などに基づいて、CPUS信号を制御す
る。あるいは、図5のような制御レジスタを、エミュレ
ーション用インタフェース39内に制御レジスタに設け
て、エミュレータ40のソフトウェアをCPUが実行し
て、前記制御レジスタを指定することによって、CPU
S信号を生成するようにすることができる。この場合
は、エミュレーション用ソフトウェアの実行モード、い
わゆるブレークモードでのみライト可能にすると都合が
よい。開発途上にあるユーザのソフトウェアの誤動作に
よって、誤った設定を行うことがない。
The control processor 52 uses the CPUS
The signal is supplied to the emulation processor 38,
The use / non-use of the multiplier can be selected. The control processor 52 controls the CPUS signal based on the information input from the system development device 54. Alternatively, the control register as shown in FIG. 5 is provided in the control register in the emulation interface 39, the software of the emulator 40 is executed by the CPU, and the control register is designated, whereby the CPU
An S signal may be generated. In this case, it is convenient to enable writing only in the execution mode of the emulation software, so-called break mode. Wrong settings will not be made due to malfunction of software of a user in the process of development.

【0088】エミュレーション用プロセッサ38および
エミュレータ40を複数のCPUをサポート可能にする
ことによって、実際のマイクロコンピュータのみを開発
すればよく、開発効率を向上することができる。なお、
EMLSP29のアドレス指定情報も、エミュレーショ
ン用インタフェース39内の制御レジスタで指定するこ
とができる。
By enabling the emulation processor 38 and the emulator 40 to support a plurality of CPUs, only an actual microcomputer needs to be developed, and the development efficiency can be improved. In addition,
The addressing information of the EMLSP 29 can also be specified by the control register in the emulation interface 39.

【0089】エミュレーション用プロセッサ38やエミ
ュレータ40については、特開平3−271834号公
報、あるいは特開平6−150026号公報などに記載
されている。
The emulation processor 38 and the emulator 40 are described in JP-A-3-271834, JP-A-6-150026 or the like.

【0090】図7に、制御信号CPUS設定方法の一例
である、マイクロコンピュータの主要部をブロック図で
示す。CPUS信号をレジスタによらず、CMOSイン
バータ回路58の出力とする。かかるCMOSインバー
タ回路58は、Pチャネル型MOSトランジスタQ1、
Nチャネル型MOSトランジスタQ2で構成される。こ
のCMOSインバータ回路58の入力は、抵抗Rを介し
て電源Vddに接続されると共に、保護回路Q3、Q4
を介して端子Pに結合される。端子Pは、ワイヤWによ
ってグランドレベル電源用リードLに接続されるか、解
放状態とされるかが選択され、CPUSの設定を行な
う。
FIG. 7 is a block diagram showing a main part of a microcomputer, which is an example of a control signal CPUS setting method. The CPUS signal is output from the CMOS inverter circuit 58 regardless of the register. The CMOS inverter circuit 58 includes a P-channel MOS transistor Q1,
It is composed of an N-channel type MOS transistor Q2. The input of the CMOS inverter circuit 58 is connected to the power supply Vdd via the resistor R, and the protection circuits Q3 and Q4 are connected.
Is coupled to the terminal P via. The terminal P is connected to the ground level power supply lead L by the wire W or is set in the released state, and the CPUS is set.

【0091】端子Pが解放状態とされれば、CMOSイ
ンバータ回路58の入力はハイレベルとなって、CPU
S信号は非活性状態になる。一方、端子Pが、ワイヤW
によって、グランドレベル電源用リードLに接続されれ
ば、CMOSインバータ回路58の入力はロウレベルと
なって、CPUS信号は活性状態になる。乗算器を使用
可能にする。
When the terminal P is released, the input of the CMOS inverter circuit 58 becomes high level and the CPU
The S signal becomes inactive. On the other hand, the terminal P is the wire W
Thus, when connected to the ground level power supply lead L, the input of the CMOS inverter circuit 58 becomes low level, and the CPUS signal becomes active. Enable the multiplier.

【0092】端子Pは対応するリードを持たず、例えば
プラスティックパッケージに封止された場合には、対応
する端子を持たない。
The terminal P has no corresponding lead, and has no corresponding terminal when it is sealed in a plastic package, for example.

【0093】これにより、半導体集積回路装置のパッケ
ージの端子を直接利用することなく、乗算器の制御を設
定できるため、一定のパッケージを用いた場合に、有効
な端子数の減少防ぐことができる。この場合、端子Pを
グランドレベル電源端子に隣接して配置すると都合がよ
い。
Thus, the control of the multiplier can be set without directly using the terminals of the package of the semiconductor integrated circuit device, so that the reduction of the effective number of terminals can be prevented when a fixed package is used. In this case, it is convenient to arrange the terminal P adjacent to the ground level power supply terminal.

【0094】あるいは、端子Pをグランドレベル電源用
リードLにワイヤWによって接続するか、しないかの選
択を、半導体集積回路装置の配線変更として実現しても
よい。CMOSインバータ回路58の入力を、半導体集
積回路装置内部の電源電圧またはグランドのいずれに接
続するかを選択すればよい。このとき、抵抗R及び端子
Pは削除することができる。または、CPUSビットを
PROM素子などで構成してもよい。この場合、製造者
が設定を行なってもよいし、ユーザが設定を行なっても
よい。
Alternatively, the selection of whether the terminal P is connected to the ground-level power supply lead L by the wire W or not may be realized by changing the wiring of the semiconductor integrated circuit device. It suffices to select whether to connect the input of the CMOS inverter circuit 58 to the power supply voltage or the ground inside the semiconductor integrated circuit device. At this time, the resistor R and the terminal P can be deleted. Alternatively, the CPUS bit may be composed of a PROM element or the like. In this case, the manufacturer may make the setting or the user may make the setting.

【0095】図8および図9に、CPUの内部レジスタ
構成を示す。これらのレジスタは、図8の汎用レジスタ
および図9のコントロールレジスタの2つに分割され
る。以下、各レジスタについて説明する。
8 and 9 show the internal register configuration of the CPU. These registers are divided into two, the general-purpose register of FIG. 8 and the control register of FIG. Each register will be described below.

【0096】(1)汎用レジスタ CPUはこの汎用レジスタを8本有している。この汎用
レジスタは32ビット長からなり、すべて同じ機能を有
しており、アドレスレジスタとしてもデータレジスタと
しても使用することができる。データレジスタとしては
32ビット、16ビットおよび8ビットレジスタとして
使用できる。
(1) General-purpose register The CPU has eight general-purpose registers. This general-purpose register has a length of 32 bits, all have the same function, and can be used as both an address register and a data register. The data register can be used as 32 bit, 16 bit and 8 bit registers.

【0097】アドレスレジスタ及び32ビットレジスタ
としては、一括して汎用レジスタER(ER0〜ER
7)として使用する。16ビットレジスタとしては、汎
用レジスタERを分割して汎用レジスタE(E0〜E
7)、汎用レジスタR(R0〜R7)として使用する。
これらは同等の機能を有しており、16ビットレジスタ
を最大16本まで使用することができる。
As address registers and 32-bit registers, general-purpose registers ER (ER0-ER
Used as 7). As a 16-bit register, the general-purpose register ER is divided into general-purpose registers E (E0 to E
7), used as general purpose registers R (R0 to R7).
These have equivalent functions and can use up to 16 16-bit registers.

【0098】8ビットレジスタとしては、汎用レジスタ
Rを分割して汎用レジスタRH(R0H〜R7H)、汎
用レジスタRL(R0L〜R7L)として使用する。こ
れらは同等の機能を有しており、8ビットレジスタを最
大16本まで使用することができる。
As the 8-bit register, the general-purpose register R is divided and used as general-purpose registers RH (R0H to R7H) and general-purpose registers RL (R0L to R7L). These have equivalent functions and can use up to 16 8-bit registers.

【0099】図10に、汎用レジスタの使用方法を示
す。各レジスタは独立して使用方法を選択することがで
きる。
FIG. 10 shows how to use the general-purpose register. The usage of each register can be selected independently.

【0100】汎用レジスタER7には、汎用レジスタと
しての機能に加えて、スタックポインタ(SP)として
の機能が割り当てられており、例外処理やサブルーチン
分岐などで暗黙的に使用される。図11にスタックの状
態を示す。
The general-purpose register ER7 is assigned with a function as a stack pointer (SP) in addition to a function as a general-purpose register, and is implicitly used in exception processing, subroutine branching, and the like. FIG. 11 shows the state of the stack.

【0101】(2)コントロールレジスタ コントロールレジスタは、24ビットのプログラムカウ
ンタ(PC)と8ビットの拡張レジスタ(エクステンド
レジスタ)(EXR)および8ビットのコンディション
コードレジスタ(CCR)を含んでいる。
(2) Control Register The control register includes a 24-bit program counter (PC), an 8-bit extension register (extended register) (EXR), and an 8-bit condition code register (CCR).

【0102】プログラムカウンタ(PC) 24ビットのカウンタで、CPUが次に実行する命令の
アドレスを示している。CPUの命令は、すべて2バイ
ト(ワード)を単位としているため、最下位ビットは無
効である。(命令コードのリード時には最下位ビット
は”0”とみなされる)。
Program Counter (PC) A 24-bit counter that indicates the address of the next instruction to be executed by the CPU. Since all CPU instructions are in units of 2 bytes (words), the least significant bit is invalid. (When reading the instruction code, the least significant bit is regarded as "0").

【0103】分岐命令の実行アドレスの上位8ビットは
無視される。プログラム領域として使用できるのは、
H’00000000〜H’00FFFFFFの領域で
ある。
The upper 8 bits of the execution address of the branch instruction are ignored. The program area can be used
It is an area of H'00000000 to H'00FFFFFF.

【0104】拡張レジスタ(EXR) 8ビットのレジスタで、トレースビット(T)、割込み
マスクビット(I2〜I0)を含む8ビットで構成され
ている。
Extension register (EXR) This is an 8-bit register and is composed of 8 bits including a trace bit (T) and an interrupt mask bit (I2 to I0).

【0105】ビット7:トレースビット(T) トレースビットか否かを指定する。本ビットが”0”に
クリアされているときは命令を順次実行する。”1”に
セットされているときは1命令実行する毎にトレース例
外処理を実行する。
Bit 7: Trace bit (T) Specifies whether or not it is a trace bit. When this bit is cleared to "0", instructions are executed sequentially. When it is set to "1", the trace exception process is executed every time one instruction is executed.

【0106】ビット6〜4:リザーブビット リザーブビットである。Bits 6 to 4: Reserved bits Reserved bits.

【0107】ビット2〜0:割込みマスクビット(I2
〜I0) 割込み要求マスクレベル(0〜7)を指定する。
Bits 2-0: Interrupt mask bit (I2
~ I0) Specify the interrupt request mask level (0 to 7).

【0108】EXRは、LDC、STC、ANDC、O
RC、XORC命令で実行することができる。このう
ち、STCを除く命令を実行した場合、実行終了後3ス
テートの間は、NMIを含めてすべての割込みは受け付
けられない。
EXR is LDC, STC, ANDC, O
It can be executed by RC and XORC instructions. Of these, if an instruction other than STC is executed, all interrupts including NMI cannot be accepted during the three states after the execution is completed.

【0109】コンディションコードレジスタ(CC
R) 8ビットのレジスタで、CPUの内部状態を示す。割込
みマスクビット(I)とハーフキャリ(H)、ネガティ
ブ(N)、ゼロ(Z)、オーバフロー(V)、キャリ
(C)を含む8ビットで構成されている。
Condition code register (CC
R) An 8-bit register that indicates the internal state of the CPU. It is composed of 8 bits including an interrupt mask bit (I), half carry (H), negative (N), zero (Z), overflow (V) and carry (C).

【0110】ビット7:割込みマスクビット(I) 本ビットが”1”にセットされると、割込みがマスクさ
れる。ただし、NMIはIビットに関係なく受け付けら
れる。例外処理の実行が開始されたときに”1”にセッ
トされる。
Bit 7: Interrupt mask bit (I) When this bit is set to "1", the interrupt is masked. However, NMI is accepted regardless of the I bit. It is set to "1" when the execution of exception handling is started.

【0111】ビット6:ユーザビット/割込みマスクビ
ット(UI) ソフトウエア(LDC、STC、ANDC、ORC、Z
ORC命令)でリード/ライトできる。割込みマスクビ
ットとしても使用可能である。
Bit 6: User bit / interrupt mask bit (UI) Software (LDC, STC, ANDC, ORC, Z)
It can be read / written by the ORC command. It can also be used as an interrupt mask bit.

【0112】ビット5:ハーフキャリフラグ(H) ADD.B、ADDX.B、SUB.B、SUBX.
B、CMP.B、NEG.B命令の実行により、ビット
3にキャリまたはボローが生じたとき”1”にセットさ
れ、生じなかったとき”0”にクリアされる。また、A
DD.W、SUB.W、CMP.W、NEG.W命令の
実行により、ビット11にキャリまたはボローが生じた
とき、ADD.L、SUB.L、CMP.L、NEG.
L命令の実行により、ビット27にキャリまたはボロー
が生じたとき、”1”にセットされ、生じなかったと
き”0”にクリアされる。
Bit 5: Half carry flag (H) ADD. B, ADDX. B, SUB. B, SUBX.
B, CMP. B, NEG. When the carry or borrow occurs in bit 3 by the execution of the B instruction, it is set to "1" and when it does not occur, it is cleared to "0". Also, A
DD. W, SUB. W, CMP. W, NEG. When a carry or borrow occurs in bit 11 due to the execution of the W instruction, ADD. L, SUB. L, CMP. L, NEG.
When a carry or borrow occurs in bit 27 by the execution of the L instruction, it is set to "1", and when it does not occur, it is cleared to "0".

【0113】ビット4:ユーザビット(U) ソフトウエア(LDC、STC、ANDC、ORC、X
ORC命令)でリート/ライトできる。
Bit 4: User bit (U) software (LDC, STC, ANDC, ORC, X
REIT / WRITE is possible with the ORC command.

【0114】ビット3:ネガティブフラグ(N) データの最上位ビットを符号ビットとみなし、最上位ビ
ットの値を格納する。
Bit 3: Negative flag (N) The most significant bit of the data is regarded as a sign bit, and the value of the most significant bit is stored.

【0115】ビット2:ゼロフラグ(Z) データがゼロのとき”1”にセットされ、ゼロ以外のと
き”0”にクリアされる。
Bit 2: Zero flag (Z) Set to "1" when the data is zero, and cleared to "0" when it is not zero.

【0116】ビット1:オーバフローフラグ(V) 算術演算命令により、オーバフローが生じたとき”1”
にセットされる。それ以外のとき”0”にクリアされ
る。
Bit 1: Overflow flag (V) "1" when an overflow occurs due to an arithmetic operation instruction
Is set to In other cases, it is cleared to "0".

【0117】ビット0:キャリフラグ(C) 演算の実行により、キャリが生じたとき”1”にセット
され、生じなかったとき”0”にクリアされる。キャリ
には次の種類がある。
Bit 0: Carry flag (C) The carry flag is set to "1" when the carry is generated and is cleared to "0" when the carry is not generated. There are the following types of carriers.

【0118】(a)加算結果のキャリ (b)減算結果のボロー (c)シフト/ローテートのキャリ また、キャリフラグには、ビットアキュムレータの機能
があり、ビット操作命令で使用される。なお、命令によ
ってはフラグが変化しない場合がある。CCRは、LD
C、STC、ANDC、ORC、XORC命令で操作す
ることができる。また、N、Z、V、Cの各フラグは、
条件分岐命令(Bcc)で使用される。
(A) Carry of addition result (b) Borrow of subtraction result (c) Carry of shift / rotate Further, the carry flag has a function of a bit accumulator and is used in a bit operation instruction. Depending on the instruction, the flag may not change. CCR is LD
It can be operated by C, STC, ANDC, ORC, and XORC instructions. In addition, each flag of N, Z, V and C is
Used in conditional branch instructions (Bcc).

【0119】積和レジスタ(MAC) 64ビットのレジスタであり、積和演算結果を格納す
る。32ビットのMACH、MACLから構成される。
MACHは下位10ビットが有効であり、上位は符号拡
張されている。
Product-sum register (MAC) This is a 64-bit register and stores the product-sum operation result. It is composed of 32-bit MACH and MACL.
The lower 10 bits of MACH are valid, and the upper bits are sign-extended.

【0120】図12に、CPUの基本動作タイミングを
示す。
FIG. 12 shows the basic operation timing of the CPU.

【0121】ADD.W R0、R1のようなレジスタ
間演算のタイミングである。特に制限はされないもの
の、内部データバスは16ビットであって、内蔵RO
M、RAMのリード/ライトを1ステートでリード/ラ
イト可能とする。
ADD. It is the timing of register-to-register calculation such as W R0 and R 1. Although not particularly limited, the internal data bus is 16 bits and the built-in RO
Read / write of M and RAM can be performed in one state.

【0122】T0のC2(φ#同期。#は反転論理を示
す)で、CPU1のアドレスバッファ(MAB)33か
らアドレスがIABに出力される。
The address is output from the address buffer (MAB) 33 of the CPU 1 to the IAB at C2 of T0 (φ # synchronization, # indicates inverted logic).

【0123】T1のC1(φ同期)で、IABの内容が
PABに出力され、リードサイクルが開始される。C2
でリードデータが内部データバスに得られ、これをIR
21にラッチする。以上の動作は以前の命令の実行の制
御によって行われる。
At C1 (φ synchronization) of T1, the contents of IAB are output to PAB, and the read cycle is started. C2
Read data is obtained on the internal data bus by
Latch to 21. The above operation is performed by controlling the execution of the previous instruction.

【0124】直前の命令の実行が終了すると、最も早く
命令の実行が開始される場合には、T2のC1で命令コ
ードがCONT22に入力されて、命令の内容が解読さ
れる。解読結果に従って、制御信号を出力して、各部の
制御を行う。命令の一部(レジスタ指定フィールド:R
SEL入力信号1)がレジスタセレクタ23に与えられ
る。
When the execution of the immediately preceding instruction is completed and the execution of the instruction is started earliest, the instruction code is input to CONT22 at C1 of T2, and the content of the instruction is decoded. A control signal is output according to the decoding result to control each part. Part of instruction (register specification field: R
The SEL input signal 1) is given to the register selector 23.

【0125】レジスタ間演算命令では、T2のC2で、
PCの内容を内部バスGBに読み出して、MAB33と
INC27に入力する。MAB33からアドレスIAB
が出力される。レジスタセレクタ23に制御信号を与え
る。RSEL入力信号1と制御信号A(Rs−DB出
力、Rd−GB出力)とに基づいて、レジスタ選択信号
Bが生成される。RSEL入力信号2がレジスタセレク
タ23に与えられる。
In the inter-register operation instruction, at C2 of T2,
The contents of the PC are read out to the internal bus GB and input to the MAB 33 and INC 27. MAB33 to address IAB
Is output. A control signal is given to the register selector 23. The register selection signal B is generated based on the RSEL input signal 1 and the control signal A (Rs-DB output, Rd-GB output). The RSEL input signal 2 is given to the register selector 23.

【0126】T3から、次の次の命令がリードされる。
T3のC1で、INC27でインクリメント(+2)さ
れた結果が、内部バスWBを経由して、PC30にライ
トされる。RSEL入力信号2と制御信号B(WB−R
d入力)とに基づいて、レジスタ選択信号Cが生成され
る。レジスタ選択信号Bがレジスタを選択して、ソース
側、デスティネーション側のレジスタ(S、D)のデー
タをALU26に入力する。ALU26の演算内容はC
ONT22が制御信号Cによって指示する。加減算・論
理演算・シフトなどは1クロックで演算を行うことがで
きる。例えば、上記命令では16ビットの加算を行う。
次の命令のCONT22へのロードを指示する。RSE
L入力信号2と制御信号B(WB−Rd入力)とに基づ
いて、レジスタ選択信号Cが生成される。
From T3, the next next instruction is read.
At C1 of T3, the result incremented (+2) by INC27 is written to the PC 30 via the internal bus WB. RSEL input signal 2 and control signal B (WB-R
The register selection signal C is generated based on (d input). The register selection signal B selects a register and inputs the data of the source side and destination side registers (S, D) to the ALU 26. The calculation contents of the ALU 26 are C
The ONT 22 is instructed by the control signal C. Addition / subtraction, logical operation, shift, etc. can be performed in one clock. For example, the above instruction adds 16 bits.
Instruct to load the next instruction into CONT22. RSE
The register selection signal C is generated based on the L input signal 2 and the control signal B (WB-Rd input).

【0127】T3のC2で、ALU26の演算結果
(R)が、内部バスWBを経由して、レジスタ選択信号
Cが選択したデスティネーション側のレジスタにライト
される。制御信号Cによって、CCR31の更新を行
う。更に次の次の命令をIR21に取り込む。同時に、
次の命令の実行が開始され、例えば、PC30の内容を
読み出して、MAB33とINC27に入力される。レ
ジスタ間演算を実質的に1ステートで実行できる。2つ
の演算器26、27の入出力バスの数に対応した数の内
部バスとして(演算器に対応して、内部バスを増加させ
ることなく)、バス即ち配線の増加による物理的規模の
増加を抑止している。
At C2 of T3, the operation result (R) of the ALU 26 is written to the destination side register selected by the register selection signal C via the internal bus WB. The control signal C updates the CCR 31. Further, the next next instruction is fetched into IR21. at the same time,
Execution of the next command is started, and for example, the content of the PC 30 is read and input to the MAB 33 and INC 27. Register-to-register operations can be executed in substantially one state. As the number of internal buses corresponding to the number of input / output buses of the two arithmetic units 26 and 27 (corresponding to arithmetic units, without increasing the number of internal buses), an increase in physical scale due to an increase in buses, that is, wiring is increased. It has been deterred.

【0128】図13に、CPUの基本動作タイミングを
示す。
FIG. 13 shows the basic operation timing of the CPU.

【0129】MOV.W R0、@R1のような、レジ
スタ間接によるデータライトのタイミングである。
MOV. It is a timing of data write by register indirect such as WR0 and @ R1.

【0130】T0のC2で、CPU1のMAB33から
アドレスがIABに出力される。
At C2 of T0, the address is output to IAB from MAB33 of CPU1.

【0131】T1のC1で、アドレスがPABに出力さ
れ、リードサイクルが開始される。C2でリードデータ
が内部データバスに得られ、これをIR21にラッチす
る。
At C1 of T1, the address is output to PAB and the read cycle is started. At C2, read data is obtained on the internal data bus and is latched in IR21.

【0132】直前の命令の実行が終了すると、T2のC
1で命令コードがCONT22に入力されて、命令の内
容が解読され、各部の制御を行う。命令の一部のレジス
タ指定フィールド(RSEL入力信号1)がレジスタセ
レクタ23に与えられる。レジスタ間接によるデータラ
イトでは、制御信号AとRSEL入力信号1とに基づい
て、レジスタ選択信号Aが与えられ、アドレスとして指
定されたレジスタが選択される。
When the execution of the immediately preceding instruction is completed, C of T2
At 1, the instruction code is input to the CONT 22, the content of the instruction is decoded, and each part is controlled. A register specifying field (RSEL input signal 1) which is a part of the instruction is given to the register selector 23. In the data write by register indirect, the register selection signal A is given based on the control signal A and the RSEL input signal 1, and the register designated as the address is selected.

【0133】T2のC2で、選択されたレジスタの内容
(A)を内部バスGBに読み出して、MAB33を経由
してアドレスIABに出力される。RSEL入力信号2
がレジスタセレクタ23に与えられる。RSEL入力信
号2と制御信号B(Rd−DB出力)とに基づいて、レ
ジスタ選択信号Bが生成される。
At C2 of T2, the content (A) of the selected register is read to the internal bus GB and output to the address IAB via MAB33. RSEL input signal 2
Are provided to the register selector 23. The register selection signal B is generated based on the RSEL input signal 2 and the control signal B (Rd-DB output).

【0134】T3のC1で、制御信号Cの一部がCON
T22に入力され、状態遷移が行われる(ステートマシ
ンが構成される)。IABの内容に基づいて、ライトサ
イクルが開始される。選択されたレジスタの内容(D)
を内部バスDBに読み出して、データバッファ(DB
W)を経由して内部データバスに出力される。
At C1 of T3, a part of the control signal C is CON.
It is input to T22 and a state transition is performed (state machine is configured). A write cycle is started based on the contents of IAB. Contents of selected register (D)
To the internal bus DB and read the data buffer (DB
W) to the internal data bus.

【0135】T3のC2で、PC30の内容を内部バス
GBに読み出して、MAB33とINC27に入力す
る。MAB33からアドレスIABが出力される。RS
EL入力信号1と制御信号A(Rd−GB出力)とに基
づいて、レジスタ選択信号Bが生成される。
At C2 of T3, the contents of the PC 30 are read out to the internal bus GB and input to the MAB 33 and INC 27. The address IAB is output from the MAB 33. RS
The register selection signal B is generated based on the EL input signal 1 and the control signal A (Rd-GB output).

【0136】T4から、次の次の命令がリードされる。From T4, the next next instruction is read.

【0137】T4のC1で、INC27でインクリメン
ト(+2)された結果が、内部バスWBを経由して、P
C30にライトされる。レジスタ選択信号Bがレジスタ
を選択して、データレジスタ(D)のデータをALU2
6に入力する。ALU26の演算内容はCONT22が
制御信号Cによって指示する。転送の場合はデータのチ
ェックのみを行う。次の命令のCONT22へのロード
を指示する。
At C1 of T4, the result incremented (+2) by INC27 is transferred to P via the internal bus WB.
It is written to C30. The register selection signal B selects the register, and the data in the data register (D) is transferred to the ALU2.
Enter in 6. The CONT 22 indicates the arithmetic content of the ALU 26 by the control signal C. In the case of transfer, it only checks the data. Instruct to load the next instruction into CONT22.

【0138】T4のC2で、制御信号Cによって、チェ
ックした結果によって、CCR31の更新を行う。更に
次の次の命令をIR21に取り込む。同時に、次の命令
の実行が開始され、例えば、PC30の内容を読み出し
て、MAB33とINC27に入力される。
At C2 of T4, the CCR 31 is updated according to the check result by the control signal C. Further, the next next instruction is fetched into IR21. At the same time, the execution of the next instruction is started, and for example, the content of the PC 30 is read out and input to the MAB 33 and INC 27.

【0139】RSELに入力するタイミングを、RSE
L入力1(アドレスレジスタ、ソースレジスタ)とRS
EL入力2(データレジスタ、ディスティネーションレ
ジスタ)のように、レジスタ指定フィールド毎にことな
ったタイミング(φ同期とφ#同期)とすることによ
り、命令実行の高速化を実現することができる。
The timing of inputting to RSEL is set to RSE
L input 1 (address register, source register) and RS
By performing different timings (φ synchronization and φ # synchronization) for each register designation field like the EL input 2 (data register, destination register), it is possible to realize high-speed instruction execution.

【0140】表16乃至表19に、本発明に関係のある
命令の説明を示す。
Tables 16 through 19 provide a description of the instructions relevant to the present invention.

【0141】表16は命令コードを示し、表18は命令
の実行状態を示し、表19はコンディションコードの変
化を示している。表17はレジスタフィールドと汎用レ
ジスタの対応を示している。
Table 16 shows the instruction code, Table 18 shows the execution state of the instruction, and Table 19 shows the change of the condition code. Table 17 shows the correspondence between register fields and general-purpose registers.

【0142】[0142]

【表16】 [Table 16]

【0143】[0143]

【表17】 [Table 17]

【0144】[0144]

【表18】 [Table 18]

【0145】[0145]

【表19】 [Table 19]

【0146】積和演算を行うMAC命令、MACレジス
タをクリアするCLRMAC命令、汎用レジスタの内容
をMACレジスタに転送するLDMAC命令、MACレ
ジスタの内容を汎用レジスタに転送するSTMAC命令
がある。
There are a MAC instruction for performing a multiply-accumulate operation, a CLRMAC instruction for clearing a MAC register, an LDMAC instruction for transferring the contents of a general purpose register to a MAC register, and an STMAC instruction for transferring the contents of a MAC register to a general purpose register.

【0147】また、汎用レジスタの待避/復帰命令に
は、1本のレジスタの待避/復帰命令に、PUSH、P
OP命令が、複数レジスタの待避/復帰命令にSTM/
LDM命令がある。STM/LDM命令には、指定する
レジスタ本数に対応して3種類がある。
As for the general-purpose register save / restore instruction, PUSH, PSH
OP instruction is STM /
There is an LDM command. There are three types of STM / LDM instructions corresponding to the designated number of registers.

【0148】図14に、乗算器2の概略ブロック図を示
す。
FIG. 14 shows a schematic block diagram of the multiplier 2.

【0149】乗算器2は、入力ラッチ(X)61、入力
ラッチ(Y)62、部分積生成回路63、マツチプレク
サ64、デコーダ65A、65B、65C、選択回路6
6A、66B、66C、加算器67、フィードバック回
路68、乗算結果レジスタ69などによって構成されて
いる。
The multiplier 2 includes an input latch (X) 61, an input latch (Y) 62, a partial product generation circuit 63, a matchplexer 64, decoders 65A, 65B and 65C, and a selection circuit 6.
6A, 66B, 66C, an adder 67, a feedback circuit 68, a multiplication result register 69, and the like.

【0150】乗算器2は16×16ビットの乗算を行う
ことを基本動作とし、さらに、これを利用して、16×
16ビット+42ビットの積和演算を可能としている。
The multiplier 2 has a basic operation of performing multiplication of 16 × 16 bits, and further, by utilizing this, 16 × 16 bits are used.
16-bit + 42-bit product-sum operation is possible.

【0151】乗算器は乗算動作は、2次のブースのデコ
ードを用いて、16ビット×6ビットを3回行うように
される。
The multiplication operation of the multiplier is performed 16 times × 6 bits three times by using the secondary Booth decoding.

【0152】16ビットの乗数Yは、Y=−y[16]
・2^15+Σ(y[i]・2^(i−1))=Σ(y
[2j]+y[2j+1]−2・y[2j+2])・2
^2jと表現される。i=1〜15、j=0〜7、y
[0]=0である。
The 16-bit multiplier Y is Y = -y [16]
・ 2 ^ 15 + Σ (y [i] ・ 2 ^ (i-1)) = Σ (y
[2j] + y [2j + 1] -2 · y [2j + 2]) · 2
It is expressed as ^ 2j. i = 1 to 15, j = 0 to 7, y
[0] = 0.

【0153】被乗数Xとの乗算は、X・Y=Σ(y[2
j]+y[2j+1]−2・y[2j+2])・X・2
^2jとなる。y[2j]+y[2j+1]−2・y
[2j+2]は、y[2j]、y[2j+1]、y[2
j+2]の値の組み合わせにより、0、±1、±2の5
種類があるから、部分積(y[2j]+y[2j+1]
−2・y[2j+2])・Xは、0、±X、±2Xの5
種類である。この内、0、Xは直ちに得られる。2X
は、1ビットの左シフト(最下位ビットは0)、−Xは
2の補数であり、論理反転+1で得られる。−2Xは、
論理反転+1の1ビットの左シフト(最下位ビットは
0)で得る。
Multiplication with the multiplicand X is performed by X.multidot.Y = .SIGMA. (Y [2
j] + y [2j + 1] -2 · y [2j + 2]) · X · 2
It becomes ^ 2j. y [2j] + y [2j + 1] -2 · y
[2j + 2] is y [2j], y [2j + 1], y [2
j + 2], depending on the combination of 0, ± 1, ± 2, 5
Since there are types, partial products (y [2j] + y [2j + 1]
-2 · y [2j + 2]) · X is 0, ± X, ± 2X 5
It is a kind. Of these, 0 and X are immediately obtained. 2X
Is a 1-bit left shift (least significant bit is 0), -X is 2's complement, and is obtained by logical inversion +1. -2X is
It is obtained by 1-bit left shift of logical inversion + 1 (the least significant bit is 0).

【0154】X側は、採りうる0、±X、±2Xの5種
類の部分積(17ビット)を生成しておく。この5種類
を部分積選択回路66A〜66Cに与える。
On the X side, five types of possible partial products (17 bits) of 0, ± X, and ± 2X are generated. These five types are given to the partial product selection circuits 66A to 66C.

【0155】一方、Y入力のy[2j]、y[2j+
1]、y[2j+2]をデコードして、0、±1、±2
を判定して、この結果によって、部分積選択回路66A
〜66Cを制御して、前記5種類の部分積を選択する。
1回に2ビット単位3種類の選択を行う。これを加算器
67で加算する。加算は、2ビットずつシフトしたそれ
ぞれ17ビットの部分積を加算して、22ビット分の結
果を得る。不足する上位ビットは符号拡張したデータと
する。
On the other hand, y input of y [2j], y [2j +
1], y [2j + 2] are decoded and 0, ± 1, ± 2
And the partial product selection circuit 66A based on this result.
.About.66C is controlled to select the five types of partial products.
Three types of 2-bit units are selected at a time. This is added by the adder 67. In the addition, partial products of 17 bits each shifted by 2 bits are added to obtain a result of 22 bits. The missing upper bits are code-extended data.

【0156】この内、下位6ビットは、乗算結果レジス
タ69のビット0〜5に格納される。上位16ビットは
フィードバック回路68を介して、2回めの加算に含め
られる。2回目の処理では、前記同様に得られた部分積
選択回路66A〜66Cの出力である、2ビットずつシ
フトしたそれぞれ17ビットの部分積と、1回めの処理
の上位16ビットを加算する。22ビット分の結果を得
る。不足する上位ビットは符号拡張したデータとする。
この内、下位6ビットは、乗算結果レジスタ69のビッ
ト11〜6に格納される。上位16ビットはフィードバ
ック回路68を介して、2回めの加算に含められる。
Of these, the lower 6 bits are stored in bits 0 to 5 of the multiplication result register 69. The upper 16 bits are included in the second addition via the feedback circuit 68. In the second processing, the 17-bit partial products each of which is shifted by 2 bits, which are the outputs of the partial product selection circuits 66A to 66C obtained in the same manner as described above, and the upper 16 bits of the first processing are added. Get the result for 22 bits. The missing upper bits are code-extended data.
Of these, the lower 6 bits are stored in bits 11 to 6 of the multiplication result register 69. The upper 16 bits are included in the second addition via the feedback circuit 68.

【0157】同様に3回めの処理が行われる。加算結果
下位20ビットが乗算結果レジスタ69のビット31〜
12に格納される。加算結果の最上位2ビットは無視す
る。
Similarly, the third processing is performed. The lower 20 bits of the addition result are bits 31 to 31 of the multiplication result register 69.
Stored in 12. The two most significant bits of the addition result are ignored.

【0158】積和演算の場合は、前回の結果が同時に加
算されるようにする。
In the case of multiply-add operation, the previous result is added at the same time.

【0159】更に、前回の結果の上位ビットとの4回目
の加算を行って、42ビットの結果を得る。16ビット
×16ビットの積和の結果を42ビットで得ることによ
り、約1000回の積和演算を繰り返してもオーバフロ
ーしないことになる。
Furthermore, the fourth addition is performed with the higher-order bits of the previous result to obtain a 42-bit result. By obtaining the 16-bit × 16-bit product-sum result with 42 bits, overflow does not occur even if the product-sum calculation is repeated about 1000 times.

【0160】内部論理の構成上は、40ビットの結果と
すれば、加算器が22ビット長でよく、論理的規模を最
適化できる。
In terms of the internal logic configuration, if the result is 40 bits, the adder may have a length of 22 bits, and the logical scale can be optimized.

【0161】図15に、上記のワードサイズ乗算(16
ビット×16ビット)の演算方法を示す。
FIG. 15 shows the word size multiplication (16
(Bit x 16 bits) is shown.

【0162】8ビット×8ビットのバイトサイズ乗算
は、上位を拡張する。符号無しの場合0拡張、符号付き
の場合符号拡張を行う。いずれの場合も、上位は全ビッ
ト”0”か全ビット”1”かのいずれかであって、ブー
スのデコードは0になる。このため、3回目の処理は行
わずに、2回の処理で済む。
The 8-bit × 8-bit byte size multiplication expands the upper order. When there is no sign, 0 extension is performed, and when there is a sign, sign extension is performed. In either case, the upper bits are either all bits “0” or all bits “1”, and Booth decoding is 0. For this reason, the second process can be performed without performing the third process.

【0163】図4において、CPU1から乗算器2に、
乗算を示す信号として、MUL信号(制御信号B)、符
号付き/無しを示す信号としてUNSINP信号(制御
信号B)、バイト/ワードサイズを示す信号として、B
YTE信号(制御信号B)、積和演算の起動信号とし
て、MAC信号(制御信号B)、MACHからCPUへ
のデータ転送要求信号として、STMACH信号(制御
信号C)、MACLからCPUへのデータ転送要求信号
として、STMACL信号(制御信号C)、CPUから
MACHへのデータ転送要求信号として、LDMACH
信号(制御信号B)、CPUからMACLへのデータ転
送要求信号として、LDMACL信号(制御信号B)、
MACレジスタのクリア信号として、CLRMAC信号
(制御信号B)、乗数の転送信号として、STX信号
(制御信号B)、被乗数の転送信号として、STY信号
(制御信号B)、乗算結果の転送信号として、MULR
D信号(制御信号C)を与える。
In FIG. 4, from the CPU 1 to the multiplier 2,
A MUL signal (control signal B) as a signal indicating multiplication, a UNSINP signal (control signal B) as a signal indicating signed / unsigned, and a B / word size signal
YTE signal (control signal B), MAC signal (control signal B) as a start-up signal for sum of products operation, STMACH signal (control signal C) as a data transfer request signal from MACH to CPU, data transfer from MACL to CPU The STMACL signal (control signal C) is a request signal, and the LDMACH is a data transfer request signal from the CPU to the MACH.
Signal (control signal B), LDMACL signal (control signal B) as a data transfer request signal from CPU to MACL,
As the clear signal of the MAC register, the CLRMAC signal (control signal B), the transfer signal of the multiplier, the STX signal (control signal B), the transfer signal of the multiplicand, the STY signal (control signal B), and the transfer signal of the multiplication result, MULR
A D signal (control signal C) is given.

【0164】また、乗算器2からCPU1へ、演算実行
中を示す信号として、BUSY信号、フラグに反映すべ
きデータとして、VFLAG、ZFLAG、NFLAG
信号が与えられる。
Further, the signal from the multiplier 2 to the CPU 1 is a BUSY signal as a signal indicating that the operation is being performed, and VFLAG, ZFLAG, NFLAG as data to be reflected in the flag.
A signal is given.

【0165】CPU−乗算器の相互のデータ転送にXバ
ス、Yバスを使用する。
The X bus and the Y bus are used for mutual data transfer between the CPU and the multiplier.

【0166】また、SYSCR13から飽和演算の選択
を示す信号として、FIXED信号が与えられる。ま
た、テストモード信号として、TESTMODE信号が
与えられる。TESTMODE信号が活性状態になっ
て、テストモードが指示されると、乗算器は1回の処理
のみで動作を終了するようにする。
Further, the FIXED signal is given from the SYSCR 13 as a signal indicating the selection of the saturation operation. Further, a TESTMODE signal is given as a test mode signal. When the TESTMODE signal becomes active and the test mode is instructed, the multiplier ends the operation in only one processing.

【0167】処理を短縮することによって、CPUの命
令実行ステートも短縮できる。入力データの組み合わせ
を種々変更してテストする場合に、テスト時間を短縮で
きる。加算を1回しか行わないので、テスト設計を容易
にすることができる。3回の処理を行って、加算結果が
蓄積されて、所望の動作のテストの結果を演算結果とし
て得にくくなることがない。
By shortening the processing, the instruction execution state of the CPU can also be shortened. The test time can be shortened when various combinations of input data are tested. Since the addition is performed only once, the test design can be facilitated. There is no possibility that the addition result is accumulated by performing the processing three times and the result of the test of the desired operation is difficult to obtain as the operation result.

【0168】TESTMODE信号が非活性状態であっ
ても、CPU乃至乗算器のテストを行うことができるこ
とは言うまでもない。TESTMODE信号は、前記の
CPUSのようにレジスタの出力として供給することが
できる。
It goes without saying that the CPU and the multiplier can be tested even when the TESTMODE signal is inactive. The TESTMODE signal can be provided as the output of a register like the CPUS described above.

【0169】表20に乗算器2の内部のフラグの検出方
式およびCPU1への転送方式を示す。
Table 20 shows the detection method of the flag inside the multiplier 2 and the transfer method to the CPU 1.

【0170】[0170]

【表20】 [Table 20]

【0171】乗算器2のフラグ仕様は次のように、V
フラグおよびNフラグ、Zフラグから構成されてい
る。
The flag specifications of the multiplier 2 are as follows:
It is composed of a flag, an N flag, and a Z flag.

【0172】Vフラグ セット条件はMAC命令実行中にオーバフローまたはア
ンダフローが発生したときである。
The V flag set condition is when an overflow or an underflow occurs during the execution of a MAC instruction.

【0173】クリア条件はLDMACまたはCLRMA
C命令を実行したときである。
The clear condition is LDMAC or CLRMA.
This is when the C instruction is executed.

【0174】乗算器からCCRへの転送は、STMAC
実行時に行われる。
Transfer from multiplier to CCR is STMAC
It is done at run time.

【0175】従って、一連の連続した積和演算中に1回
でもオーバフローまたはアンダフローが発生すると、乗
算器のVフラグはセットされた状態を保持する。LDM
ACまたはCLRMAC命令を実行して、新しい一連の
積和演算の開始が判断されると、乗算器のVフラグはク
リアされる。
Therefore, if overflow or underflow occurs even once during a series of continuous product-sum operations, the V flag of the multiplier holds the set state. LDM
When the AC or CLRMAC instruction is executed to determine the start of a new series of multiply-accumulate operations, the V flag of the multiplier is cleared.

【0176】Nフラグ、Zフラグ MUL命令用N、ZフラグとMAC命令用N、Zフラグ
を別々に設けて出力する。
N flag, Z flag The N and Z flags for the MUL instruction and the N and Z flags for the MAC instruction are separately provided and output.

【0177】乗算器からCCRへの転送は、乗算(MU
L)命令の場合、乗算結果の転送時、MAC命令の場合
STMAC実行時に行われる。
Transfer from the multiplier to the CCR is done by multiplying (MU
In case of L) instruction, it is performed at the time of transferring the multiplication result, and in case of MAC instruction, it is performed at the time of executing STMAC.

【0178】なお、NフラグとZフラグは、LDMAC
/CLRMACによって変化しない。
The N flag and the Z flag are LDMAC.
Not changed by / CLRMAC.

【0179】図16にVフラグ仕様の実現の概念図を示
し、図17にNフラグ、Zフラグ仕様の実現の概念図を
示す。
FIG. 16 shows a conceptual diagram for realizing the V flag specification, and FIG. 17 shows a conceptual diagram for realizing the N flag and Z flag specifications.

【0180】Vフラグはセットリセット型のフリップフ
ロップ(RS−F/F)で構成され、一旦、オーバフロ
ーまたはアンダフローが発生すると、STMACにより
読み出すまで状態を保持する。
The V flag is composed of a set-reset type flip-flop (RS-F / F), and once overflow or underflow occurs, the state is held until it is read by STMAC.

【0181】N、Vフラグはラッチ回路(D−F/F)
とマルチプレクサ(MPX)で構成される。MAC命令
実行時の演算結果はラッチ回路に保持され、マルチプレ
クサに与えられる。また、乗算命令実行時の演算結果
は、直接マルチプレクサに与えられる。マルチプレクサ
はSTMAC命令のときラッチ回路の出力を出力し、そ
れ以外のとき演算結果を直接出力する。
The N and V flags are latch circuits (DF / F)
And multiplexer (MPX). The operation result at the time of executing the MAC instruction is held in the latch circuit and given to the multiplexer. Further, the operation result when the multiplication instruction is executed is directly given to the multiplexer. The multiplexer outputs the output of the latch circuit for the STMAC instruction, and otherwise outputs the operation result directly.

【0182】MAC命令とその他の命令は並列して動作
する。MAC命令のフラグを随時CCRに反映しては、
並列実行中の命令のフラグ動作と矛盾してしまう。MA
C命令のフラグを乗算器内部で保持して、STMAC命
令実行時にCCRに転送するようにして、上記矛盾を回
避することができる。
The MAC instruction and other instructions operate in parallel. To reflect the MAC command flag in the CCR at any time,
This conflicts with the flag operation of the instruction being executed in parallel. MA
The above inconsistency can be avoided by holding the flag of the C instruction inside the multiplier and transferring it to the CCR when executing the STMAC instruction.

【0183】図18に、バススイッチ34のブロック図
を示す。
FIG. 18 shows a block diagram of the bus switch 34.

【0184】バススイッチ34は、選択回路71A、7
1B、拡張回路72A、72B、72C、出力バッファ
73A、73B、73C、73Dから構成される。バス
スイッチは、CPU内部バスのGB、DB、WBと、乗
算器のXバス、Yバスと、マイクロコンピュータの内部
バスであるIDBのインタフェースを行う。
The bus switch 34 includes the selection circuits 71A and 7A.
1B, expansion circuits 72A, 72B and 72C, and output buffers 73A, 73B, 73C and 73D. The bus switch interfaces GB, DB, and WB of CPU internal buses, X buses and Y buses of multipliers, and IDB which is an internal bus of a microcomputer.

【0185】乗算の開始時、及びLDMAC命令の場合
は、GB、DBからXバス、Yバスに入力される。G
B、DBの入力は、選択回路71A、71Bで選択され
る。これは汎用レジスタ及び内部バスが32ビット構成
であるために、乗数、被乗数が8ビットまたは16ビッ
トであるために、CONT22の制御信号A及びレジス
タ制御信号Aに基づいて、所定の部分が選択される。
At the start of multiplication, and in the case of the LDMAC instruction, GB, DB are input to the X bus and Y bus. G
Inputs of B and DB are selected by selection circuits 71A and 71B. Since the general-purpose register and the internal bus have a 32-bit structure, the multiplier and the multiplicand are 8 bits or 16 bits, and therefore, a predetermined portion is selected based on the control signal A and the register control signal A of the CONT 22. It

【0186】選択回路71A、71Bの出力は、拡張回
路72A、72Bに入力される。CONT22の制御信
号Aに基づいて、符号無しバイトサイズ乗算(MULX
U.B)の場合、上位8ビットを0拡張する。また、符
号付きバイトサイズ乗算(MULXS.B)の場合、上
位8ビットを符号拡張する。ワードサイズの場合は、選
択回路71A、71Bの出力をそのまま出力する。
The outputs of the selection circuits 71A and 71B are input to the expansion circuits 72A and 72B. Based on the control signal A of the CONT 22, the unsigned byte size multiplication (MULX
U. In the case of B), the upper 8 bits are extended by 0. In the case of signed byte size multiplication (MULXS.B), the upper 8 bits are sign-extended. In the case of word size, the outputs of the selection circuits 71A and 71B are output as they are.

【0187】選択回路71A、71Bの出力は出力バッ
ファ73B、73Cに入力される。CONT22の制御
信号Aに基づいて、所定のタイミングで、拡張回路72
A、72Bの出力をXバスまたはYバスに出力する。
The outputs of the selection circuits 71A and 71B are input to the output buffers 73B and 73C. Based on the control signal A of the CONT 22, the expansion circuit 72 is set at a predetermined timing.
The outputs of A and 72B are output to the X bus or Y bus.

【0188】乗算の終了時、及びSTMAC命令の場合
は、Xバス、YバスからWBへの出力が行われる。Xバ
ス、Yバスの入力は拡張回路72Cに入力される。これ
は、MACHの上位22ビットを符号拡張する。拡張回
路72Cの出力は出力バッファに入力される。CONT
22の制御信号Cに基づいて、所定のタイミングで、拡
張回路72Cの出力をWBに出力する。
At the end of multiplication and in the case of STMAC instruction, output from the X bus and Y bus to WB is performed. The inputs of the X bus and the Y bus are input to the expansion circuit 72C. This sign-extends the upper 22 bits of MACH. The output of the expansion circuit 72C is input to the output buffer. CONT
The output of the expansion circuit 72C is output to WB at a predetermined timing based on the control signal C of 22.

【0189】MAC命令のデータリード時、IDBから
Xバス、Yバスへの入力が、それぞれ1回ずつ行われ
る。CONT22の制御信号Aに基づいて、所定のタイ
ミングで、IDBの内容はをXバスまたはYバスに出力
する。また、IDBは、DBWからの出力を入力可能と
され、DBR及びIRへデータを入力可能とされる。
When the data of the MAC instruction is read, the input from the IDB to the X bus and the Y bus is performed once each. Based on the control signal A of the CONT 22, the content of the IDB is output to the X bus or the Y bus at a predetermined timing. Further, the IDB can input the output from the DBW and can input the data to the DBR and the IR.

【0190】図19、20に、MAC命令の動作タイミ
ングを示す。
19 and 20 show the operation timing of the MAC instruction.

【0191】例えば、MAC @ER1+,@ER2+
命令などの例である。この場合のER1を第1のアドレ
スレジスタ、ER2を第2のアドレスレジスタとする。
前記同様に、T2からMAC命令の実行が開始される。
For example, MAC @ ER1 +, @ ER2 +
Examples are instructions. In this case, ER1 is the first address register and ER2 is the second address register.
Similar to the above, the execution of the MAC instruction is started from T2.

【0192】まず、プリフィックスコードの実行を行
い、PC30の内容をアドレスとした命令のリードを行
い、また、PC30の内容のインクリメントを行う。
First, the prefix code is executed, the instruction having the content of the PC 30 as an address is read, and the content of the PC 30 is incremented.

【0193】T3のφ#で、レジスタ制御信号Aに基づ
いて、第1のアドレスの内容をGBに読み出して、MA
B33に転送し、IABに出力する。
At φ # of T3, the content of the first address is read into GB based on the register control signal A, and MA is read.
Transfer to B33 and output to IAB.

【0194】T4のφで、第1のアドレスの内容をGB
に読み出して、ALU26に入力し、インクリメントを
行う。
At φ of T4, the content of the first address is GB
Read out, input to ALU 26, and increment.

【0195】T4のφ#で、インクリメント結果を、W
B経由で、第1のアドレスレジスタに格納する。バスス
イッチ34に入力した、第1のリードデータをXバスに
出力すると共に、制御信号Bに含まれるSTX信号を活
性状態にし、乗算器2にこの内容を入力ラッチXにラッ
チさせる。同時に、第2のアドレスの内容をGBに読み
出して、MABに転送し、IABに出力する。
At φ # of T4, the increment result is W
Stored in the first address register via B. The first read data input to the bus switch 34 is output to the X bus, the STX signal included in the control signal B is activated, and the multiplier 2 latches the content in the input latch X. At the same time, the contents of the second address are read to GB, transferred to MAB, and output to IAB.

【0196】T5のφで、第2のアドレスの内容をGB
に読み出して、ALU26に入力し、インクリメントを
行う。T5のφ#で、インクリメント結果を、WB経由
で、第2のアドレスレジスタに格納する。バススイッチ
34に入力した、第2のリードデータをYバスに出力す
ると共に、制御信号Bに含まれるSTY信号を活性状態
にし、乗算器2にこの内容を入力ラッチYにラッチさせ
る。MAC信号を活性状態にして、積和演算動作の開始
を指示する。同時に、PC30の内容をアドレスとした
命令のリードを行い、また、PC30の内容のインクリ
メントを行う。
At φ of T5, the content of the second address is GB
Read out, input to ALU 26, and increment. At φ # of T5, the increment result is stored in the second address register via WB. The second read data input to the bus switch 34 is output to the Y bus, the STY signal included in the control signal B is activated, and the multiplier 2 latches this content in the input latch Y. The MAC signal is activated to instruct the start of the product-sum operation. At the same time, an instruction with the contents of the PC 30 as an address is read, and the contents of the PC 30 are incremented.

【0197】T6のφで、インクリメント結果をPC3
0に格納する。一方、BUSY信号が活性状態になる。
MAC命令では、CPU1は乗算器2とは並列に動作
し、BUSY信号を無視して、次の命令の実行を開始す
る。
At φ of T6, the increment result is PC3
Store in 0. On the other hand, the BUSY signal becomes active.
In the MAC instruction, the CPU 1 operates in parallel with the multiplier 2, ignores the BUSY signal, and starts executing the next instruction.

【0198】MAC命令を連続して実行した場合も、次
のMAC命令がアドレス計算を行っている間に、乗算器
の動作が終了するために、MAC命令実行にウェイトを
挿入することはない。
Even when the MAC instruction is continuously executed, the wait is not inserted in the MAC instruction execution because the operation of the multiplier ends while the next MAC instruction is performing the address calculation.

【0199】プリフィックスコードを付した命令コード
とすることにより、特開平−51981号公報に記載さ
れているように、互換性を保持しつつ命令セットを拡張
することができる。また、乗算器動作中に、次の積和演
算を行った場合、命令フェッチとデータのアクセスを行
うことができるから、命令長が長くなっても実行時間を
低下させることがない。積和演算を連続的に高速に実行
することができる。
By using an instruction code with a prefix code, it is possible to expand the instruction set while maintaining compatibility, as described in JP-A-51981. Further, when the next multiply-accumulate operation is performed during the operation of the multiplier, the instruction fetch and the data access can be performed, so that the execution time is not reduced even if the instruction length becomes long. The multiply-accumulate operation can be continuously executed at high speed.

【0200】乗算器2は、演算終了時点で、SYSCR
13のMACSビットを参照して、オーバフローが発生
していれば、MACレジスタの内容を、上限(H’7F
FFFFFF)または下限(H’80000000)に
固定する。
At the end of the calculation, the multiplier 2 receives the SYSCR
If an overflow has occurred by referring to the MACS bit of No. 13, the contents of the MAC register are set to the upper limit (H'7F
FFFFFF) or the lower limit (H'80000000).

【0201】図21、22に、STMAC、LDMAC
命令の動作タイミングを示す。
21 and 22, STMAC and LDMAC are shown.
The operation timing of the instruction is shown.

【0202】例えば、STMAC MACH,ER2命
令などの例である。前記同様に、T2からSTMAC命
令の実行が開始される。
Examples are STMAC MACH and ER2 instructions. Similar to the above, the execution of the STMAC instruction is started from T2.

【0203】まず、BUSY信号の状態をサンプリング
する。BUSY信号が活性状態であれば、ウェイト状態
になる。
First, the state of the BUSY signal is sampled. If the BUSY signal is active, the wait state is entered.

【0204】T2のφ#でPCの内容がGBに読み出さ
れ、MAB33に入力されて、IABに出力される。ま
た、INC27に入力されて、インクリメント動作が開
始される。
At φ # of T2, the contents of the PC are read into GB, input into MAB33, and output to IAB. Further, it is input to the INC 27 and the increment operation is started.

【0205】CPU内部のクロックがロウレベルで固定
され、CPUの動作を停止する。直前にMAC命令を実
行した場合、BUSY信号は3ステートの期間活性状態
であり、STMAC命令も3ステートウェイト状態にな
る。
The clock inside the CPU is fixed at the low level, and the operation of the CPU is stopped. When the MAC instruction is executed immediately before, the BUSY signal remains active during the 3-state period, and the STMAC instruction also enters the 3-state wait state.

【0206】T5でBUSY信号が非活性状態になる
と、T6からクロックの動作が開始される。
When the BUSY signal becomes inactive at T5, the clock operation starts at T6.

【0207】T6のφで、インクリメント結果がWBに
出力され、PC30に格納される。STMACHまたは
STMACL信号が活性状態になって、MACレジスタ
の読み出しが指示される。MACレジスタの内容がXバ
ス、Yバスに出力される。特に制限はされないものの、
Xバスが上位、Yバスが下位の内容とされる。
At φ of T6, the increment result is output to WB and stored in the PC 30. The STMACH or STMACL signal becomes active, and the reading of the MAC register is instructed. The contents of the MAC register are output to the X bus and Y bus. Although not particularly limited,
The X bus has a higher rank and the Y bus has a lower rank.

【0208】T6のφ#で、Xバス、Yバスの内容がW
Bに出力されて、指定されたレジスタ(STMAC M
ACH,ER2の場合は、ER2)に格納される。同時
に、乗算器のフラグの内容がCCRのN、Z、Vフラグ
に格納される。
At φ # of T6, the contents of the X bus and Y bus are W
B is output to the designated register (STMAC M
In the case of ACH and ER2, it is stored in ER2). At the same time, the contents of the multiplier flag are stored in the N, Z, V flags of the CCR.

【0209】また、LDMAC ER1,MACL命令
などの例である。
Further, it is an example of the LDMAC ER1 and MACL instructions.

【0210】T8からLDMAC命令の実行が開始され
る。
Execution of the LDMAC instruction starts at T8.

【0211】T9のφで、指定されたレジスタ(LDM
AC ER1,MACLの場合は、ER1)の内容が読
み出される。この内容がXバス、Yバスに出力される。
At φ of T9, the designated register (LDM
In the case of AC ER1, MACL, the contents of ER1) are read. This content is output to the X bus and the Y bus.

【0212】T9のφ#で、LDMACHまたはLDM
ACL信号が活性状態になる。PC30の内容がGB経
由で、MAB33とINC27に入力される。
With φ # of T9, LDMACH or LDM
The ACL signal becomes active. The content of the PC 30 is input to the MAB 33 and the INC 27 via GB.

【0213】T10のφで、インクリメントされた結果
がWB経由で、PC30に格納される。また、Xバス、
Yバスの内容がMACレジスタに格納される。
At φ of T10, the incremented result is stored in the PC 30 via the WB. Also, X bus,
The contents of the Y bus are stored in the MAC register.

【0214】前記同様に、BUSY信号が活性状態の場
合は、LDMAC命令も活性状態になるようにしてもよ
い。
Similarly to the above, when the BUSY signal is active, the LDMAC instruction may also be active.

【0215】CLRMAC命令は、概略LDMAC命令
と同様の動作で、LDMAC命令のLDMACH、L信
号と同じタイミングで、CLRMAC信号を活性状態に
するようにすればよい。
The CLRMAC instruction is similar to the general LDMAC instruction, and the CLRMAC signal may be activated at the same timing as the LDMACH and L signals of the LDMAC instruction.

【0216】図23、24に、乗算器を用いた乗算命令
のタイミング図を示す。
23 and 24 are timing charts of multiplication instructions using a multiplier.

【0217】なお、CONT22の部分に、内部のステ
ートマシンのステップの番号を記載した。これは、基本
的には、CONT22の出力のフィードバック信号で形
成される。また、制御信号CPUSを用いて、乗算器を
使用するか使用しないかを選択する。例えば、MULX
U.W R1,ER0などのバイトサイズ・符号無し乗
算の例である。前記同様に、T2から実行を開始する。
The step number of the internal state machine is described in the CONT22 part. This is basically formed by the feedback signal at the output of CONT 22. Further, the control signal CPUS is used to select whether or not the multiplier is used. For example, MULX
U. This is an example of byte size / unsigned multiplication such as WR1, ER0. Similar to the above, the execution is started from T2.

【0218】命令が解読されると、まず、T2のφ#
で、レジスタ制御信号Aによって、汎用レジスタの読み
だしを指示する。読出された結果は、GB、DBおよび
バススイッチ34を介して、Xバス、Yバスに出力され
る。
When the instruction is decoded, first, φ # of T2
Then, the register control signal A instructs the reading of the general purpose register. The read result is output to the X bus and the Y bus via the GB, DB and bus switch 34.

【0219】制御信号Bに含まれるSTX、STY信号
に基づいて、Xバス、Yバスの内容は、T3のφで乗算
器の入力ラッチにラッチされる。また、同時に、制御信
号Bに含まれるMUL信号によって、乗算器に乗算を指
示する。CONT22から、バイト/ワードの選択、符
号付/符号無の選択、乗算/積和の選択を上記制御信号
によって指示する。
Based on the STX and STY signals included in the control signal B, the contents of the X bus and the Y bus are latched by the input latch of the multiplier at φ of T3. At the same time, the MUL signal included in the control signal B instructs the multiplier to perform multiplication. From the CONT 22, byte / word selection, signed / unsigned selection, and multiplication / sum of products selection are instructed by the control signal.

【0220】乗算器は、T3のφ#で、BUSY信号を
与える。また、マルチプレクサやデコーダを動作させ
る。T4のφで、1回目の加算を行う。T4のφで部分
積を乗算結果レジスタとフィードバックラッチに格納す
る。これを3回繰り返す。BUSY信号が活性状態にな
ったことに呼応して、CPUはウェイト状態になる。
The multiplier provides the BUSY signal at φ # of T3. It also operates the multiplexer and decoder. At φ of T4, the first addition is performed. The partial product is stored in the multiplication result register and the feedback latch by φ of T4. Repeat this 3 times. In response to the activation of the BUSY signal, the CPU enters the wait state.

【0221】T5のφでBUSYが非活性状態になっ
て、CPUは動作を再開し、T6のφで、制御信号Cに
含まれる、MULRD信号を活性状態にして、乗算結果
レジスタのリードを指示する。乗算結果レジスタの内容
は、Xバス、Yバスおよびバススイッチ34を経由し
て、T6のφ#でWBを経由して、レジスタ制御信号C
によって指定されるレジスタに格納される。同時に、乗
算の結果フラグがCCR31に格納される。
At φ of T5, BUSY becomes inactive, and the CPU restarts the operation. At φ of T6, the MULRD signal included in the control signal C is activated and the reading of the multiplication result register is instructed. To do. The contents of the multiplication result register are stored in the register control signal C via the X bus, the Y bus and the bus switch 34, and via WB at φ # of T6.
Stored in the register specified by. At the same time, the multiplication result flag is stored in the CCR 31.

【0222】前記の通り、乗算命令はBUSY信号によ
って、クロックが停止し、ウェイト状態となる。バイト
サイズ符号無し乗算命令(MULXU.B R0L,R
1など)は1ウェイトが挿入され、3ステートで実行さ
れる。ワードサイズ符号無し乗算命令(MULXU.W
R0,ER1など)は2ウェイトが挿入され、4ステ
ートで実行される。なお、符号付き乗算の場合は、それ
ぞれ、プリフィックスコードの実行が付加される。
As described above, the clock of the multiplication instruction is stopped by the BUSY signal and enters the wait state. Byte size unsigned multiplication instruction (MULXU.B R0L, R
1) is inserted with 1 wait and executed in 3 states. Word size unsigned multiply instruction (MULXU.W
2 waits are inserted in R0, ER1, etc.), and execution is performed in 4 states. In addition, in the case of signed multiplication, execution of a prefix code is added to each.

【0223】BUSY信号によって、演算実行の終了を
判定することにより、制御回路(CONT22)の論理
を縮小することができる。
The logic of the control circuit (CONT22) can be reduced by judging the end of the execution of the operation by the BUSY signal.

【0224】TESTMODE信号が活性状態になっ
て、テストモードを指示された場合には、乗算器は1ス
テップの動作のみを行い、BUSY信号は非活性状態を
保持する。CPUは1ステートで処理を終了する。
When the TESTMODE signal is activated and the test mode is instructed, the multiplier performs only one step operation, and the BUSY signal maintains the inactive state. The CPU ends the process in one state.

【0225】図25、26に、乗算器を用いない乗算命
令のタイミング図を示す。乗算器を用いない乗算は、特
に制限はされないものの、除算と類似のシーケンスで行
うようにする。
25 and 26 are timing diagrams of a multiplication instruction that does not use a multiplier. The multiplication without using the multiplier is performed in a sequence similar to the division, though not particularly limited.

【0226】命令が解読されると、まず、汎用レジスタ
の読みだしを指示する。読出された結果は、符号判定を
行う。符号付/符号無の選択に対応して、符号判定を行
い、除数は符号反転し、負数にする。そのほかは正数に
する。
When the instruction is decoded, first, the reading of the general purpose register is instructed. The read result is subjected to code determination. Corresponding to the selection of signed / unsigned, sign determination is performed, and the divisor is sign-inverted to a negative number. Others are positive numbers.

【0227】被乗数を上位、下位は0にして1ビットず
つシフトし、シフトした結果によって、下位側に乗数を
加算するかを決める。その結果に対して、さらにシフト
を行い、シフトした結果によって、下位側に乗数を加算
を行っていく。これを8または16回繰返して、乗算結
果の絶対値を得る。例えば、MULXU.B R1L,
R0などのバイトサイズ・符号無し乗算の例である。前
記同様に、T2から除算命令の実行が開始される。前記
のような、所定の処理を行った後、T5から部分乗算を
行う。
The multiplicand is set to 0 for the upper side and 0 for the lower side, and the shift is performed bit by bit, and it is determined whether the multiplier is added to the lower side depending on the result of the shift. The result is further shifted, and a multiplier is added to the lower side according to the result of the shift. This is repeated 8 or 16 times to obtain the absolute value of the multiplication result. For example, MULXU. B R1L,
This is an example of byte-size / unsigned multiplication such as R0. Similarly to the above, the execution of the division instruction is started from T2. After performing the predetermined processing as described above, the partial multiplication is performed from T5.

【0228】部分乗算は、左シフト処理と加算で構成さ
れる。前回の加算と次回のシフト処理を同一のALU処
理で行うようにする。
The partial multiplication is composed of left shift processing and addition. The previous addition and the next shift processing are performed by the same ALU processing.

【0229】T5のφ1に同期して、指定されたレジス
タ(ディスティネーションレジスタRd)から被乗数を
読み込み、シフト処理を行う。シフト処理の結果(部分
積)がφ#に同期してWBを経由して、Rdにライトさ
れる。また、シフトアウトされたキャリが内部で保持さ
れる。
In synchronization with φ1 of T5, the multiplicand is read from the designated register (destination register Rd) and shift processing is performed. The result (partial product) of the shift processing is written to Rd via WB in synchronization with φ #. In addition, the carrier that has been shifted out is held inside.

【0230】T6のφ1に同期して、Rdから部分積を
読み込み、部分乗算処理を行う。前回のキャリが”1”
である場合、部分積の下位8ビットに乗数を加算し、1
6ビットでシフト処理を行い、最下位ビットは”0”と
する。前記以外の場合、部分積に16ビットでシフト処
理を行い、最下位ビットは”0”とする。かかる結果が
φ#に同期してWBを経由して、Rdにライトされる。
また、シフトアウトされたキャリが内部で保持される。
この動作を7回繰り返す。
A partial product is read from Rd in synchronization with φ1 of T6, and a partial multiplication process is performed. Last carry is "1"
, The multiplier is added to the lower 8 bits of the partial product, and 1
Shift processing is performed with 6 bits, and the least significant bit is set to "0". In cases other than the above, the partial product is subjected to shift processing with 16 bits and the least significant bit is set to "0". The result is written to Rd via WB in synchronization with φ #.
In addition, the carrier that has been shifted out is held inside.
This operation is repeated 7 times.

【0231】T13では、上記同様の判定を行い、前回
のキャリが”1”である場合、部分積の下位8ビットに
乗数を加算する。前記以外の場合、部分積を保持する。
16ビットの積が得られる。かかる結果がφ#に同期し
てWBを経由して、Rdにライトされる。符号付きの場
合は、T14で符号処理を行う。また、ワードサイズの
場合は、部分乗算処理が8回追加される。
At T13, the same determination as above is performed, and if the previous carry is "1", the multiplier is added to the lower 8 bits of the partial product. Otherwise, the partial product is retained.
A 16-bit product is obtained. The result is written to Rd via WB in synchronization with φ #. If it has a sign, the sign process is performed at T14. In the case of word size, partial multiplication processing is added eight times.

【0232】先に保持した符号判定結果に基づいて、積
の符号処理を行う。すなわち、乗数・被乗数の一方が正
数、他方が負数のときは、積の符号を反転する(0から
積を引く)。
[0232] The sign processing of the product is performed based on the previously stored code judgment result. That is, when one of the multiplier and the multiplicand is a positive number and the other is a negative number, the sign of the product is inverted (the product is subtracted from 0).

【0233】図27に、乗算命令の状態遷移図を示す。
例えば、MULXU.B R1L,R0などのバイトサ
イズ・符号無し乗算の例である。命令の実行が開始され
ると、CPUS信号の状態によって分岐する。
FIG. 27 shows a state transition diagram of the multiplication instruction.
For example, MULXU. This is an example of byte size / unsigned multiplication such as B R1L and R0. When the execution of the instruction is started, the process branches depending on the state of the CPUS signal.

【0234】CPUS信号が活性状態であって、乗算器
の使用が許可されると、図6の動作を行う。即ち、ステ
ップ1で、指定されたレジスタの内容を、GB、DBを
経由して、X、Yバスに出力して、乗算器に供給する。
BUSY信号の状態を判定する。テストモードであれ
ば、BUSY信号は非活性状態であって、直ちにステッ
プ2に遷移する。
When the CPUS signal is active and the use of the multiplier is permitted, the operation of FIG. 6 is performed. That is, in step 1, the contents of the designated register are output to the X and Y buses via GB and DB and supplied to the multiplier.
Determine the status of the BUSY signal. In the test mode, the BUSY signal is inactive, and the process immediately transits to step 2.

【0235】BUSY信号が活性状態であると、WAI
T状態に遷移する。BUSY信号は非活性状態になると
ステップ2に遷移する。
When the BUSY signal is active, WAI
Transition to the T state. When the BUSY signal becomes inactive, the transition to step 2 is made.

【0236】ステップ2では、X、Yバスの内容をWB
を経由して、指定されたレジスタにライトする。例え
ば、乗算器のフラグの内容をCCR31に格納する。次
の命令の実行を開始する。
At step 2, the contents of the X and Y buses are changed to WB.
Write to the specified register via. For example, the content of the flag of the multiplier is stored in the CCR 31. Start executing the next instruction.

【0237】CPUS信号が非活性状態であって、乗算
器の使用が禁止されると、図25、26の動作を行う。
即ち、ステップ1、2でデータアライメントなどを行っ
た後、ステップ3から、部分乗算処理を行う。ステップ
3では、GB上位に被乗数を出力し、これをシフトす
る。
When the CPUS signal is inactive and use of the multiplier is prohibited, the operations of FIGS. 25 and 26 are performed.
That is, after performing data alignment in steps 1 and 2, partial multiplication processing is performed from step 3. In step 3, the multiplicand is output to the upper part of GB and is shifted.

【0238】ステップ4では、GBに部分積を、DB下
位に乗数を出力し、ALU26で加算を行う。前のステ
ップでシフトアウトしたビットが”1”であれば、加算
した結果が選択され、シフトアウトしたビットが”0”
であれば、GBの内容が選択され、シフトを行う。これ
をステップ10まで繰り返す。
In step 4, the partial product is output to GB and the multiplier is output to the lower part of DB, and the ALU 26 performs addition. If the bit shifted out in the previous step is "1", the added result is selected and the bit shifted out is "0".
If so, the contents of GB are selected and the shift is performed. This is repeated until step 10.

【0239】ステップ11では、GBに部分積を、DB
下位に乗数を出力し、ALU26で加算を行う。前のス
テップでシフトアウトしたビットが”1”であれば、加
算した結果が選択され、シフトアウトしたビットが”
0”であれば、GBの内容が選択される。シフトは行わ
ない。
In step 11, the partial product is stored in GB and DB
The multiplier is output to the lower order, and the ALU 26 performs addition. If the bit shifted out in the previous step is "1", the addition result is selected and the bit shifted out is "1".
If it is 0 ", the content of GB is selected. No shift is performed.

【0240】ステップ12で、命令のリードを行う。例
えば、積を検査して、CCRに反映する。次の命令の実
行を開始する。
At step 12, the instruction is read. For example, the product is inspected and reflected in the CCR. Start executing the next instruction.

【0241】図25、26に、除算命令のタイミング図
を示している。例えば、DIVXU.B R1L,R0
などのバイトサイズ・符号無し除算の例である。前記同
様に、T2から除算命令の実行が開始される。除数の符
号反転などの、所定の処理を行った後、T5から部分除
算を行う。部分除算は、左シフト処理と減算で構成され
る。前回の減算と次回のシフト処理を同一のALU処理
で行うようにする。
25 and 26 are timing diagrams of the division instruction. For example, DIVXU. B R1L, R0
It is an example of byte size and unsigned division. Similarly to the above, the execution of the division instruction is started from T2. After performing a predetermined process such as inversion of the sign of the divisor, partial division is performed from T5. Partial division consists of left shift processing and subtraction. The previous subtraction process and the next shift process are performed by the same ALU process.

【0242】T5のφ1に同期して、指定されたレジス
タ(ディスティネーションレジスタRd)から被除数を
読み込み、シフト処理を行う。シフト処理の結果(部分
剰余)がφ#に同期してWBを経由して、Rdにライト
される。また、シフトアウトされたキャリが内部で保持
される。
In synchronization with φ1 of T5, the dividend is read from the designated register (destination register Rd) and shift processing is performed. The result (partial remainder) of the shift processing is written to Rd via WB in synchronization with φ #. In addition, the carrier that has been shifted out is held inside.

【0243】T6のφ1に同期して、Rdから部分剰余
を読み込み、部分除算処理を行う。前回のキャリが”
1”である場合、または、部分剰余の上位8ビットが除
数以上である場合、部分剰余の上位8ビットから除数を
減算(除数の符号反転を行っている場合、除数の反転を
加算)し、16ビットでシフト処理を行い、最下位ビッ
トは”1”とする。前記以外の場合、部分剰余に16ビ
ットでシフト処理を行い、最下位ビットは”0”とす
る。かかる結果がφ#に同期してWBを経由して、Rd
にライトされる。また、シフトアウトされたキャリが内
部で保持される。この動作を7回繰り返す。
In synchronization with φ1 of T6, the partial remainder is read from Rd and the partial division process is performed. The last carry was
If it is 1 "or if the upper 8 bits of the partial remainder is greater than or equal to the divisor, the divisor is subtracted from the upper 8 bits of the partial remainder (if the sign of the divisor is inverted, the inversion of the divisor is added), The shift processing is performed with 16 bits, and the least significant bit is set to “1.” In the other cases, the shift processing is performed with 16 bits to the partial remainder and the least significant bit is set to “0”. Rd synchronously via WB
Is written to. In addition, the carrier that has been shifted out is held inside. This operation is repeated 7 times.

【0244】T13では、上記同様の判定を行い、前回
のキャリが”1”である場合、または、部分剰余の上位
8ビットが除数以上である場合、部分剰余の上位8ビッ
トから除数を減算し、下位8ビットでシフト処理を行
い、最下位ビットは”1”とする。前記以外の場合、部
分剰余に下位8ビットでシフト処理を行い、最下位ビッ
トは”0”とする。いずれの場合も、ビット7の値は失
われる。上位8ビットに剰余、下位8ビットに商が得ら
れる。かかる結果がφ#に同期してWBを経由して、R
dにライトされる。
At T13, a determination similar to the above is made, and if the previous carry is "1" or if the upper 8 bits of the partial remainder is greater than or equal to the divisor, the divisor is subtracted from the upper 8 bits of the partial remainder. , The lower 8 bits are shifted, and the least significant bit is set to "1". In cases other than the above, the partial remainder is subjected to shift processing with the lower 8 bits, and the least significant bit is set to "0". In either case, the value of bit 7 is lost. The remainder is obtained in the upper 8 bits and the quotient is obtained in the lower 8 bits. This result is synchronized with φ #, passes through WB, and
Write to d.

【0245】符号付きの場合は、T14で符号処理を行
う。また、ワードサイズの場合は、部分除算処理が8回
追加される。
In the case of a code, the code processing is performed at T14. In the case of word size, partial division processing is added eight times.

【0246】図28に、ALU26の概略ブロック図を
示す。ALU26は、算術論理演算回路76と、選択回
路77、シフト回路78、制御回路79から構成され
る。乗除算に直接関係のない部分は省略している。
FIG. 28 shows a schematic block diagram of the ALU 26. The ALU 26 includes an arithmetic logic operation circuit 76, a selection circuit 77, a shift circuit 78, and a control circuit 79. Parts not directly related to multiplication and division are omitted.

【0247】算術論理演算回路76は、GBとDBの内
容を入力して、加算、減算、論理積、論理和、排他的論
理和などの演算を行い、結果を出力する。選択回路77
は、算術論理演算回路の出力と、GBの内容を入力し
て、いずれかを選択して出力する。シフト回路78は、
選択回路77の出力を入力して、シフト処理を行う。
The arithmetic logic operation circuit 76 inputs the contents of GB and DB, performs addition, subtraction, logical product, logical sum, exclusive OR, etc., and outputs the result. Selection circuit 77
Inputs the output of the arithmetic logic operation circuit and the contents of GB, selects one and outputs it. The shift circuit 78 is
The output of the selection circuit 77 is input and shift processing is performed.

【0248】選択回路77、シフト回路78は制御回路
79によって制御される。制御回路79は、CONT2
2の与える制御信号と算術論理演算回路76とシフト回
路78の出力によって、選択回路77の選択とシフト回
路78のシフト入力を制御する。制御回路79が、前記
の部分乗算、部分除算の判定を行う。条件が成立してい
れば、算術論理演算回路76の出力を選択し、除算の場
合、1をシフト回路に入力する。条件が不成立であれ
ば、GBの入力を選択し、除算の場合、0をシフト回路
に入力する。乗算の場合のシフト回路の入力は、0とさ
れる。
The selection circuit 77 and the shift circuit 78 are controlled by the control circuit 79. The control circuit 79 is CONT2
The selection of the selection circuit 77 and the shift input of the shift circuit 78 are controlled by the control signal given by 2 and the outputs of the arithmetic logic operation circuit 76 and the shift circuit 78. The control circuit 79 determines the above-mentioned partial multiplication and partial division. If the condition is satisfied, the output of the arithmetic logic operation circuit 76 is selected, and in the case of division, 1 is input to the shift circuit. If the condition is not satisfied, the input of GB is selected, and in the case of division, 0 is input to the shift circuit. The input of the shift circuit in the case of multiplication is set to 0.

【0249】除算の部分除算と乗算の部分乗算の処理の
シーケンス、及びALU26の回路構成を共通化する。
除算と乗算を共通化して、CONT22の論理規模を縮
小できる。
The processing sequence of partial division of division and partial multiplication of multiplication and the circuit configuration of the ALU 26 are made common.
The logical scale of the CONT 22 can be reduced by sharing division and multiplication.

【0250】これにより、乗算器を持たないCPUを容
易に提供することができる。乗算器を持つCPUにおい
て不必要な乗算器を用いない乗算の論理を除算と共通化
して、論理規模の増加を最低限にすることができる。
This makes it possible to easily provide a CPU having no multiplier. In a CPU having a multiplier, the multiplication logic that does not use an unnecessary multiplier can be shared with division, and the increase in logic scale can be minimized.

【0251】また、CPUSによって、乗算器を用いな
い選択を可能にすることによって、テスト性を向上する
ことができる。テスト時に、乗算器を用いるか用いない
かを選択することに両方の論理をテストの対象にするこ
とができる。
Further, the testability can be improved by allowing the selection without using the multiplier by the CPUS. At the time of testing, both logics can be tested by choosing whether to use the multiplier or not.

【0252】複数命令の待避/復帰命令の命令コードは
表16の通りである。
Table 16 shows the instruction code of the save / restore instruction of a plurality of instructions.

【0253】最初に使用するレジスタ番号が、命令コー
ド中に指定される。例えば、昭和5年3月(株)日立製
作所発行『H8/500シリーズプログラミングマニュ
アル』に記載の複数命令の待避/復帰命令のように任意
のレジスタの組合わせを指定するのではなく、連続した
レジスタ番号の固定の組合わせとし、2、3、4本の固
定の組合わせとしている。命令コードも、レジスタ本数
に応じて3種類を用意している。
The register number used first is specified in the instruction code. For example, instead of designating an arbitrary register combination like the multiple instruction save / restore instruction described in "H8 / 500 Series Programming Manual" issued by Hitachi, Ltd. in March 1952, it is not necessary to specify consecutive register A fixed combination of numbers is used, and a fixed combination of 2, 3, and 4 is used. Three types of instruction codes are prepared according to the number of registers.

【0254】複数命令の待避命令は、待避するレジスタ
の本数に対応して、 STM(ERl−ERl+1),@−SP STM(ERm−ERm+2),@−SP STM(ERn−ERn+3),@−SP の3種類を有する。l=0、2、4、6であり、m、n
=0、4である。指定した汎用レジスタをスタックに待
避する。例えば、ER0とER1をスタックに待避する
場合は、 STM(ER0−ER1),@−SP を用いる。ER0、ER1の順番でスタックにライトさ
れ、スタックポインタ(ER7)は+8される。命令コ
ード中のレジスタ指定部は、最初に待避されるレジスタ
番号にしてある。
The saving instruction of a plurality of instructions corresponds to the number of registers to be saved, STM (ER1-ERl + 1), @-SP STM (ERm-ERm + 2), @-SP STM (ERn-ERn + 3), @-SP. There are three types. l = 0, 2, 4, 6, and m, n
= 0 and 4. Save the specified general-purpose register on the stack. For example, when saving ER0 and ER1 on the stack, STM (ER0-ER1), @ -SP is used. The stack pointer (ER7) is incremented by 8 by writing to the stack in the order of ER0 and ER1. The register designation part in the instruction code is the register number saved first.

【0255】図29、30に複数レジスタの待避命令の
実行シーケンスを示す。例えば、STM.L ER0−
ER1,@−SPなどの2本の汎用レジスタを待避する
例である。レジスタ指定フィールドはB’000である
(B’は2進数を示す)。
29 and 30 show the execution sequence of the save instruction of a plurality of registers. For example, STM. L ER0-
This is an example of saving two general-purpose registers such as ER1 and @ -SP. The register designation field is B'000 (B 'indicates a binary number).

【0256】前記同様に、T2から除算命令の実行が開
始される。特に制限はされないものの、命令コードの第
1ワードはプリフィックスコードであり、次の命令コー
ドの動作を指定し、PCをインクリメントするほかの動
作は行わない。
Similarly to the above, the execution of the division instruction is started from T2. Although not particularly limited, the first word of the instruction code is a prefix code, specifies the operation of the next instruction code, and does not perform other operations of incrementing the PC.

【0257】第2ワードの命令コードは、PUSH命令
と共通にされる。
The instruction code of the second word is shared with the PUSH instruction.

【0258】T4のφで、SPの内容をGBに読み出
し、ALU26に入力する。ALU26では−4の演算
を行う。なお、前記の通り、実行前のSPはスタックの
先頭アドレスを示しているとする。
At φ of T4, the contents of SP are read into GB and input to ALU 26. The ALU 26 calculates -4. As described above, the SP before execution indicates the top address of the stack.

【0259】T4のφ#で演算結果がWBとGBに出力
される。WBからSPに書き込まれ、GBからMAB3
3に格納される。MAB33の内容がIABに出力され
る。また、第1の制御信号BとRSEL2(=B’00
0)とによって、待避されるレジスタが選択され、レジ
スタ制御信号Bが生成される。
At φ # of T4, the operation result is output to WB and GB. Written from WB to SP, GB to MAB3
3 is stored. The contents of MAB 33 are output to IAB. Further, the first control signal B and RSEL2 (= B'00
0), the register to be saved is selected, and the register control signal B is generated.

【0260】T5のφで、選択されたレジスタ(ER
0)の内容がDB経由で、DBW24に転送される。
At φ of T5, the selected register (ER
The contents of 0) are transferred to the DBW 24 via the DB.

【0261】T5のφ#で、転送されたデータ(ER0
の内容)の上位16ビット(Eレジスタの内容)が内部
データバスに出力される。また、MAB33のインクリ
メント機能によって、IABの出力値を+2とする。
At φ # of T5, the transferred data (ER0
Upper 16 bits (contents of E) (contents of E register) are output to the internal data bus. Further, the output value of IAB is set to +2 by the increment function of MAB33.

【0262】T6のφで、更に、SPの内容をGBに読
み出し、ALU26に入力する。ALU26では−4の
演算を行う。
At φ of T6, the contents of SP are further read to GB and input to ALU 26. The ALU 26 calculates -4.

【0263】T6のφ#で、DBW24に転送されたデ
ータの下位16ビット(Rレジスタの内容)が内部デー
タバスに出力される。ALU26の演算結果がWBとG
Bに出力される。WBからSPに書き込まれ、GBから
MABに格納される。MAB33の内容がIABに出力
される。また、第2の制御信号BによってRSELのビ
ット0が反転される。第1の制御信号とRSEL2(=
B’001)とによって、待避されるレジスタが選択さ
れ、レジスタ制御信号Bが生成される。
At φ # of T6, the lower 16 bits of the data transferred to DBW 24 (contents of R register) are output to the internal data bus. The calculation result of the ALU 26 is WB and G
Output to B. Written from WB to SP and stored from GB to MAB. The contents of MAB 33 are output to IAB. Further, the second control signal B inverts bit 0 of RSEL. The first control signal and RSEL2 (=
B'001) selects the register to be saved, and the register control signal B is generated.

【0264】T7のφで、選択されたレジスタ(ER
1)の内容がDB経由で、DBW24に転送される。
At φ of T7, the selected register (ER
The contents of 1) are transferred to the DBW 24 via the DB.

【0265】T7のφ#で、転送されたデータ(ER1
の内容)の上位16ビット(Eレジスタの内容)が内部
データバスに出力される。また、MAB33のインクリ
メント機能によって、IABの出力値を+2とする。
At φ # of T7, the transferred data (ER1
Upper 16 bits (contents of E) (contents of E register) are output to the internal data bus. Further, the output value of IAB is set to +2 by the increment function of MAB33.

【0266】T8のφ#で、DBW24に転送されたデ
ータの下位16ビット(Rレジスタの内容)が内部デー
タバスに出力される。
At φ # of T8, the lower 16 bits (contents of the R register) of the data transferred to DBW 24 are output to the internal data bus.

【0267】T8のφ#以降で、前記同様に、次の次の
命令の読み出しと、PC30のインクリメント(+2)
を行う。
After φ # of T8, the next next instruction is read and the PC 30 is incremented (+2) in the same manner as above.
I do.

【0268】レジスタ3本を指定した場合は、実行ステ
ート数が2ステート長くなり、SPのデクリメント(−
4)と、RSELのビット1が反転される。RSEL
は、レジスタ指定フィールドが000の場合、010と
され、汎用レジスタER2が選択される。ライト動作が
2回行われる。
When three registers are designated, the number of execution states becomes two states longer, and the SP decrement (-
4), bit 1 of RSEL is inverted. RSEL
Is 010 when the register designation field is 000, and the general register ER2 is selected. The write operation is performed twice.

【0269】レジスタ4本を指定した場合は、更に、実
行ステート数が2ステート長くなり、SPのデクリメン
ト(−4)と、RSELのビット1とビット0が反転さ
れる。RSELは、レジスタ指定フィールドが000の
場合、011とされ、汎用レジスタER23が選択され
る。ライト動作が2回行われる。
When four registers are designated, the number of execution states is further increased by two states, and the SP decrement (-4) and RSEL bit 1 and bit 0 are inverted. When the register designation field is 000, RSEL is set to 011 and the general-purpose register ER23 is selected. The write operation is performed twice.

【0270】レジスタ番号の下位ビットが固定であるの
で、これを命令処理の実行に従って、変更させることが
容易である。例えば、2本のレジスタを待避する場合、
命令コード上のレジスタ指定フィールドの下位ビットは
0であるので、1回めのレジスタ指定は、レジスタ指定
フィールドの値に従い、2回のレジスタ指定は、CON
T22の制御に従って、レジスタ指定フィールドの下位
1ビットを1に変更して、行うようにする。
Since the lower bit of the register number is fixed, it is easy to change it according to the execution of instruction processing. For example, when saving two registers,
Since the lower bit of the register designation field on the instruction code is 0, the first register designation follows the value of the register designation field and the second register designation is CON.
Under the control of T22, the lower 1 bit of the register designation field is changed to 1 so as to be performed.

【0271】一方、PUSH命令はレジスタ1本の待避
であり、前記の2回目の待避動作を行わないようにさ
れ、実行動作の共通化を図っている。
On the other hand, the PUSH instruction saves one register, and the second save operation is not performed so that the execution operation is shared.

【0272】図31、32に複数レジスタの復帰命令の
実行シーケンスを示す。例えば、LDM.L @ER7
+,ER0−ER1などの2本の汎用レジスタを待避す
る例である。レジスタ指定フィールドは001である。
31 and 32 show an execution sequence of a restore instruction for a plurality of registers. For example, LDM. L @ ER7
In this example, two general-purpose registers such as + and ER0-ER1 are saved. The register designation field is 001.

【0273】図33、34に、RSEL2入力制御回路
の具体的な構成、およびその動作説明を示す。この制御
回路は、アンド回路75A、75B、オア回路80A、
80Bから構成される。
33 and 34 show a specific structure of the RSEL2 input control circuit and an explanation of its operation. This control circuit includes AND circuits 75A and 75B, an OR circuit 80A,
It is composed of 80B.

【0274】ビット2には、オペコードのレジスタ指定
フィールドのビット2がそのまま入力される。ビット
1、0には、オアゲートとアンドゲートを介して入力さ
れる。オアゲートの他方の入力はSTM制御信号1、0
であり、アンドゲートの他方の入力はLDM制御信号
1、0の反転とされる。STM制御信号1、0およびL
DM制御信号1、0は、CONT22の出力である制御
信号Bに含まれる。
Bit 2 of the register designation field of the operation code is directly input to bit 2. Bits 1 and 0 are input via an OR gate and an AND gate. The other input of the OR gate is the STM control signal 1, 0
The other input of the AND gate is the inversion of the LDM control signals 1 and 0. STM control signals 1, 0 and L
The DM control signals 1 and 0 are included in the control signal B which is the output of the CONT 22.

【0275】STM制御信号が活性状態になると、当該
RSELビットは1になる。また、LDM制御信号が活
性状態になると、当該RSELビットは0になる。ST
M、LDM命令と指定したレジスタ本数に従って、ST
M制御信号、LDM制御信号が生成される。
When the STM control signal becomes active, the RSEL bit becomes 1. When the LDM control signal becomes active, the RSEL bit becomes 0. ST
ST according to the M and LDM instructions and the specified number of registers
The M control signal and the LDM control signal are generated.

【0276】これにより、レジスタ選択回路をそのほか
の命令と共通化することができる。共通化によって、物
理的規模の増加を抑止できる。
As a result, the register selection circuit can be shared with other instructions. The commonality can prevent an increase in physical scale.

【0277】図35、36に、C言語で書かれた関数
と、これをCPUの命令に変換したリストの概略を示
す。このリストには、オフセット(相対アドレス)、命
令コード、Cラベル、Cソース及びアセンブラ命令の各
項目が示されている。
35 and 36 show the outline of a function written in the C language and a list obtained by converting the function into a CPU instruction. Each item of offset (relative address), instruction code, C label, C source, and assembler instruction is shown in this list.

【0278】C言語からCPUの命令へのコンパイルに
ついては、例えば、平成4年9月(株)日立製作所発行
『H8/300シリーズCコンパイラ』に記載されてい
る。引数を汎用レジスタER0、ER1に設定しておく
ことができる。
Compiling from C language to CPU instructions is described in, for example, "H8 / 300 series C compiler" issued by Hitachi, Ltd. in September 1992. The argument can be set in the general-purpose registers ER0 and ER1.

【0279】関数Proc1では、引数をレジスタ渡し
とし、これをER0に割り当てている。関数内の処理
で、ER2、3、4、6を使用するため、関数処理の先
頭で、 STM (ER2−ER3),@−SP STM (ER4−ER6),@−SP を実行して、関数の最後で、 LDM @SP+,(ER4−ER6) LDM @SP+,(ER2−ER3) を実行して、サブルーチンからリターン(RTS)して
いる。
In the function Proc1, the argument is passed by register and is assigned to ER0. Since ER2, 3, 4, and 6 are used in the processing within the function, STM (ER2-ER3), @ -SP STM (ER4-ER6), @ -SP is executed at the beginning of the function processing, and the function At the end of, the LDM @ SP +, (ER4-ER6) LDM @ SP +, (ER2-ER3) is executed, and the subroutine returns (RTS).

【0280】ER0、ER1は引数領域のため、関数内
では使用せず、内容の待避/復帰も行わない。
Since ER0 and ER1 are argument areas, they are not used in the function and the contents are not saved / restored.

【0281】また、この関数内で呼び出される関数Pr
oc3は、引数をレジスタ渡しとし、これをER0に割
り当てている。関数内の処理で、ER5を使用するた
め、関数処理の先頭で、1レジスタの待避 PUSH.L ER5 を実行して、関数の最後で、 POP.L ER5 を実行して、サブルーチンからリターン(RTS)して
いる。
Also, the function Pr called in this function
In oc3, the argument is passed by register and is assigned to ER0. Since ER5 is used in the processing within the function, the saving of one register PUSH. Run L ER5 and at the end of the function, POP. L ER5 is executed and the subroutine returns (RTS).

【0282】スタックポインタはER7と兼用であるか
ら、ER7を待避/復帰することは意味がない。従っ
て、タスク切替えを行う場合に使用可能なすべてのレジ
スタを待避する場合には、 STM @SP+,(ER0−ER3) STM @SP+,(ER4−ER6) の2命令を用いる。ER0からER6の順番でスタック
に待避される。同様に、復帰する場合には、 LDM @SP+,(ER4−ER6) LDM @SP+,(ER0−ER3) の2命令を用いる。ER6からER0の順番でスタック
から復帰される。
Since the stack pointer is also used as ER7, it is meaningless to save / restore ER7. Therefore, in order to save all the registers that can be used when task switching is performed, two instructions of STM @ SP +, (ER0-ER3) STM @ SP +, (ER4-ER6) are used. It is saved on the stack in the order of ER0 to ER6. Similarly, when returning, two instructions of LDM @ SP +, (ER4-ER6) LDM @ SP +, (ER0-ER3) are used. The stack is restored in the order of ER6 to ER0.

【0283】前記のように任意の組合わせを指定できな
いが、予め、レジスタの割当てを行っておくことによ
り、実質的な制約にはなりにくい。7本のレジスタを待
避/復帰する場合に2命令を用いることになるが、全体
的な実行ステート数やプログラム容量に対しては影響が
小さい。少なくとも、1本のレジスタずつの待避/復帰
命令を用いるより効果がある。後者の場合、4バイト×
7、5ステート×7であるのに対して、前者では、4バ
イト×2、9+11ステートで実行できる。少なくと
も、命令リードのためのリードサイクルや、アドレス計
算のための内部動作の分を短縮して、高速化を図ること
ができる。
As described above, an arbitrary combination cannot be specified, but by allocating registers in advance, it is difficult to become a substantial restriction. Two instructions are used to save / restore the seven registers, but this has little effect on the total number of execution states and program capacity. At least, it is more effective than using the save / restore instruction for each register. In the latter case, 4 bytes x
In the former case, execution is possible in 4 bytes × 2, 9 + 11 states, while it is 7,5 states × 7. At least, the read cycle for the instruction read and the internal operation for the address calculation can be shortened to increase the speed.

【0284】前記C言語で書かれたプログラムのよう
に、関数乃至サブルーチンを多く用いるプログラムの高
速化を実現することができる。
It is possible to speed up a program that uses many functions or subroutines, such as a program written in the C language.

【0285】また、上記のような関数乃至サブルーチン
の場合のほかに、割り込み処理ルーチンにおいても、同
様のレジスタの待避/復帰を行う必要がある。マイクロ
コンピュータが機器制御などを行う場合には、割り込み
処理については、割り込みのイベントが発生してから、
実際の割り込み処理を実行するまでの時間を短縮するこ
とによって、リアルタイム制御性を向上することができ
る。複数レジスタの待避を高速に実行可能にすることに
より、かかるリアルタイム制御性の向上に効果がある。
In addition to the functions and subroutines as described above, it is necessary to save / restore the registers in the interrupt processing routine as well. When the microcomputer performs device control etc., regarding interrupt processing, after the event of the interrupt occurs,
Real-time controllability can be improved by shortening the time until the actual interrupt processing is executed. By making it possible to save multiple registers at high speed, it is effective to improve such real-time controllability.

【0286】また、固定の組合わせにし、各命令の実行
ステート数を固定にすることにより、内部の条件分岐を
行うことをなくし、内部論理を簡潔にし、論理規模を縮
小できる。マイクロプログラムによらず、ワイアードロ
ジックなどでも容易に実現できる。マイクロプログラム
によらず、ワイアードロジックなどとすることにより、
論理回路の高速化に寄与することができる。特に、C言
語など関数乃至サブルーチンを多く用いるプログラムを
高速に実行することができる。
By using a fixed combination and fixing the number of execution states of each instruction, it is possible to eliminate internal conditional branching, simplify the internal logic, and reduce the logic scale. It can be easily realized by wired logic or the like without depending on the microprogram. By using wired logic etc. regardless of the micro program,
This can contribute to speeding up of the logic circuit. In particular, a program that uses many functions or subroutines such as C language can be executed at high speed.

【0287】図37、38に、割込み例外処理のシーケ
ンスを示す。
37 and 38 show the sequence of interrupt exception handling.

【0288】図39に、例外処理の状態遷移図を示す。FIG. 39 shows a state transition diagram of exception handling.

【0289】前記同様に、T2から割り込み例外処理の
実行が開始される。プリフェッチした命令はキャンセル
され、図示されない割り込み要求信号に呼応して、CO
NT22の入力が切り替えられる。
Similarly to the above, the execution of the interrupt exception handling is started from T2. The prefetched instruction is canceled, and in response to an interrupt request signal (not shown), the CO
The input of NT22 is switched.

【0290】ステップ1の動作として、PC30のデク
リメントを行う。T2のφ#で、PC30の内容を読み
出して、GB経由で、INC27でデクリメント(−
4)を行う。これはプリフェッチをキャンセルしたこと
に対応して、待避すべきPC30の値を算出する。
As an operation of step 1, the PC 30 is decremented. The content of the PC 30 is read at φ # of T2, and the decrement (-
Perform 4). This calculates the value of the PC 30 to be saved in response to the cancellation of the prefetch.

【0291】T3のφで、デクリメントした結果を、W
B経由で一旦PC30に格納する。
The result of decrementing with φ of T3 is W
It is temporarily stored in the PC 30 via B.

【0292】ステップ2で、SPをデクリメントし、こ
の内容をアドレスとして、PC30の内容をデータとし
て、ライト動作を行う。即ち、T3のφで、同時に、S
Pの内容を読み出して、GB経由でALU26でデクリ
メント(−2)を行う。
At step 2, SP is decremented, and the write operation is performed with the contents as the address and the contents of the PC 30 as the data. That is, at φ of T3, at the same time, S
The contents of P are read out, and the ALU 26 decrements (-2) via GB.

【0293】T3のφ#で、デクリメントした結果を、
WB経由でSPに格納するとともに、GB経由でMAB
33に転送し、IABに出力させる。
The result of decrementing with φ # of T3 is
Store in SP via WB and MAB via GB
33, and output to IAB.

【0294】T4のφで、PC30の内容をDB経由で
DBW24に転送する。DBW24の内容は、T4のφ
#から、内部データバスに出力される。
At φ of T4, the contents of the PC 30 are transferred to the DBW 24 via the DB. The content of DBW24 is T4 φ
Output from # to the internal data bus.

【0295】ステップ3で、SPをデクリメントし、こ
の内容をアドレスとして、PC30の上位8ビットとC
CR31の内容をデータとして、ライト動作を行う。
In step 3, SP is decremented, and the contents are used as an address and the upper 8 bits of the PC 30 and C
A write operation is performed using the contents of CR31 as data.

【0296】T4のφで、同時に、SPの内容を読み出
して、GB経由でALU26でデクリメント(−2)を
行う。
At φ of T4, at the same time, the contents of SP are read out, and the ALU 26 decrements (-2) via GB.

【0297】T4のφ#で、デクリメントした結果を、
WB経由でSPに格納するとともに、GB経由でMAB
33に転送し、IABに出力させる。DBW24に保持
したPC30の内容下位16ビットを内部データバスに
出力する。
The result of decrementing with φ # of T4 is
Store in SP via WB and MAB via GB
33, and output to IAB. The lower 16 bits of the contents of the PC 30 held in the DBW 24 are output to the internal data bus.

【0298】T5のφで、CCR31の内容をDB経由
でDBW24に転送する。T4で格納したPC30の上
位8ビットは保持される。DBW24の内容は、T5の
φ#から、内部データバスに出力される。
At φ of T5, the contents of CCR 31 are transferred to DBW 24 via DB. The upper 8 bits of the PC 30 stored at T4 are retained. The content of DBW24 is output to the internal data bus from φ # of T5.

【0299】INTM1信号が非活性状態であれば、ス
テップ4に遷移する。INTM1信号が活性状態であれ
ば、ステップ12に遷移し、SPをデクリメントし、こ
の内容をアドレスとして、EXRの内容をデータとし
て、ライト動作を行う。
If the INTM1 signal is in the inactive state, the process proceeds to step 4. If the INTM1 signal is in the active state, the process proceeds to step 12, the SP is decremented, and the write operation is performed by using the contents as an address and the contents of EXR as data.

【0300】T5のφで、SPの内容を読み出して、G
B経由でALU27でデクリメント(−2)を行う。
At φ of T5, the contents of SP are read and G
Decrement (-2) with ALU 27 via B.

【0301】T5のφ#で、デクリメントした結果を、
WB経由でSPに格納する。
The result of decrementing with φ # of T5 is
Store in SP via WB.

【0302】T6のφで、EXRの内容をDB経由でD
BW24に転送する。T6のφ#から、内部データバス
に出力される。
At φ of T6, the content of EXR is D via DB
Transfer to BW24. Output from φ # of T6 to the internal data bus.

【0303】ステップ4で、ベクタアドレスの内容をリ
ードする。
At step 4, the contents of the vector address are read.

【0304】T5のφ#で、同時に、VAGの内容をG
B経由でMAB33に転送し、IABに出力させる。V
AGには、図示されない、割り込みコントローラから与
えられるベクタ番号に基づいて、ベクタアドレスを生成
する。
At φ # of T5, the contents of VAG are simultaneously changed to G
It transfers to MAB33 via B and makes it output to IAB. V
A vector address is generated in the AG based on a vector number given by an interrupt controller (not shown).

【0305】ステップ5で、ベクタアドレスのリード動
作の終了を待つ。
At step 5, the completion of the read operation of the vector address is awaited.

【0306】ステップ6で、DBR25に格納した、ベ
クタアドレスの内容をアドレスとして、命令のリードを
行う。DBR25の内容をインクリメントし、PC30
に格納する。
At step 6, the instruction is read using the contents of the vector address stored in the DBR 25 as an address. PC30 increments the contents of DBR25
To be stored.

【0307】T8のφ#で、DBR25に格納したベク
タアドレスのリード内容(分岐先の先頭アドレス)をG
B経由で、MAB33に転送し、IABに出力させ、A
LU26でインクリメント(+2)する。
At φ # of T8, the read contents of the vector address (the start address of the branch destination) stored in the DBR 25 are set to G
Transfer to MAB33 via B and let it output to IAB.
The LU 26 increments (+2).

【0308】T9のφで、インクリメントした結果を、
WB経由でPC30に格納する。
The result of incrementing φ of T9 is
Stored in PC 30 via WB.

【0309】ステップ7で、PC30の内容をアドレス
として、命令のリードを行い、PC30のインクリメン
トを行う。
At step 7, the instruction is read by using the content of the PC 30 as an address and the PC 30 is incremented.

【0310】T9のφ#で、PC30の内容(分岐先の
先頭アドレス)をGB経由で、MAB33に転送し、I
ABに出力させ、ALU26でインクリメント(+2)
する。リードした命令をIR21に格納する。
At φ # of T9, the contents of the PC 30 (head address of branch destination) are transferred to the MAB 33 via GB, and I
Output to AB and increment by ALU26 (+2)
To do. The read instruction is stored in IR21.

【0311】T10のφで、インクリメントした結果
を、WB経由でPC30に格納する。
The result of incrementing by φ of T10 is stored in the PC 30 via the WB.

【0312】次の命令の実行を開始させる。Initiate execution of the next instruction.

【0313】制御信号INTM1に従って、ステップ1
2を行うか、行わないかが選択され、スタックを2回行
うか、3回行うかが選択される。スタックを2回行う場
合には、PCとCCR31のみが待避される。SPは−
4となる。上記T5の動作に相当する部分(ステップ1
2)が実行されない。3回行う場合には、PC30とC
CR31及びEXRが待避される。SPは−6となる。
Step 1 according to the control signal INTM1
2 is selected or not selected, and stacking is performed twice or three times. When stacking twice, only the PC and CCR 31 are saved. SP is-
It becomes 4. The part corresponding to the above T5 operation (step 1
2) is not executed. PC30 and C when performing three times
CR31 and EXR are saved. SP becomes -6.

【0314】なお、ステップ1単位の動作が複数ステー
トにまたがっているのは、1つのCONT22の入力に
対応して、複数の異なるタイミングの制御信号A、B、
C及びレジスタ選択信号A、B、Cが生成されるのに対
応する。
The operation in units of step 1 spans a plurality of states because a plurality of control signals A and B at different timings are provided corresponding to the input of one CONT 22.
Corresponds to C and register select signals A, B, C being generated.

【0315】図40、41に、例外処理後のスタックの
状態を示す。図41はノーマルモードを示し、図42は
アドバンストモードを示している。
40 and 41 show the state of the stack after exception processing. 41 shows the normal mode, and FIG. 42 shows the advanced mode.

【0316】図42に、RTE命令の実行シーケンスを
示す。
FIG. 42 shows the execution sequence of the RTE instruction.

【0317】図43に、例外処理の状態遷移図を示す。FIG. 43 shows a state transition diagram of exception handling.

【0318】前記同様に、T2からRTE命令の実行が
開始される。
Similarly to the above, the execution of the RTE instruction is started from T2.

【0319】ステップ1の動作として、SPの内容をア
ドレスとして、スタックのリードを行う。T2のφ#
で、SPの内容を読み出して、GB経由で、MAB33
に転送し、IABに出力させる。
As the operation of step 1, the stack is read by using the contents of SP as an address. Φ of T2
Then, the contents of SP are read and MAB33 is sent via GB.
And output to IAB.

【0320】T3のφで、SPの内容を読み出して、G
B経由で、ALU27でインクリメント(+2)する。
IABのアドレスでスタックをリードする。T3のφ#
で、リードした内容をDBR25に格納する。
At φ of T3, the contents of SP are read and G
Via B, the ALU 27 increments (+2).
Read the stack at the IAB address. Φ # of T3
Then, the read content is stored in the DBR 25.

【0321】INTM1信号が非活性状態であれば、ス
テップ2に遷移する。INTM1信号が活性状態であれ
ば、ステップ10に遷移し、リードした結果をEXRに
格納する。SPをインクリメントし、この内容でリード
を行う。
If the INTM1 signal is in the inactive state, the process proceeds to step 2. If the INTM1 signal is active, the process proceeds to step 10 and the read result is stored in EXR. SP is incremented, and the contents are read.

【0322】T3のφ#で、同時に、インクリメントし
た結果を、WB経由でSPに格納する。また、GBを経
由して、MAB33に転送し、IABに出力させる。
At φ # of T3, at the same time, the incremented result is stored in SP via WB. In addition, the data is transferred to the MAB 33 via the GB and is output to the IAB.

【0323】T4のφで、DBR25の内容をGBに読
み出し、これをALU27に入力する。T4のφ#で、
ALU27はGBから入力した内容をそのまま、WBに
出力し、EXRに格納する。
At φ of T4, the content of DBR25 is read out to GB and this is input to ALU27. With φ # of T4,
The ALU 27 outputs the content input from the GB as it is to the WB and stores it in EXR.

【0324】ステップ2で、リードした結果をCCR3
1に格納する。MAB33に格納した内容を、MAB3
3でインクリメントさせる。この内容でリードを行う。
なお、MAB33のインクリメント機能は、特開平4−
333153号公報などに記載されている。
In step 2, the read result is CCR3
Store in 1. The contents stored in MAB33 are changed to MAB3
Increment by 3. Read with this content.
The increment function of the MAB 33 is disclosed in
It is described in Japanese Patent No. 333153 and the like.

【0325】T5のφで、DBR25の内容をGBに読
み出し、これをALU27に入力する。T5のφ#で、
ALU27はGBから入力した内容をそのまま、WBに
出力し、CCR31に格納する。
At φ of T5, the content of DBR25 is read out to GB, and this is input to ALU27. With φ # of T5,
The ALU 27 outputs the content input from the GB as it is to the WB and stores it in the CCR 31.

【0326】ステップ3で、SPの内容をインクリメン
ト(+4)する。
At step 3, the contents of SP are incremented (+4).

【0327】T6のφで、SPの内容を読み出して、G
B経由で、ALU26でインクリメント(+4)する。
At φ of T6, the contents of SP are read and G
Via B, the ALU 26 increments (+4).

【0328】T6のφ#で、インクリメントした結果
を、WB経由でSPに格納する。
The result of incrementing with φ # of T6 is stored in SP via WB.

【0329】ステップ4で、DBR25に格納した、ス
タックから復帰したPC30の内容をアドレスとして、
命令のリードを行う。DBR25の内容をインクリメン
トし、PC30に格納する。
At step 4, the contents of the PC 30 stored in the DBR 25 and returned from the stack are used as addresses.
Read the instruction. The contents of the DBR 25 are incremented and stored in the PC 30.

【0330】T6のφ#で、同時に、DBR25に格納
したベクタアドレスのリード内容(分岐先の先頭アドレ
ス)をGB経由で、MABに転送し、IABに出力さ
せ、ALUでインクリメント(+2)する。
At φ # of T6, at the same time, the read contents of the vector address stored in the DBR 25 (head address of branch destination) are transferred to the MAB via the GB, output to the IAB, and incremented (+2) in the ALU.

【0331】T7のφで、インクリメントした結果を、
WB経由でPC30に格納する。
The result of incrementing with φ of T7 is
Stored in PC 30 via WB.

【0332】ステップ5で、PC30の内容をアドレス
として、命令のリードを行い、PC30のインクリメン
トを行う。
At step 5, the instruction is read by using the content of the PC 30 as an address and the PC 30 is incremented.

【0333】T7のφ#で、PC30の内容(分岐先の
先頭アドレス)をGB経由で、MAB33に転送し、I
ABに出力させ、ALU26でインクリメント(+2)
する。リードした命令をIRに格納する。
At φ # of T7, the contents of PC30 (start address of branch destination) are transferred to MAB33 via GB, and I
Output to AB and increment by ALU26 (+2)
To do. The read instruction is stored in IR.

【0334】T8のφで、インクリメントした結果を、
WB経由でPC30に格納する。次の命令の実行を開始
させる。
The result of incrementing with φ of T8 is
Stored in PC 30 via WB. Start execution of the next instruction.

【0335】例えば、INTM1信号が0レベルの場合
には、前記従来CPU(例えば、前記平成5年6月
(株)日立製作所発行『H8/300Hシリーズプログ
ラミングマニュアル』に記載のCPU)と同一のスタッ
クの構造とされる。命令コードが共通であることと相俟
って、従来CPUによって書かれたプログラムをそのま
ま実行することができる。
For example, when the INTM1 signal is at 0 level, the same stack as that of the conventional CPU (for example, the CPU described in "H8 / 300H Series Programming Manual" issued by Hitachi, Ltd. in June 1993) The structure of Coupled with the common instruction code, a program written by a conventional CPU can be executed as it is.

【0336】新たな、コンディションコードや割込みマ
スクビットやトレースビットなどを追加する場合には、
これに対応したプログラムを作成することになるから、
スタックの構造が異なっても実質的な問題はない。割込
みマスクビットを追加するなどして、使い勝手を向上す
ることができる。
When a new condition code, interrupt mask bit, trace bit, etc. are added,
Since a program corresponding to this will be created,
There is no practical problem even if the stack structure is different. The usability can be improved by adding an interrupt mask bit.

【0337】なお、前記の通りINTM1ビットがSY
SCRに存在し、このビットの状態がINTM1信号に
反映されるようになっている。リセット後に、かかるS
YSCRの設定を行うことにより、EXRを使用するか
しないかが選択される。
As mentioned above, the INTM1 bit is SY.
It exists in the SCR, and the state of this bit is reflected in the INTM1 signal. S after reset
Whether or not EXR is used is selected by setting YSCR.

【0338】図44にCONT22の一部の論理を示
す。このCONT22は、アンド回路86A〜86Dに
よって構成される。
FIG. 44 shows a part of the logic of the CONT 22. The CONT 22 is composed of AND circuits 86A to 86D.

【0339】EXRを使用しない、すなわち、INTM
1ビットを”0”にクリアすると、EXRのビットは全
て”0”とみなされ、設定値は、無視されるようにされ
る。
EXR is not used, that is, INTM
When 1 bit is cleared to "0", all bits of EXR are regarded as "0" and the set value is ignored.

【0340】次に、図4におけるエミュレーション用イ
ンタフェース39に含まれる制御レジスタ41の構成を
示す。この制御レジスタ41は、以下説明するように、
(1)ASEコントロールレジスタ D (ASECR
D)、(2)ブレークコントロールレジスタ A B
(BRCRA、B)、(3)ブレークアドレスレジスタ
A、B(BARA、B)、(4)ブレークアドレスマス
クレジスタ A、B(BAMRA、B)、および(5)
ASE専用スタックレジスタ(BRKSTKR)から構
成されている。
Next, the configuration of the control register 41 included in the emulation interface 39 in FIG. 4 will be shown. This control register 41, as described below,
(1) ASE control register D (ASECR
D), (2) Break control register A B
(BRCRA, B), (3) break address registers A, B (BARA, B), (4) break address mask registers A, B (BAMRA, B), and (5)
It is composed of an ASE dedicated stack register (BRKSTKR).

【0341】図45に、(1)ASEコントロールレジ
スタ D (ASECRD)の構成を示す。このレジス
タは8ビットリード/ライト可能なレジスタで、シング
ルステップの設定、RTB命令実行後の割込制御、多重
ブレークの許可禁止、ウインドウ機能を指定する。各ビ
ットの内容を表21乃至表24に示す。
FIG. 45 shows the structure of (1) ASE control register D (ASECRD). This register is an 8-bit readable / writable register that specifies single step settings, interrupt control after RTB instruction execution, multiple break enable / disable, and window function. The contents of each bit are shown in Tables 21 to 24.

【0342】[0342]

【表21】 [Table 21]

【0343】[0343]

【表22】 [Table 22]

【0344】[0344]

【表23】 [Table 23]

【0345】[0345]

【表24】 [Table 24]

【0346】図46に、(2)ブレークコントロールレ
ジスタ A B(BRCRA、B)の構成を示す。この
レジスタは、(a)BRCRA、(b)BRCRBから
なり、各々は8ビットのリード/ライトが可能なレジス
タで、それぞれPCブレークのチャネルA、Bの制御を
行う。各ビットの内容を表25乃至表28に示す。
FIG. 46 shows the configuration of (2) break control register AB (BRCRA, B). This register is composed of (a) BRCRA and (b) BRCRB, each of which is an 8-bit readable / writable register and controls channels A and B of the PC break, respectively. The contents of each bit are shown in Tables 25 to 28.

【0347】[0347]

【表25】 [Table 25]

【0348】[0348]

【表26】 [Table 26]

【0349】[0349]

【表27】 [Table 27]

【0350】[0350]

【表28】 [Table 28]

【0351】図47に、(3)ブレークアドレスレジス
タ A、B(BARA、B)の構成を示す。このレジス
タは、(a)BARA、(b)BARBからなり、各々
は32ビットのリード/ライトが可能なレジスタで、そ
れぞれPCブレークのチャネルA、Bのアドレスを指定
する。32ビットのレジスタをバイトサイズに分割し
て、BARR、E、H、Lと表記される場合もある。最
上位のBARRはリザーブされている。リードすると不
定値が読み出される。ライトは無効である。
FIG. 47 shows the configuration of (3) break address registers A and B (BARA, B). This register is composed of (a) BARA and (b) BARB, each of which is a 32-bit readable / writable register and specifies the addresses of channels A and B of the PC break, respectively. A 32-bit register may be divided into byte sizes and may be represented as BARR, E, H, and L. The highest BARR is reserved. When read, an undefined value is read. Light is disabled.

【0352】図48に、(4)ブレークアドレスマスク
レジスタ A、B(BAMRA、B)の構成を示す。こ
のレジスタは、(a)BAMRA、(b)BAMRBか
らなり、各々は32ビットのリード/ライトが可能なレ
ジスタで、それぞれPCブレークのチャネルA、Bのア
ドレス比較のマスクを行うビットを指定する。BAMR
のビットを”1”にセットすると、このビットに対応す
るアドレスのビットは、アドレス比較対象から除外され
る。32ビットのレジスタをバイトサイズに分割して、
BAMRR、E、H、Lと表記される場合もある。最上
位のBARRはリザーブされている。リードすると不定
値が読み出される。ライトは無効である。
FIG. 48 shows the configuration of (4) break address mask registers A and B (BAMRA, B). This register is composed of (a) BAMRA and (b) BAMRB, each of which is a 32-bit readable / writable register and specifies a bit for masking the address comparison of channels A and B of the PC break. BAMR
When the bit of is set to "1", the bit of the address corresponding to this bit is excluded from the address comparison target. Divide 32-bit register into byte size,
It may be expressed as BAMRR, E, H, and L. The highest BARR is reserved. When read, an undefined value is read. Light is disabled.

【0353】図49に、(5)ASE専用スタックレジ
スタ(BRKSTKR)の構成を示す。このレジスタ
は、6バイト(48ビット)のリード/ライトが可能な
レジスタで、ユーザモード⇔ブレークモードの遷移時
に、スタック領域として使用する。ユーザのSPは使用
せず、保持される。スタックされるリソースおよびスタ
ックの構造は、MCU動作モード(ノーマルモード/ア
ドバンストモード)および、制御レジスタの設定(SY
SCRのINTM1ビット)によって相違される。表2
9にこのレジスタの使用方法を示す。
FIG. 49 shows the configuration of (5) ASE dedicated stack register (BRKSTKR). This register is a 6-byte (48-bit) readable / writable register and is used as a stack area at the transition between user mode and break mode. The user's SP is not used and is retained. The resources to be stacked and the structure of the stack are as follows: MCU operation mode (normal mode / advanced mode) and control register setting (SY
It depends on INTM1 bit of SCR). Table 2
9 shows how to use this register.

【0354】[0354]

【表29】 [Table 29]

【0355】エミュレーション用ソフトウェアの実行状
態への遷移(ブレーク)時には、固定アドレスのブレー
クスタックレジスタを使用するようにする。ブレーク例
外処理や、ブレークからのリターン命令時には、ユーザ
のスタックポインタ(ER7)を使用せず、固定的なス
タックアドレスを生成する。かかるスタックアドレスの
生成はEMLSP29による。
At the time of transition (break) to the execution state of the emulation software, the break stack register having a fixed address is used. A fixed stack address is generated without using the user's stack pointer (ER7) during break exception processing or a return instruction from a break. The EMLSP 29 generates the stack address.

【0356】図50に、EMLSP29の構成を示す。
このEMLSP29は、クロックトバッファで構成され
る。
FIG. 50 shows the structure of the EMLSP 29.
The EMLSP 29 is composed of a clocked buffer.

【0357】かかるクロックトバッファの内、ビット2
3〜10は1固定、ビット5、4、0は0固定、ビット
9〜6は、外部からの指定を入力する。また、ビット
3、2、1はCONT22の制御信号を入力する。CM
OS回路で構成する場合、必要に応じて論理反転を用い
ればよい。クロックトバッファの出力はGBに接続され
ている。また制御信号mは、CONTの制御信号とクロ
ック(φ#)の論理積信号である。
Bit 2 of the clocked buffer
3 to 10 are fixed to 1, bits 5, 4 and 0 are fixed to 0, and bits 9 to 6 are designated by an external input. Bits 3, 2, and 1 input the control signal of CONT22. CM
When the OS circuit is used, logical inversion may be used if necessary. The output of the clocked buffer is connected to GB. The control signal m is a logical product signal of the CONT control signal and the clock (φ #).

【0358】通常のレジスタ回路が、データを保持する
ためのラッチ回路を持たなければならないが、EMLS
P29は、これを持たず、小型化を図っている。
A normal register circuit must have a latch circuit for holding data, but EMLS
The P29 does not have this and is downsized.

【0359】従って、ブレークスタックレジスタの先頭
アドレスは、B’000000であって、64kバイト
単位で16通りのアドレスを選択可能とされる。マイク
ロコンピュータの内部I/Oレジスタの配置によって、
アドレスを変更できる。
Therefore, the start address of the break stack register is B'000000, and 16 addresses can be selected in units of 64 kbytes. Depending on the arrangement of internal I / O registers of the microcomputer,
You can change the address.

【0360】ブレーク例外処理の実行シーケンスは、図
37、38と同様であり、そこでのSP(ER7)の読
み出しに代わって、EMLSP29を読み出すようにす
る。
The execution sequence of the break exception processing is similar to that of FIGS. 37 and 38, and the EMLSP 29 is read instead of reading the SP (ER7) there.

【0361】この場合、最初(T3のφ)は下位アドレ
スをB’000110として、デクリメントした内容の
B’000100がスタックのアドレスとされる。
In this case, at the beginning (φ of T3), the lower address is B'000110, and the decremented content B'000100 is the address of the stack.

【0362】2回目(T4のφ)は下位アドレスをB’
000100として、デクリメントした内容のB’00
0010がスタックのアドレスとされる。
The second time (φ of T4) sets the lower address to B '.
B'00 with decremented contents as 000100
0010 is set as the address of the stack.

【0363】3回目(T5のφ)は下位アドレスをB’
000010として、デクリメントした内容のB’00
0000がスタックのアドレスとされる。3回目は、I
NTM信号が活性状態のときに有効である。読み出され
るビット2、1は、CONT22の制御信号によって選
択する。
The third time (φ of T5) sets the lower address to B '.
B'00 with decremented contents as 000010
0000 is set as the stack address. The third time is I
This is valid when the NTM signal is active. The bits 2 and 1 to be read are selected by the control signal of the CONT 22.

【0364】リターン命令の実行シーケンスは、図42
と同様であり、SP(ER7)の読み出しに代わって、
EMLSP29を読み出すようにする。
The execution sequence of the return instruction is shown in FIG.
Is similar to, but instead of reading SP (ER7),
The EMLSP 29 is read out.

【0365】最初(T2のφ#)はINTM1信号によ
って異なり、INTM1信号が非活性状態であれば、下
位アドレスをB’000010として、INTM1信号
が活性状態であれば、下位アドレスをB’000000
として、読み出す。これらがスタックのアドレスとな
る。
At the beginning (φ # of T2) depends on the INTM1 signal, if the INTM1 signal is inactive, the lower address is B'000010, and if the INTM1 signal is active, the lower address is B'000000.
Read as. These are the stack addresses.

【0366】2回目(T3のφ)は、INTM1信号が
活性状態である場合に有効であり、下位アドレスをB’
000010として、デクリメントした結果をアドレス
としてリードを行う。
The second time (φ of T3) is effective when the INTM1 signal is in the active state, and the lower address is B '.
As 000010, the decremented result is used as an address for reading.

【0367】3回目はMAB33のインクリメントによ
ってアドレスを生成し、EMLSP29は使用しない。
The third time, the address is generated by the increment of MAB33, and EMLSP29 is not used.

【0368】これにより、固定的な出力回路として論理
規模を縮小できる。ユーザに公開されない資源による論
理規模の増大を最小限にすることができる。
With this, the logic scale can be reduced as a fixed output circuit. It is possible to minimize the increase in the logical scale due to the resources not exposed to the user.

【0369】図51に、ブレーク例外処理の実行タイミ
ングを示す。実行シーケンスは図37、38の例外処理
タイミングと同様である。
FIG. 51 shows the execution timing of break exception handling. The execution sequence is the same as the exception processing timing shown in FIGS.

【0370】前記同様に、T2から割り込み例外処理の
実行が開始される。プリフェッチした命令はキャンセル
され、図示されないブレーク要求信号に呼応して、CO
NT22の入力が切り替えられる。
Similarly to the above, the execution of the interrupt exception handling is started from T2. The prefetched instruction is canceled, and in response to a break request signal (not shown), the CO
The input of NT22 is switched.

【0371】T3のバス動作が行われない期間に、ブレ
ークモードを示す信号BRKAK#が活性状態になる。
During the period in which the bus operation of T3 is not performed, the signal BRKAK # indicating the break mode is activated.

【0372】図52に、ブレーク制御論理の回路構成を
示す。この回路は、アンド回路81A乃至81G、オア
回路82A乃至82D、フリップフロップ83から構成
されている。
FIG. 52 shows the circuit configuration of the break control logic. This circuit includes AND circuits 81A to 81G, OR circuits 82A to 82D, and a flip-flop 83.

【0373】CPUに対するブレーク要求は、3要因が
存在する。第1はBRK端子による要求である。第2は
アドレス比較Aによる要求であり、これは、BRKCR
のBIEAビットによって許可される。第3はアドレス
比較Bによる要求であり、これは、BRKCRのBIE
Bビットによって許可される。なお、かかるアドレス比
較は、前記の通り、(CA23・AR23+¬CA23
・¬AR23+AMR23)・…・(CAn・ARn+
¬CAn・¬ARn+AMRn)・…・(CA0・AR
0+¬CA0・¬AR0+AMR0)と表現される。
(¬は論理反転を示す)。
The break request to the CPU has three factors. The first is a request by the BRK terminal. The second is a request by address comparison A, which is BRKCR.
BIEA bit of. The third is a request by address comparison B, which is the BIE of BRKCR.
Permitted by the B bit. In addition, as described above, the address comparison is performed as follows.
· ¬AR23 + AMR23) ··· · (CAn · ARn +
-CAn-ARn + AMRn) ...- (CA0-AR
0 + ¬CA0 · AR0 + AMR0).
(¬ indicates logical inversion).

【0374】これらの論理和信号が、ブレーク要求とし
て、CPUに与えられる。
These OR signals are given to the CPU as a break request.

【0375】ブレークモードでは、MBIEビットの状
態によってBRK端子によるブレーク要求の許可禁止が
選択される。即ち、ブレークモードでMBIEビット
が”0”にクリアされている場合は、ブレーク要求が抑
止される。アドレス比較によるブレーク要求は、ブレー
クモードで禁止される。
In the break mode, permission or prohibition of the break request by the BRK terminal is selected depending on the state of the MBIE bit. That is, when the MBIE bit is cleared to "0" in break mode, the break request is suppressed. A break request by address comparison is prohibited in break mode.

【0376】また、MBIEビットは、フリップフロッ
プで構成され、BRKAK信号の反転信号で”0”にク
リアされる。かかるフリップフロップの入力は、所定の
データバスのビットであって、クロックは、ブレークモ
ード信号とアドレスデコード信号とライト信号の論理積
信号とされる。かかるアドレスデコード信号は、CPU
の出力するアドレスがBRKCRの存在するアドレスに
なったとき、活性状態とされる。即ち、ブレークモード
でのみライト可能とされる。
The MBIE bit is composed of a flip-flop and is cleared to "0" by an inverted signal of the BRKAK signal. The input of such a flip-flop is a bit of a predetermined data bus, and the clock is a logical product signal of a break mode signal, an address decode signal and a write signal. The address decode signal is sent to the CPU
When the address output by is the address in which BRKCR exists, it is activated. That is, writing is possible only in break mode.

【0377】即ち、ブレークモードに遷移した直後は、
ブレーク要求がが禁止状態であって、不所望のブレーク
の多重例外処理(スタックした内容の破壊)が禁止され
る。また、BRKCRのSSTPビットと、BRKAK
信号の反転信号との論理積が、シングルステップブレー
ク要求として、CPUに与えられる。
That is, immediately after the transition to the break mode,
The break request is in the disabled state, and the multiple exception handling (destroy of the stacked contents) of the undesired break is prohibited. Also, the SSTP bit of BRKCR and BRKAK
The logical product of the signal and the inverted signal is given to the CPU as a single step break request.

【0378】シングルステップブレーク要求と、RTB
命令実行信号との論理積信号と、ブレーク要求が、CP
U内部で、CPUブレーク例外処理要求として認識され
る。これらの例外処理の内容は共通とされる。
Single step break request and RTB
The AND signal with the instruction execution signal and the break request
Within the U, it is recognized as a CPU break exception handling request. The contents of these exception processes are common.

【0379】CPUはRTB命令実行時には、かかるシ
ングルステップブレーク要求を無視する。
The CPU ignores the single step break request when executing the RTB instruction.

【0380】上記実施例によれば、以下の作用効果を得
るものである。
According to the above embodiment, the following operational effects are obtained.

【0381】(1)既存の命令セットと互換性を維持し
つつ、乗算器を内蔵することに当っては、ポストインク
リメントレジスタ間接のアドレッシングモードのみをサ
ポートすることによって、アドレッシングモードの増加
を最小限にして、かつ処理性能を低下させずに積和演算
を実行可能にすることができる。また、アドレスレジス
タの補正をレジスタ間演算命令で行い、これを1ステー
トで実行することができ、アドレッシングの柔軟性を向
上することができる。さらに、積和演算をCPUの内部
動作(ポストインクリメントのアドレス計算)と並行に
行うことによって、実行ステート数の短縮を行うことが
できる。
(1) In incorporating a multiplier while maintaining compatibility with the existing instruction set, by supporting only the post-increment register indirect addressing mode, the increase in addressing modes is minimized. In addition, the product-sum operation can be executed without deteriorating the processing performance. Further, the address register can be corrected by an inter-register operation instruction, and this can be executed in one state, so that addressing flexibility can be improved. Furthermore, the number of execution states can be shortened by performing the sum-of-products operation in parallel with the internal operation of the CPU (post-increment address calculation).

【0382】(2)乗算器を利用して乗算命令を実行す
ることにあたっては、乗算の結果(積、フラグ)を直接
汎用レジスタ、CCRに格納するようにして、直ちに結
果を利用できるようにし、実質的な乗算の実行速度を向
上することができる。また、積和演算の結果(MAC)
をリード(STMAC)すると同時に、乗算器内部で保
持したフラグをCCRに格納することによって、積和演
算結果の利用や判定を容易に行うことができ、使い勝手
を向上することができる。
(2) When executing a multiply instruction using a multiplier, the result of multiplication (product, flag) is directly stored in a general-purpose register, CCR, so that the result can be used immediately. The execution speed of the multiplication can be substantially improved. Also, the result of the product-sum operation (MAC)
Is read (STMAC), and at the same time, the flag held inside the multiplier is stored in the CCR, so that the product-sum operation result can be easily used and judged, and the usability can be improved.

【0383】(3)乗算器を取外し可能にすることによ
って、乗算器を取外した場合は、積和演算をサポートし
ないことによって、容易に下位CPUを実現し、論理的
・物理的規模を縮小し、製造費用を低減した別のマイク
ロコンピュータを容易に開発することができる。また、
汎用的な乗算命令を、乗算器によらずにサポートするこ
とによって、かかる別のマイクロコンピュータにおける
使い勝手の低下を防止できる。さらに、乗算器によらな
い乗算命令を除算と同一のシーケンスで実行するように
して、乗算器を持つマイクロコンピュータにおいても冗
長な論理を最低限にすることができる。
(3) By making the multiplier removable, if the multiplier is removed, the lower CPU can be easily realized by not supporting the product-sum operation, and the logical and physical scale can be reduced. , Another microcomputer with reduced manufacturing cost can be easily developed. Also,
By supporting a general-purpose multiply instruction without using a multiplier, it is possible to prevent the usability of such another microcomputer from being degraded. Further, by executing the multiplication instruction that does not depend on the multiplier in the same sequence as the division, redundant logic can be minimized even in the microcomputer having the multiplier.

【0384】また、乗算器使用するか使用しないかの制
御信号を与えて制御することによって、テスト性を向上
したり、エミュレータを共通化したりすることができ
る。全体的な開発効率を向上することができる。さらに
また、乗算器を削除し、小型化したCPUを用いて、マ
イクロコンピュータを構成することによって、半導体集
積回路の論理規模・物理的規模を縮小して、製造費用の
縮小を図ることができる。
Further, by giving a control signal to control whether the multiplier is used or not used, the testability can be improved and the emulator can be made common. Overall development efficiency can be improved. Furthermore, by constructing a microcomputer by using a miniaturized CPU by removing the multiplier, the logical scale and physical scale of the semiconductor integrated circuit can be reduced, and the manufacturing cost can be reduced.

【0385】(4)乗算器とCPUを一体に構成して、
乗算器・CPU間の配線を短縮して、物理的規模を縮小
する。また、高速化に寄与することができる。
(4) The multiplier and the CPU are integrally formed,
The physical scale is reduced by shortening the wiring between the multiplier and the CPU. It can also contribute to speeding up.

【0386】(5)乗算器のテストモードを設定して、
このときの乗算器の処理を1ステップのみにすることに
よって、論理規模の増加を最低限にして、テストの容易
性を向上することができる。テストステップを短縮する
ことができる。
(5) Set the test mode of the multiplier,
By making the processing of the multiplier at this time only one step, the increase in logic scale can be minimized and the easiness of test can be improved. The test step can be shortened.

【0387】(6)内部動作のパイプラインに対応し
て、入出力タイミングの異なるレジスタ選択回路を複数
持つことにより、実質的に1命令/1ステート実行を行
うことができる。
(6) Corresponding to the pipeline of the internal operation, by having a plurality of register selection circuits having different input / output timings, it is possible to substantially execute one instruction / one state.

【0388】(7)複数レジスタの退避/復帰命令を持
ち、この組み合せを固定的にすることによって、論理規
模の縮小を図ることができる。レジスタの本数の異なる
命令を複数命令サポートすることによって、使い勝手の
低下を防ぐことができる。また、複数レジスタの退避/
復帰命令を関数(サブルーチン)の入り口/出口で実行
することによって、C言語などで記述された場合のよう
に、関数の使用頻度が高い場合に、処理速度を特に向上
することができる。さらに、割り込み例外処理ルーチン
の先頭で複数レジスタの退避を用いることにより、リア
ルタイム性の向上を図ることができる。
(7) Having a save / restore instruction for a plurality of registers and fixing this combination makes it possible to reduce the logical scale. By supporting a plurality of instructions having different numbers of registers, it is possible to prevent a reduction in usability. Also, save multiple registers /
By executing the return instruction at the entry / exit of the function (subroutine), the processing speed can be particularly improved when the function is frequently used, such as when written in C language. Furthermore, by using the saving of a plurality of registers at the beginning of the interrupt exception handling routine, it is possible to improve the real-time property.

【0389】(8)EXRの有効/無効を切り換えるこ
とで、互換性を維持することと、機能拡張とを両立する
ことができる。EXRを無効とし、例外処理において退
避/復帰を行わないようにすることで、スタックの節約
と、割込み応答時間の高速化に寄与することができる。
また、互換性を維持する。さらに、EXRを有効とする
ことで、割り込みマスクレベルを拡張したり、トレース
機能を追加したりして、使い勝手を向上することができ
る。
(8) By switching the validity / invalidity of EXR, compatibility can be maintained and function expansion can be achieved at the same time. By disabling EXR and not performing save / restore in exception processing, it is possible to contribute to saving stack and speeding up interrupt response time.
It also maintains compatibility. Further, by enabling EXR, it is possible to improve the usability by expanding the interrupt mask level and adding a trace function.

【0390】(9)エミュレータ用の固定的なスタック
ポインタを持つことによって、ユーザプログラムとエミ
ュレーションプログラムの遷移時に、ユーザーのスタッ
クポインタとは独立して、固定的なアドレスに対して退
避および復帰が行われるから、エミュレータのソフトウ
ェア、ハードウェアの開発を容易にすることができる。
(9) By having a fixed stack pointer for the emulator, it is possible to save and restore to a fixed address independently of the user's stack pointer at the time of transition between the user program and the emulation program. Therefore, the emulator software and hardware can be easily developed.

【0391】また、エミュレータ用のスタックポインタ
を固定的にすることによって、ユーザに公開しない資源
を最小限の論理的・物理的規模にすることができる。ユ
ーザプログラムからエミュレーションプログラムへの遷
移(ブレーク)を多重に行うことを禁止することを可能
にすることによって、不所望のスタックの内容の破壊を
防止することができる。
Further, by fixing the stack pointer for the emulator, the resources not disclosed to the user can be minimized in logical and physical scale. By making it possible to prohibit multiple transitions (breaks) from the user program to the emulation program, it is possible to prevent undesired destruction of the stack contents.

【0392】以上本発明者等によってなされた発明を実
施例に限定されるものではなく、その要旨を逸脱しない
範囲において種々変更可能である。実施例を相互に組み
合せて使用することもできる。
The invention made by the inventors of the present invention is not limited to the embodiments, and various modifications can be made without departing from the spirit of the invention. The embodiments can also be used in combination with one another.

【0393】例えば、CPUの命令セットやレジスタ構
成は変更可能である。内部バス幅なども変更可能であ
る。但し、命令の大部分の命令コード長より、小さいバ
ス幅でないことが望ましい。
For example, the instruction set and register configuration of the CPU can be changed. The width of the internal bus can also be changed. However, it is desirable that the bus width is not smaller than the instruction code length of most of the instructions.

【0394】また、乗算器の内部構成なども種々変更可
能である。16ビット×6ビットを3回繰り返すのでは
なく、16ビット×4ビットを4下位繰り返すようにし
てもよい。命令実行ステートと論理的規模に鑑みて選択
すればよい。
The internal structure of the multiplier can be changed in various ways. Instead of repeating 16 bits × 6 bits three times, 16 bits × 4 bits may be repeated four lower levels. It may be selected in consideration of the instruction execution state and the logical scale.

【0395】さらに、飽和演算の指定、乗算器あり/な
しの指定、テストモードの指定方法が種々変更可能であ
ることは言うまでもない。
Further, it goes without saying that the specification method of the saturation operation, the specification of the presence / absence of the multiplier, and the specification method of the test mode can be variously changed.

【0396】さらにまた、乗算器に限らず除算器を内蔵
するものであっても良い。
Furthermore, not only the multiplier but also a divider may be built in.

【0397】また、互換性を維持すべき対象は、前記例
に限定されない。一般的に、CPUの例外処理時に、コ
ントロールレジスタの内容を待避することは行われてお
り、そのほかのCPUについても、本発明を適用して、
互換性を維持しつつ、コントロールレジスタの機能を拡
張することができる。
Further, the object for which compatibility is to be maintained is not limited to the above example. Generally, the contents of the control register are saved at the time of exception processing by the CPU, and the present invention can be applied to other CPUs as well.
The function of the control register can be expanded while maintaining compatibility.

【0398】さらに、シングルチップマイクロコンピュ
ータのその他の機能ブロックについても何等制約されな
い。
Furthermore, there are no restrictions on other functional blocks of the single-chip microcomputer.

【0399】以上の説明では主として本発明者によって
なされた発明をその背景となった利用分野であるシング
ルチップマイクロコンピュータに適用した場合について
説明したが、それに限定されるものではなく、その他の
データ処理装置にも適用可能であり、本発明は少なくと
も、複数の動作モードを選択して動作するデータ処理装
置に適用することができる。
In the above description, the case where the invention made by the present inventor is mainly applied to the single-chip microcomputer which is the field of use which is the background of the invention has been described, but the present invention is not limited to this and other data processing. The present invention is also applicable to a device, and at least the present invention can be applied to a data processing device that operates by selecting a plurality of operation modes.

【0400】[0400]

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

【0401】(1)乗算器をCPUに内蔵することによ
って、アドレッシングモードの増加を最小限にして、か
つ処理性能を低下させずに積和演算を実行可能にするこ
とができる。乗算器による乗算の結果を汎用レジスタC
CRに反映させ、かかる結果を直ちに利用可能にして、
処理速度を高速にすることができる。
(1) By incorporating the multiplier in the CPU, it is possible to minimize the increase in the addressing mode and to execute the product-sum operation without lowering the processing performance. The result of multiplication by the multiplier is stored in the general-purpose register C.
Reflect it in CR and make those results available immediately,
The processing speed can be increased.

【0402】(2)乗算器を取外し可能に(独立して)
設けることによって、乗算器を取外した場合は、積和演
算をサポートしないことによって、容易に下位CPUを
実現し、論理的・物理的規模を縮小し、製造費用の低減
に寄与することができる。
(2) Multiplier can be removed (independently)
By providing the multiplier, when the multiplier is removed, it is possible to easily realize the lower CPU by not supporting the product-sum operation, reduce the logical / physical scale, and contribute to the reduction of the manufacturing cost.

【0403】(3)複数レジスタの退避/復帰命令を持
ち、この組み合せを固定的にすることによって、論理規
模の縮小を図ることができ、また、高速化を図ることが
できる。
(3) By having a save / restore instruction for a plurality of registers and fixing this combination, the logical scale can be reduced and the speed can be increased.

【0404】(4)コントロールレジスタの有効/無効
を切り換えることで、スタックの節約と、割込み応答時
間の高速化に寄与することができるとともに、互換性を
維持することができる。
(4) By switching the control register between valid and invalid, it is possible to contribute to saving the stack and speeding up the interrupt response time, while maintaining compatibility.

【0405】(5)エミュレータ専用の固定スタックポ
インタを持つことにより、エミュレータをサポートする
ことができ、また、論理規模の増加を最低限にして、エ
ミュレータの設計を容易にすることができ、さらにエミ
ュレータ専用スタックポインタの一部のアドレスを、C
PU外部から与えるようにして、スタックレジスタをリ
ロケータブルにし、マイクロコンピュータのアドレス配
置などに容易に対応することができる。
(5) By having a fixed stack pointer dedicated to the emulator, the emulator can be supported, and the increase in logic scale can be minimized to facilitate emulator design. The address of a part of the dedicated stack pointer is changed to C
By giving the stack register from outside the PU, the stack register can be relocatable and the address arrangement of the microcomputer can be easily dealt with.

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

【図1】本発明の実施例によるマイクロコンピュータの
構成を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of a microcomputer according to an embodiment of the present invention.

【図2】本実施例のマイクロコンピュータのシステムコ
ントロールレジスタの構成図である
FIG. 2 is a configuration diagram of a system control register of the microcomputer of the present embodiment.

【図3】本実施例のマイクロコンピュータに用いられる
CPUの命令フォーマットの構成図である。
FIG. 3 is a configuration diagram of an instruction format of a CPU used in the microcomputer of this embodiment.

【図4】本実施例のマイクロコンピュータに用いられる
CPUと乗算器を示すブロック図である。
FIG. 4 is a block diagram showing a CPU and a multiplier used in the microcomputer of this embodiment.

【図5】本実施例のマイクロコンピュータにおける制御
レジスタの1ビットの構成図である。
FIG. 5 is a configuration diagram of 1 bit of a control register in the microcomputer of the present embodiment.

【図6】本実施例のマイクロコンピュータにおける制御
信号の設定方法の一例を示すブロックである。
FIG. 6 is a block diagram showing an example of a method of setting a control signal in the microcomputer of this embodiment.

【図7】本実施例のマイクロコンピュータにおける制御
信号の設定方法の一例を示す概略図である。
FIG. 7 is a schematic diagram showing an example of a control signal setting method in the microcomputer of the present embodiment.

【図8】本実施例のマイクロコンピュータに用いられる
CPUのレジスタの構成図である。
FIG. 8 is a configuration diagram of a register of a CPU used in the microcomputer of this embodiment.

【図9】本実施例のマイクロコンピュータに用いられる
CPUのレジスタの構成図である。
FIG. 9 is a configuration diagram of a register of a CPU used in the microcomputer of the present embodiment.

【図10】本実施例のマイクロコンピュータに用いられ
るCPUのレジスタの使用方法を説明するフロック図で
ある。
FIG. 10 is a flock diagram illustrating a method of using a register of a CPU used in the microcomputer of this embodiment.

【図11】本実施例のマイクロコンピュータに用いられ
るCPUのレジスタのスタックの状態の説明図である。
FIG. 11 is an explanatory diagram of a state of a register stack of a CPU used in the microcomputer of this embodiment.

【図12】本実施例のマイクロコンピュータに用いられ
るCPUの基本動作のタイミング図である。
FIG. 12 is a timing chart of the basic operation of the CPU used in the microcomputer of this embodiment.

【図13】本実施例のマイクロコンピュータに用いられ
るCPUの基本動作のタイミング図である。
FIG. 13 is a timing chart of the basic operation of the CPU used in the microcomputer of this embodiment.

【図14】本実施例のマイクロコンピュータに用いられ
る乗算器の構成を示すブロック図である。
FIG. 14 is a block diagram showing the configuration of a multiplier used in the microcomputer of this embodiment.

【図15】本実施例のマイクロコンピュータに用いられ
る乗算器による演算方法の説明図である。
FIG. 15 is an explanatory diagram of a calculation method by a multiplier used in the microcomputer of this embodiment.

【図16】本実施例のマイクロコンピュータに用いられ
る乗算器のフラグの実現方法の説明図である。
FIG. 16 is an explanatory diagram of a method of realizing a flag of a multiplier used in the microcomputer of this embodiment.

【図17】本実施例のマイクロコンピュータに用いられ
る乗算器のフラグの実現方法の説明図である。
FIG. 17 is an explanatory diagram of a method of realizing a flag of a multiplier used in the microcomputer of this embodiment.

【図18】本実施例のマイクロコンピュータに用いられ
るバススイッチの構成を示すブロック図である。
FIG. 18 is a block diagram showing the configuration of a bus switch used in the microcomputer of this embodiment.

【図19】本実施例のマイクロコンピュータにおけるM
AC命令の動作のタイミング図である。
FIG. 19 shows an M in the microcomputer of this embodiment.
FIG. 7 is a timing diagram of the operation of an AC instruction.

【図20】図19に連続する動作のタイミング図であ
る。
FIG. 20 is a timing chart of the operations subsequent to FIG.

【図21】本実施例のマイクロコンピュータにおけるS
TMAC命令およびLDMAC命令の動作のタイミング
図である。
FIG. 21 shows S in the microcomputer of the present embodiment.
FIG. 7 is a timing diagram of the operation of the TMAC instruction and the LDMAC instruction.

【図22】図21に連続する動作のタイミング図であ
る。
FIG. 22 is a timing chart of the operations subsequent to FIG. 21.

【図23】本実施例のマイクロコンピュータにおいて乗
算器を用いた場合の乗算命令の動作のタイミング図であ
る。
FIG. 23 is a timing chart of the operation of a multiplication instruction when a multiplier is used in the microcomputer of this embodiment.

【図24】図19に連続する動作のタイミング図であ
る。
FIG. 24 is a timing chart of the operations subsequent to FIG.

【図25】本実施例のマイクロコンピュータにおいて乗
算器を用いない場合の乗算命令の動作のタイミング図で
ある。
FIG. 25 is a timing chart of the operation of a multiplication instruction when no multiplier is used in the microcomputer of this embodiment.

【図26】図25に連続する動作のタイミング図であ
る。
FIG. 26 is a timing chart of the operations subsequent to FIG. 25.

【図27】本実施例のマイクロコンピュータにおける乗
算命令の状態遷移図である。
FIG. 27 is a state transition diagram of a multiplication instruction in the microcomputer of the present embodiment.

【図28】本実施例のマイクロコンピュータに用いられ
る演算器の構成を示すブロック図である。
FIG. 28 is a block diagram showing the configuration of an arithmetic unit used in the microcomputer of this embodiment.

【図29】本実施例のマイクロコンピュータにおける複
数レジスタの退避命令の実行シーケンス図である。
FIG. 29 is an execution sequence diagram of save instructions for a plurality of registers in the microcomputer of the present embodiment.

【図30】図29に連続する動作のタイミング図であ
る。
FIG. 30 is a timing chart of the operations subsequent to FIG. 29.

【図31】本実施例のマイクロコンピュータにおける複
数レジスタの復帰命令の実行シーケンス図である。
FIG. 31 is an execution sequence diagram of a restore instruction for a plurality of registers in the microcomputer of this embodiment.

【図32】図31に連続する動作のタイミング図であ
る。
FIG. 32 is a timing chart of the operations subsequent to FIG. 31.

【図33】本実施例のマイクロコンピュータにおけるR
SEL2入力制御回路の構成を示すブロック図である。
FIG. 33 shows R in the microcomputer of the present embodiment.
It is a block diagram which shows the structure of a SEL2 input control circuit.

【図34】図33の動作の説明図である。FIG. 34 is an explanatory diagram of the operation of FIG. 33.

【図35】本実施例のマイクロコンピュータに適用され
るC言語による変換リストの概略例である。
FIG. 35 is a schematic example of a conversion list in C language applied to the microcomputer of this embodiment.

【図36】本実施例のマイクロコンピュータに適用され
るC言語による変換リストの概略例である。
FIG. 36 is a schematic example of a conversion list in C language applied to the microcomputer of this embodiment.

【図37】本実施例のマイクロコンピュータにおける割
込例外処理の実行シーケンス図である。
FIG. 37 is an execution sequence diagram of interrupt exception handling in the microcomputer of this embodiment.

【図38】図37に連続する動作のタイミング図であ
る。
FIG. 38 is a timing chart of the operations subsequent to FIG. 37.

【図39】本実施例のマイクロコンピュータにおける例
外処理の状態遷移図である。
FIG. 39 is a state transition diagram of exception processing in the microcomputer of the present embodiment.

【図40】本実施例のマイクロコンピュータにおける例
外処理後のスタックの状態の説明図である。
FIG. 40 is an explanatory diagram of a state of the stack after exception processing in the microcomputer of the present embodiment.

【図41】本実施例のマイクロコンピュータにおける例
外処理後のスタックの状態の説明図である。
FIG. 41 is an explanatory diagram of the state of the stack after exception processing in the microcomputer of this embodiment.

【図42】本実施例のマイクロコンピュータにおけるR
TE命令の実行シーケンス図である。
FIG. 42 shows R in the microcomputer of the present embodiment.
It is an execution sequence diagram of a TE instruction.

【図43】本実施例のマイクロコンピュータにおける例
外処理の状態遷移図である。
FIG. 43 is a state transition diagram of exception processing in the microcomputer of the present embodiment.

【図44】本実施例のマイクロコンピュータにおける制
御回路の構成の説明図である。
FIG. 44 is an explanatory diagram of a configuration of a control circuit in the microcomputer of the present embodiment.

【図45】本実施例のマイクロコンピュータにおける制
御レジスタの構成図である。
FIG. 45 is a configuration diagram of a control register in the microcomputer of the present embodiment.

【図46】本実施例のマイクロコンピュータにおける制
御レジスタの構成図である。
FIG. 46 is a configuration diagram of a control register in the microcomputer of the present embodiment.

【図47】本実施例のマイクロコンピュータにおける制
御レジスタの構成図である。
FIG. 47 is a configuration diagram of a control register in the microcomputer of the present embodiment.

【図48】本実施例のマイクロコンピュータにおける制
御レジスタの構成図である。
FIG. 48 is a configuration diagram of a control register in the microcomputer of the present embodiment.

【図49】本実施例のマイクロコンピュータにおける制
御レジスタの構成図である。
FIG. 49 is a configuration diagram of a control register in the microcomputer of the present embodiment.

【図50】本実施例のマイクロコンピュータにおけるエ
ミュレーションスタックポインタの構成の説明図であ
る。
FIG. 50 is an explanatory diagram of a configuration of an emulation stack pointer in the microcomputer of this embodiment.

【図51】本実施例のマイクロコンピュータにおけるブ
レーク割込みシーケンスの実行タイミング図である。
FIG. 51 is an execution timing chart of a break interrupt sequence in the microcomputer of the present embodiment.

【図52】本実施例のマイクロコンピュータにおけるブ
レーク制御処理の回路構成図である。
52 is a circuit configuration diagram of break control processing in the microcomputer of the present embodiment. FIG.

【符号の説明】[Explanation of symbols]

1…CPU、2…乗算器、3…システムコントローラ
(SYSC)、4…割込コントローラ(INT)、5…
ROM、6…RAM、9…シリアルコミュニケーション
インターフェース(SCI)、13…システムコントロ
ールレジスタ(SYSCR)、14…制御レジスタ(C
PUCR)、21…命令レジスタ(IR)、22…命令
デコーダ・制御回路(CONT)、23…レジスタセレ
クタ(RSEL)、24…ライトデータバッファ(DB
W)、25…リードデータバッファ(DBR)、26、
27…演算器、29…エミュレータスタックポインタ
(EMLSP)、30…プログラムカウンタ(PC)、
31…コンディションレジスタ(CCR)、32…拡張
レジスタ(EXR)、33…アドレスバッファ(MA
B)、34…バススイッチ、38…エミュレーション用
プロセッサ、39…エミュレーション用インタフェー
ス、44…インタフェースケーブル、48…エミュレー
ションメモリ、49…ブレーク制御回路、50…リアル
タイムトレース回路、58…CMOSインバータ回路、
65A〜65C…デコーダ、66A〜66C、71A、
71B、77…選択回路、67…加算器、72A〜72
C…拡張回路、76…算術論理演算回路、78…シフト
回路、79…制御回路、75A、75B、81A〜81
G、86A〜86D…アンド回路、80A、80B、8
2A〜82D…オア回路、83…フリップフロップ。
1 ... CPU, 2 ... Multiplier, 3 ... System controller (SYSC), 4 ... Interrupt controller (INT), 5 ...
ROM, 6 ... RAM, 9 ... Serial communication interface (SCI), 13 ... System control register (SYSCR), 14 ... Control register (C
PUCR), 21 ... Instruction register (IR), 22 ... Instruction decoder / control circuit (CONT), 23 ... Register selector (RSEL), 24 ... Write data buffer (DB)
W), 25 ... Read data buffer (DBR), 26,
27 ... Arithmetic unit, 29 ... Emulator stack pointer (EMLSP), 30 ... Program counter (PC),
31 ... Condition register (CCR), 32 ... Extension register (EXR), 33 ... Address buffer (MA
B), 34 ... Bus switch, 38 ... Emulation processor, 39 ... Emulation interface, 44 ... Interface cable, 48 ... Emulation memory, 49 ... Break control circuit, 50 ... Real-time trace circuit, 58 ... CMOS inverter circuit,
65A-65C ... Decoder, 66A-66C, 71A,
71B, 77 ... Selection circuit, 67 ... Adder, 72A to 72
C ... Expansion circuit, 76 ... Arithmetic logic operation circuit, 78 ... Shift circuit, 79 ... Control circuit, 75A, 75B, 81A to 81
G, 86A to 86D ... AND circuit, 80A, 80B, 8
2A to 82D ... OR circuit, 83 ... Flip-flop.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 梶原 久志 茨城県日立市幸町3丁目2番1号 日立エ ンジニアリング株式会社内 (72)発明者 宇枝 晋 茨城県日立市幸町3丁目2番1号 日立エ ンジニアリング株式会社内 ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Hisashi Kajiwara 3-2-1, Sachimachi Hitachi City, Ibaraki Prefecture Hitachi Engineering Co., Ltd. (72) Inventor Shin Ueda 3-2, Saiwaicho, Hitachi City No. 1 within Hitachi Engineering Co., Ltd.

Claims (18)

【特許請求の範囲】[Claims] 【請求項1】 所定の命令を順次実行するデータ処理装
置であって、前記命令を実行する実行手段を制御する制
御手段と乗算手段を設け、前記制御手段と乗算手段とが
並列動作する第1の命令とともに、前記乗算手段が動作
する第2の命令を有することを特徴とするデータ処理装
置。
1. A data processing device for sequentially executing predetermined instructions, comprising control means and multiplication means for controlling execution means for executing the instructions, wherein the control means and multiplication means operate in parallel. And a second instruction for operating the multiplying means, in addition to the instruction of 1.
【請求項2】 前記第2の命令が第1の命令と同期して
いることを特徴とする請求項2に記載のデータ処理装
置。
2. The data processing device according to claim 2, wherein the second instruction is synchronized with the first instruction.
【請求項3】 前記第1の命令は積和命令であるととも
に、前記第2の命令は乗算命令であることを特徴とする
請求項1または2に記載のデータ処理装置。
3. The data processing apparatus according to claim 1, wherein the first instruction is a product-sum instruction and the second instruction is a multiplication instruction.
【請求項4】 前記乗算手段は前記制御手段に内蔵され
ていることを特徴とする請求項1乃至3のいずれか1項
に記載のデータ処理装置。
4. The data processing apparatus according to claim 1, wherein the multiplying unit is built in the control unit.
【請求項5】 前記乗算手段は前記制御手段から独立し
て設けられていることを特徴とする請求項1乃至3のい
ずれか1項に記載のデータ処理装置。
5. The data processing apparatus according to claim 1, wherein the multiplication unit is provided independently of the control unit.
【請求項6】 前記制御手段は乗算機能を備えているこ
とを特徴とする請求項5に記載のデータ処理装置。
6. The data processing apparatus according to claim 5, wherein the control means has a multiplication function.
【請求項7】 前記乗算手段の動作の有効/無効を指定
できる手段を有することを特徴とする請求項1乃至6の
いずれか1項に記載のデータ処理装置。
7. The data processing apparatus according to claim 1, further comprising a unit capable of designating valid / invalid of an operation of the multiplying unit.
【請求項8】 前記乗算手段の動作の有効/無効を指定
できる手段をテストモードで設定することを特徴とする
請求項7に記載のデータ処理装置。
8. The data processing apparatus according to claim 7, wherein means for designating validity / invalidity of the operation of the multiplying means is set in a test mode.
【請求項9】 前記乗算手段の動作の有効/無効を指定
できる手段をエミュレーションモードで設定することを
特徴とする請求項7に記載のデータ処理装置。
9. The data processing apparatus according to claim 7, wherein means for designating valid / invalid of the operation of the multiplying means is set in an emulation mode.
【請求項10】 前記乗算手段の動作の有効/無効を指
定できる手段がレジスタからなり、このレジスタはエミ
ュレータに搭載されて、エミュレータの指定に基づいて
設定することを特徴とする請求項9に記載のデータ処理
装置。
10. The means for designating validity / invalidity of the operation of the multiplying means comprises a register, and the register is mounted on an emulator and is set based on the designation of the emulator. Data processing equipment.
【請求項11】 前記乗算手段の1ステップ動作の実行
を指定する手段を有することを特徴とする請求項を1乃
至10に記載のデータ処理装置。
11. A data processing apparatus according to claim 1, further comprising means for designating execution of one-step operation of said multiplication means.
【請求項12】 前記乗算手段の1ステップ動作の実行
を指定する手段をテストモードで設定することを特徴と
する請求項11に記載のデータ処理装置。
12. The data processing apparatus according to claim 11, wherein the means for designating the execution of the one-step operation of the multiplying means is set in a test mode.
【請求項13】 所定の命令を順次実行するデータ処理
装置であって、前記命令を実行する実行手段を制御する
制御手段に指定可能な複数のレジスタの組み合わせを固
定にし、複数のレジスタの退避/復帰命令を有すること
を特徴とするデータ処理装置。
13. A data processing device for sequentially executing a predetermined instruction, wherein a combination of a plurality of registers which can be designated by a control means for controlling an execution means for executing the instruction is fixed, and saving / saving of the plurality of registers is performed. A data processing device having a return instruction.
【請求項14】 所定の命令を順次実行するデータ処理
装置であって、前記命令を実行する実行手段を制御する
制御手段に搭載されるコントロールレジスタの有効/無
効を切り換える手段を有することを特徴とするデータ処
理装置。
14. A data processing device for sequentially executing predetermined instructions, comprising means for switching between valid / invalid of a control register mounted in control means for controlling execution means for executing the instructions. Data processing device.
【請求項15】前記コントロールレジスタの有効時に
は、例外処理の遷移時、例外処理からの復帰時に、前記
コントロールレジスタの待避/復帰を行い、前記コント
ロールレジスタの無効時には、例外処理の遷移時、例外
処理からの復帰時に、前記コントロールレジスタの待避
/復帰を行わないことを特徴とする請求項14に記載の
データ処理装置。
15. The control register is saved / restored when the control register is valid, at the time of transition of exception processing and at the time of returning from the exception processing, and when the control register is invalid, at the time of transition of exception processing, exception processing. 15. The data processing device according to claim 14, wherein the saving / restoring of the control register is not performed at the time of restoration from.
【請求項16】 前記コントロールレジスタの有効時に
は、このコントロールレジスタの設定値が有効であり、
前記コントロールレジスタの無効時には、このコントロ
ールレジスタの設定値が無視されることを特徴とする請
求項15に記載のデータ処理装置。
16. The setting value of the control register is valid when the control register is valid,
16. The data processing device according to claim 15, wherein the set value of the control register is ignored when the control register is invalid.
【請求項17】 所定の命令を順次実行するデータ処理
装置であって、前記命令を実行する実行手段を制御する
制御手段の搭載される固定的なスタックレジスタを設
け、エミュレーションプログラムへの遷移時、エミュレ
ーションプログラムからの復帰時に、前記固定的なスタ
ックレジスタを用いて、ユーザが使用するスタックポイ
ンタを無視あるいは保持する手段を有することを特徴と
するデータ処理装置。
17. A data processing device for sequentially executing a predetermined instruction, wherein a fixed stack register equipped with a control means for controlling an execution means for executing the instruction is provided, and a transition to an emulation program is performed. A data processing device comprising means for ignoring or holding a stack pointer used by a user by using the fixed stack register when returning from an emulation program.
【請求項18】 前記エミュレーションプログラム実行
状態での、エミュレーション遷移割り込みを禁止する手
段を有することを特徴とする請求項17に記載のデータ
処理装置
18. The data processing apparatus according to claim 17, further comprising means for prohibiting an emulation transition interrupt in the emulation program execution state.
JP7060797A 1995-03-20 1995-03-20 Data processor Withdrawn JPH08263290A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7060797A JPH08263290A (en) 1995-03-20 1995-03-20 Data processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7060797A JPH08263290A (en) 1995-03-20 1995-03-20 Data processor

Related Child Applications (2)

Application Number Title Priority Date Filing Date
JP2004161157A Division JP2004295914A (en) 2004-05-31 2004-05-31 Data processor
JP2004213952A Division JP3759742B2 (en) 2004-07-22 2004-07-22 Data processing device

Publications (1)

Publication Number Publication Date
JPH08263290A true JPH08263290A (en) 1996-10-11

Family

ID=13152672

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7060797A Withdrawn JPH08263290A (en) 1995-03-20 1995-03-20 Data processor

Country Status (1)

Country Link
JP (1) JPH08263290A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6745320B1 (en) 1999-04-30 2004-06-01 Renesas Technology Corp. Data processing apparatus
US7376819B2 (en) 2002-06-28 2008-05-20 Renesas Technology Corp. Data processor with selectable word length

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6745320B1 (en) 1999-04-30 2004-06-01 Renesas Technology Corp. Data processing apparatus
US7376819B2 (en) 2002-06-28 2008-05-20 Renesas Technology Corp. Data processor with selectable word length

Similar Documents

Publication Publication Date Title
US8918627B2 (en) Multithreaded processor with multiple concurrent pipelines per thread
US6560697B2 (en) Data processor having repeat instruction processing using executed instruction number counter
EP0901071B1 (en) Methods for interfacing a processor to a coprocessor
JPH09311786A (en) Data processor
JP2001202243A (en) Data processor
US5815420A (en) Microprocessor arithmetic logic unit using multiple number representations
JP3578883B2 (en) Data processing device
JP4073721B2 (en) Data processing device
JPH1165839A (en) Instruction control mechanism of processor
US6055628A (en) Microprocessor with a nestable delayed branch instruction without branch related pipeline interlocks
JPS6014338A (en) Branch mechanism for computer system
JP3479385B2 (en) Information processing device
US6078940A (en) Microprocessor with an instruction for multiply and left shift with saturate
JP4800582B2 (en) Arithmetic processing unit
JPH096614A (en) Data processor
JPH08263290A (en) Data processor
JP3851008B2 (en) Processor, semiconductor integrated circuit having the same, processing apparatus, and instruction processing method
JP3759742B2 (en) Data processing device
JP3839835B2 (en) Data processing apparatus and microcomputer
US5784634A (en) Pipelined CPU with instruction fetch, execution and write back stages
JP3520372B2 (en) Elimination of critical path in operation of memory control unit and input / output control unit
JP3740321B2 (en) Data processing device
JP2004295914A (en) Data processor
JP3547585B2 (en) Microprocessor having conditional execution instruction
JP4382076B2 (en) Data processing device

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040309

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040330

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040531

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20040622

A761 Written withdrawal of application

Free format text: JAPANESE INTERMEDIATE CODE: A761

Effective date: 20040723