[go: up one dir, main page]

JP2004295914A - Data processing device - Google Patents

Data processing device Download PDF

Info

Publication number
JP2004295914A
JP2004295914A JP2004161157A JP2004161157A JP2004295914A JP 2004295914 A JP2004295914 A JP 2004295914A JP 2004161157 A JP2004161157 A JP 2004161157A JP 2004161157 A JP2004161157 A JP 2004161157A JP 2004295914 A JP2004295914 A JP 2004295914A
Authority
JP
Japan
Prior art keywords
register
instruction
signal
bit
cpu
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.)
Pending
Application number
JP2004161157A
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.)
Renesas Technology Corp
Hitachi Industry and Control Solutions Co Ltd
Original Assignee
Renesas Technology Corp
Hitachi Engineering Co 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 Renesas Technology Corp, Hitachi Engineering Co Ltd filed Critical Renesas Technology Corp
Priority to JP2004161157A priority Critical patent/JP2004295914A/en
Publication of JP2004295914A publication Critical patent/JP2004295914A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Executing Machine-Instructions (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a technology for obtaining exception handling performance corresponding to needs while maintaining compatibility and moreover reducing a logical scale. <P>SOLUTION: A combination of a plurality of assignable registers out of general-purpose registers is fixed to a control means (a CPU) for controlling an execution means for carrying out instructions, to have save/return instructions (STM instruction and LDM instruction) of the plurality of registers. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、データ処理装置に関し、特に、半導体集積回路装置によって構成される高速かつ小型のシングルチップマイクロコンピュータに利用して有効な技術に関するものである。   The present invention relates to a data processing device, and more particularly to a technology effective when used in a high-speed and small-sized single-chip microcomputer constituted by a semiconductor integrated circuit device.

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

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

このため、オブジェクトレベルで互換性を保ちつつ、アドレス空間の拡張や、命令セットの拡大、高速化等を実現した例として、例えば本出願人が先に提案した特許文献1、あるいは非特許文献1等がある。   For this reason, as an example of realizing expansion of an address space, expansion of an instruction set, speeding-up, etc. while maintaining compatibility at the object level, for example, Patent Document 1 proposed earlier by the present applicant or Non-Patent Document 1 Etc.

前記CPUは、システムクロックの2周期である、いわゆる2ステートで基本命令を実行している。これに対して、1ステートで基本命令を実行するようにし、さらに、CPUとは独立して乗算器を内蔵して高速化を図った例として、例えば非特許文献2、あるいは非特許文献3等がある。このような乗算器は積和演算と乗算に利用する。   The CPU executes a basic instruction in so-called two states, which are two periods of a 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, Non-Patent Document 2 or Non-Patent Document 3 There is. Such a multiplier is used for the product-sum operation and the multiplication.

このように高速化を図ることによって、マイクロコンピュータによって制御される各種機器の高速化や高性能化、あるいは、従来においては複数の半導体集積回路装置で構成していたものを、結合したりすることにより小型化を図ることができるようになる。   By increasing the speed in this way, it is possible to increase the speed and performance of various devices controlled by the microcomputer, or to combine components conventionally constituted by a plurality of semiconductor integrated circuit devices. Thereby, miniaturization can be achieved.

また、前記のような各種機器の高速化や高性能化、あるいは小型化は、アドレス空間が比較的小さく、命令セットが比較的小さいCPUあるいはマイクロコンピュータにおいても要求されるから、前記特許文献1等に記載されるアドレス空間の広いCPUと、アドレス空間の小さいCPUが存在する場合には、その双方の高速化を図ることが望ましい。   In addition, high speed, high performance, and miniaturization of various devices as described above are also required for a CPU or a microcomputer having a relatively small address space and a relatively small instruction set. When there are a CPU having a large address space and a CPU having a small address space, it is desirable to speed up both of them.

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

特開平6−51981号公報JP-A-6-51981

平成5年6月(株)日立製作所発行、「H8/300Hシリーズプログラミングマニュアル」"H8 / 300H Series Programming Manual" issued by Hitachi, Ltd. in June 1993 平成4年11月日経BP社発行、「日経エレクトロニクスNO.568」、PP99〜PP112Published by Nikkei BP, November 1992, "Nikkei Electronics No. 568", PP99-PP112 平成5年3月(株)日立製作所発行、「SH7032、SH7034 ハードウエアマニュアル」Published by Hitachi, Ltd. in March 1993, "SH7032, SH7034 Hardware Manual"

前記のようなマイクロコンピュータにおいて、乗算器は専用の資源を必要とするから、必ずしも積和演算や乗算の高速化を必要としない場合には、費用対効果の点で得策でない。また、例えば前記非特許文献3においては、乗算結果は専用のレジスタ(MAC)に得られるから、これを利用する場合には、別の命令によってそれをCPUの汎用レジスタに転送しなければならない。乗算器を内蔵して乗算自体を高速化しても、そのように乗算結果を使用するまでの時間が長くなっては意味がない。   In such a microcomputer, since the multiplier requires a dedicated resource, it is not advisable in terms of cost-effectiveness if the product-sum operation or the multiplication is not necessarily required to be performed at high speed. Further, for example, in Non-Patent Document 3, since the multiplication result is obtained in a dedicated register (MAC), if this is used, it must be transferred to a general-purpose register of the CPU by another instruction. Even if the multiplication itself is speeded up by incorporating a multiplier, there is no point in increasing the time required to use the multiplication result.

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

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

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

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

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

本願において開示される発明のうち代表的なものの概要を簡単に説明すれば下記の通りである。   The outline of a representative invention among the inventions disclosed in the present application will be briefly described as follows.

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

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

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

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

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

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

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

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

乗算器を削除した場合、乗算は除算と同一のシーケンスで実行できる。積和演算はサポートせず、積和演算の特殊なシーケンスをサポートしないことによって論理規模の縮小を更に行なうことができる。テスト命令をサポートすることによって、論理規模の増加を最低限にして、テストの容易性を向上することができる。   If the multiplier is omitted, the multiplication can be performed in the same sequence as the division. Since the product-sum operation is not supported and the special sequence of the product-sum operation is not supported, the logical scale can be further reduced. By supporting test instructions, testability can be improved with minimal increase in logic size.

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

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

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

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

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

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

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

(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.

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

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

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

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

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

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

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

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

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

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 MD2) is fetched, and the microcomputer is reset. The operation mode set by the mode terminal selects single chip / extension, address space, enable / disable of built-in ROM, and the initial value of the data bus width from 8 bits or 16 bits.

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

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

[表1]

Figure 2004295914
[Table 1]
Figure 2004295914

[表2]

Figure 2004295914
[Table 2]
Figure 2004295914

[表3]

Figure 2004295914
[Table 3]
Figure 2004295914

[表4]

Figure 2004295914
[Table 4]
Figure 2004295914

以下に、表5にCPU1の命令セットを示す。本実施の形態 に用いられるCPU1の命令は合計で71種類ある。表6に命令とアドレッシングモードとの組み合わせを示す。表7に以下の各表に使用される記号(オペレーションの記号)の意味を示す。表8乃至表15に各命令の機能別一覧表を示す。   Table 5 shows an instruction set of the CPU 1. There are a total of 71 instructions of the CPU 1 used in the present embodiment. 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.

[表5]

Figure 2004295914
[Table 5]
Figure 2004295914

[表6]

Figure 2004295914
[Table 6]
Figure 2004295914

[表7]

Figure 2004295914
[Table 7]
Figure 2004295914

[表8]

Figure 2004295914
[Table 8]
Figure 2004295914

[表9]

Figure 2004295914
[Table 9]
Figure 2004295914

[表10]

Figure 2004295914
[Table 10]
Figure 2004295914

[表11]

Figure 2004295914
[Table 11]
Figure 2004295914

[表12]

Figure 2004295914
[Table 12]
Figure 2004295914

[表13]

Figure 2004295914
[Table 13]
Figure 2004295914

[表14]

Figure 2004295914
[Table 14]
Figure 2004295914

[表15]

Figure 2004295914
[Table 15]
Figure 2004295914

基本的な命令は平成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, and employ a so-called load store architecture. The combination of the instruction and the addressing mode can be reduced, and the logical and physical scales of the instruction control of the CPU can be reduced.

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

CPUの命令は、2バイト(ワード)を単位にしている。各命令は下記のようなオペレーションフィールド(op)、レジスタフィールド(r)、EA拡張部(EA)、およびコンディションフィールド(cc)から構成されている。   CPU instructions are in units of 2 bytes (words). Each instruction includes an operation field (op), a register field (r), an EA extension (EA), and a condition field (cc) as described below.

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

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

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

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

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

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

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

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

そのほかのレジスタなどは、φ、φ#の両方でデータを入出力可能である。GB、DB、WBの各バスはφ、φ#の両方で異なったデータを転送可能である。φ、φ#は互いにノーオーバラップの関係の2相クロックとしてもよい。   Other registers can input / output data in both φ and φ #. The GB, DB, and WB buses can transfer different data in both φ and φ #. φ and φ # may be two-phase clocks having a no-overlap relationship with each other.

レジスタセレクタ(RSEL)23には、IR21乃至CONT22から命令コードの一部(レジスタ指定フィールド)が与えられる。この供給タイミングは、レジスタ指定フィールドの位置によって相違される。RSEL23は出力タイミングの相違するレジスタ選択信号A、Bを出力する。   The register selector (RSEL) 23 receives a part of the instruction code (register designation field) from the IR 21 to the CONT 22. 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.

例えば、平成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 instruction code are given simultaneously with CONT 22 (RSEL input 1). ), Bits 11-8 and 3-0 (RSEL input 2) are provided 0.5 state later than the contents of CONT22. An inversion control signal of RSEL input 2 is provided to RSEL.

CPU1内部のDBW24、DBR25、ALU26、INC27、ER0〜ER7(28A〜28H)、PC30、CCR31、VAG、ABは、GBバス、DBバス、WBバスによって相互に接続されている。   The DBW 24, DBR 25, ALU 26, INC 27, ER0 to ER7 (28A to 28H), PC 30, CCR 31, VAG, and AB inside the CPU 1 are interconnected by a GB bus, a DB bus, and a WB bus.

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

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

命令デコーダ・制御回路(CONT)22が、IR21からの入力、CPUS信号、INTM1信号やそのほかの入力信号に基づいて、動作制御を行なう。制御回路の出力は所定のバッファを介して出力される。CONT22自身にも、ステート番号などがフィードバックされる。   An 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.

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

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 a user program and an emulation program when operating on an emulator. In order to specify the contents, some contents are given from outside the CPU.

PC30は32ビットのカウンタであり、CPU1が次に実行する命令のアドレスを示している。コンディションコードレジスタ(CCR)31は割り込みマスクビット(I)、キャリフラグ(C)、ゼロフラグ(Z)、ネガティブフラグ(N)、オーバフローフラグ(V)を含んでいる。   The PC 30 is a 32-bit counter and indicates the address of an instruction to be executed next by the CPU 1. 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).

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

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

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

図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 a 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, an SCI, and the like.

コネクタ部がマイクロコンピュータの代わりに応用システム(ユーザシステム)43に装着される。エミュレーション用プロセッサ38は上記コネクタ部とインタフェースケーブル44を介し、ターゲットシステムインタフェースを用いて上記応用システム43と信号の入出力を行なう。   The connector section is mounted on an 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.

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

一方、エミュレーション用プロセッサ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 state signals and control signals (not shown). Using the emulation bus 47, information and the like corresponding to the internal state of the application system 43 and the emulation processor 38 are output from the emulation processor 38, and various control signals for emulation are sent to the emulation processor 38. Is entered. An emulation mode terminal (not shown) of the emulation processor 38 is fixed at the power supply level, and the emulation mode is set inside the emulation processor 38.

さらに、上記エミュレーションバス47には、特に制限はされないものの、応用システム43またはターゲットマイクロコンピュータ内蔵のメモリを代行するためのRAMでなるようなエミュレーションメモリ48がある。また、エミュレーション用プロセッサ38の制御状態やエミュレーションバス47の状態を監視して、その状態が予め設定された状態に達した時に、上記エミュレータ専用割込みを入力して、CPUによるユーザプログラムの実行を停止させ、エミュレーション用プログラム実行状態に遷移させる(ブレーク)ためのブレーク制御回路49と、上記CPUのリード動作またはライト動作を示す信号、命令リード動作を示す信号などに基づき、エミュレーションバス47に与えられるアドレスデータさらには制御情報を逐次蓄えるリアルタイムトレース回路50などが接続される。   Further, the emulation bus 47 includes, although not particularly limited to, an emulation memory 48 such as a RAM for substituting the built-in memory of the application system 43 or the target microcomputer. Further, the control state of the emulation processor 38 and the state of the emulation bus 47 are monitored, 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 a break control circuit 49 for causing a transition to an emulation program execution state (break), and an address 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 for sequentially storing data and control information is connected.

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

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

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

エミュレーション用プロセッサ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 development efficiency can be improved. Note that the address designation information of the EMLSP 29 can also be designated by a control register in the emulation interface 39.

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

図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 without depending on the register. The CMOS inverter circuit 58 includes a P-channel MOS transistor Q1 and an N-channel MOS transistor Q2. The input of the CMOS inverter circuit 58 is connected to a power supply Vdd via a resistor R and to a terminal P via protection circuits Q3 and Q4. The terminal P is connected to the ground level power supply lead L by a wire W or is set in an open state, and the CPU S is set.

端子Pが解放状態とされれば、CMOSインバータ回路58の入力はハイレベルとなって、CPUS信号は非活性状態になる。一方、端子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 CPUS signal becomes inactive. On the other hand, if the terminal P is connected to the ground level power supply lead L via the wire W, the input of the CMOS inverter circuit 58 becomes low level and the CPUS signal is activated. Enable the multiplier.

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

これにより、半導体集積回路装置のパッケージの端子を直接利用することなく、乗算器の制御を設定できるため、一定のパッケージを用いた場合に、有効な端子数の減少防ぐことができる。この場合、端子Pをグランドレベル電源端子に隣接して配置すると都合がよい。   Thus, since the control of the multiplier can be set without directly using the terminals of the package of the semiconductor integrated circuit device, it is possible to prevent the effective number of terminals from decreasing 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.

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

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

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

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

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 the same function and can use up to 16 8-bit registers.

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

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

(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).

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

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

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

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

ビット6〜4:リザーブビット
リザーブビットである。
Bits 6-4: Reserved bits These are reserved bits.

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

EXRは、LDC、STC、ANDC、ORC、XORC命令で実行することができる。このうち、STCを除く命令を実行した場合、実行終了後3ステートの間は、NMIを含めてすべての割込みは受け付けられない。   EXR can be executed with LDC, STC, ANDC, ORC, and XORC instructions. When instructions other than the STC are executed, all interrupts including the NMI are not accepted for three states after the execution is completed.

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

ビット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 the exception processing is started.

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

ビット5:ハーフキャリフラグ(H)
ADD.B、ADDX.B、SUB.B、SUBX.B、CMP.B、NEG.B命令の実行により、ビット3にキャリまたはボローが生じたとき”1”にセットされ、生じなかったとき”0”にクリアされる。また、ADD.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. The bit 3 is set to “1” when a carry or a borrow occurs in the bit 3 by execution of the B instruction, and cleared to “0” when no carry occurs. ADD. W, SUB. W, CMP. W, NEG. When a carry or borrow occurs in bit 11 due to execution of the ADD. L, SUB. L, CMP. L, NEG. This bit is set to “1” when a carry or borrow occurs in bit 27 due to execution of the L instruction, and cleared to “0” when no carry occurs.

ビット4:ユーザビット(U)
ソフトウェア(LDC、STC、ANDC、ORC、XORC命令)でリート/ライトできる。
Bit 4: User bit (U)
REIT / WRITE can be performed by software (LDC, STC, ANDC, ORC, XORC instructions).

ビット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.

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

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

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

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

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

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

ADD.W R0、R1のようなレジスタ間演算のタイミングである。特に制限はされないものの、内部データバスは16ビットであって、内蔵ROM、RAMのリード/ライトを1ステートでリード/ライト可能とする。   ADD. This is the timing of the operation between registers such as W R0 and R1. Although there is no particular limitation, the internal data bus is 16 bits, and the internal ROM and RAM can be read / written in one state.

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

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

直前の命令の実行が終了すると、最も早く命令の実行が開始される場合には、T2のC1で命令コードがCONT22に入力されて、命令の内容が解読される。解読結果に従って、制御信号を出力して、各部の制御を行なう。命令の一部(レジスタ指定フィールド:RSEL入力信号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 the CONT 22 at C1 of T2, and the contents of the instruction are decoded. According to the decoding result, a control signal is output to control each unit. A part of the instruction (register designation field: RSEL input signal 1) is given to the register selector 23.

レジスタ間演算命令では、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, the contents of the PC are read out to the internal bus GB at C2 of T2 and input to the MAB 33 and the INC 27. The address IAB is output from the MAB 33. 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 provided to the register selector 23.

T3から、次の次の命令がリードされる。T3のC1で、INC27でインクリメント(+2)された結果が、内部バスWBを経由して、PC30にライトされる。RSEL入力信号2と制御信号B(WB−Rd入力)とに基づいて、レジスタ選択信号Cが生成される。レジスタ選択信号Bがレジスタを選択して、ソース側、デスティネーション側のレジスタ(S、D)のデータをALU26に入力する。ALU26の演算内容はCONT22が制御信号Cによって指示する。加減算・論理演算・シフトなどは1クロックで演算を行なうことができる。例えば、上記命令では16ビットの加算を行なう。次の命令のCONT22へのロードを指示する。RSEL入力信号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 PC 30 via internal bus WB. A register selection signal C is generated based on the RSEL input signal 2 and the control signal B (WB-Rd input). The register selection signal B selects the register, and inputs the data of the source-side and destination-side registers (S, D) to the ALU 26. The contents of the operation of the ALU 26 are specified by the control signal C by the CONT 22. Operations such as addition, subtraction, logical operation, and shift can be performed in one clock. For example, the above instruction performs 16-bit addition. Instructs loading of the next instruction into CONT22. A register selection signal C is generated based on the RSEL input signal 2 and the control signal B (WB-Rd input).

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

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

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

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

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

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

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 out to the internal bus GB and output to the address IAB via the MAB 33. The RSEL input signal 2 is 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).

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

T3のC2で、PC30の内容を内部バスGBに読み出して、MAB33とINC27に入力する。MAB33からアドレスIABが出力される。RSEL入力信号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 the INC 27. The address IAB is output from the MAB 33. The register selection signal B is generated based on the RSEL input signal 1 and the control signal A (Rd-GB output).

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

T4のC1で、INC27でインクリメント(+2)された結果が、内部バスWBを経由して、PC30にライトされる。レジスタ選択信号Bがレジスタを選択して、データレジスタ(D)のデータをALU26に入力する。ALU26の演算内容はCONT22が制御信号Cによって指示する。転送の場合はデータのチェックのみを行なう。次の命令のCONT22へのロードを指示する。   At C1 of T4, the result incremented (+2) by INC27 is written to PC 30 via internal bus WB. The register selection signal B selects the register, and inputs the data of the data register (D) to the ALU 26. The contents of the operation of the ALU 26 are specified by the control signal C by the CONT 22. In the case of transfer, only data check is performed. Instructs loading of the next instruction into CONT22.

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

RSELに入力するタイミングを、RSEL入力1(アドレスレジスタ、ソースレジスタ)とRSEL入力2(データレジスタ、ディスティネーションレジスタ)のように、レジスタ指定フィールド毎にことなったタイミング(φ同期とφ#同期)とすることにより、命令実行の高速化を実現することができる。   The timing of input to the RSEL is different from the timing of each register specification field (φ synchronization and φ # synchronization), such as RSEL input 1 (address register, source register) and RSEL input 2 (data register, destination register). By doing so, high-speed instruction execution can be realized.

表16乃至表19に、本発明に関係のある命令の説明を示す。   Tables 16 to 19 show descriptions of instructions related to the present invention.

表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.

[表16]

Figure 2004295914
[Table 16]
Figure 2004295914

[表17]

Figure 2004295914
[Table 17]
Figure 2004295914

[表18]

Figure 2004295914
[Table 18]
Figure 2004295914

[表19]

Figure 2004295914
[Table 19]
Figure 2004295914

積和演算を行なうMAC命令、MACレジスタをクリアするCLRMAC命令、汎用レジスタの内容をMACレジスタに転送するLDMAC命令、MACレジスタの内容を汎用レジスタに転送するSTMAC命令がある。   There are a MAC instruction for performing a sum-of-products 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.

また、汎用レジスタの待避/復帰命令には、1本のレジスタの待避/復帰命令に、PUSH、POP命令が、複数レジスタの待避/復帰命令にSTM/LDM命令がある。STM/LDM命令には、指定するレジスタ本数に対応して3種類がある。   The save / restore instructions for general-purpose registers include PUSH and POP instructions for save / restore instructions for one register, and the STM / LDM instructions for save / restore instructions for multiple registers. There are three types of STM / LDM instructions corresponding to the number of designated registers.

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

乗算器2は、入力ラッチ(X)61、入力ラッチ(Y)62、部分積生成回路63、マツチプレクサ64、デコーダ65A、65B、65C、選択回路66A、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 matching multiplexer 64, decoders 65A, 65B, 65C, selection circuits 66A, 66B, 66C, an adder 67, and a feedback circuit 68. , A multiplication result register 69 and the like.

乗算器2は16×16ビットの乗算を行なうことを基本動作とし、さらに、これを利用して、16×16ビット+42ビットの積和演算を可能としている。   The basic operation of the multiplier 2 is to perform 16 × 16-bit multiplication, and by using this, a product-sum operation of 16 × 16 bits + 42 bits can be performed.

乗算器は乗算動作は、2次のブースのデコードを用いて、16ビット×6ビットを3回行なうようにされる。   The multiplier performs a 16-bit × 6-bit multiplication operation three times using a second-order Booth decoding.

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 ^ 2j. i = 1 to 15, j = 0 to 7, and y [0] = 0.

被乗数Xとの乗算は、X・Y=Σ(y[2j]+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[2j+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)で得る。   The multiplication with the multiplicand X is XY = Σ (y [2j] + y [2j + 1] −2 · y [2j + 2]) · X · 2 ^ 2j. There are five types of y [2j] + y [2j + 1] −2 · y [2j + 2] depending on the combination of the values of y [2j], y [2j + 1], and y [2j + 2]. , Partial products (y [2j] + y [2j + 1] −2 · y [2j + 2]) · X are of five types: 0, ± X, ± 2X. Of these, 0 and X are obtained immediately. 2X is one bit left shift (the least significant bit is 0), -X is a two's complement, and is obtained by logical inversion +1. -2X is obtained by shifting the logical inversion +1 by one bit to the left (the least significant bit is 0).

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

一方、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 [2j], y [2j + 1], y [2j + 2] of the Y input are decoded to determine 0, ± 1, ± 2, and the partial product selection circuits 66A to 66C are controlled based on the result. Then, the five types of partial products are selected. Three types of selection are performed at a time in units of two bits. This is added by the adder 67. The addition is performed by adding 17-bit partial products shifted by 2 bits each to obtain a result of 22 bits. Insufficient upper bits are sign-extended data.

この内、下位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, which are the outputs of the partial product selection circuits 66A to 66C obtained in the same manner and are shifted by 2 bits each, and the upper 16 bits of the first processing are added. The result for 22 bits is obtained. Insufficient upper bits are sign-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.

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

積和演算の場合は、前回の結果が同時に加算されるようにする。   In the case of a product-sum operation, the previous results are added simultaneously.

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

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

図15に、上記のワードサイズ乗算(16ビット×16ビット)の演算方法を示す。   FIG. 15 shows an operation method of the word size multiplication (16 bits × 16 bits).

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

図4において、CPU1から乗算器2に、乗算を示す信号として、MUL信号(制御信号B)、符号付き/無しを示す信号としてUNSINP信号(制御信号B)、バイト/ワードサイズを示す信号として、BYTE信号(制御信号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)、乗算結果の転送信号として、MULRD信号(制御信号C)を与える。   In FIG. 4, the MUL signal (control signal B) as a signal indicating multiplication, the UNSINP signal (control signal B) as a signal indicating signed / non-signed, and a signal indicating byte / word size from the CPU 1 to the multiplier 2 BYTE signal (control signal B), MAC signal (control signal B) as a start signal of the product-sum operation, STMACH signal (control signal C) as a data transfer request signal from MACH to CPU, data transfer from MACL to CPU As a request signal, a STMACL signal (control signal C), as a data transfer request signal from the CPU to the MACH, an LDMACH signal (control signal B), as a data transfer request signal from the CPU to the MACL, an LDMACL signal (control signal B), As a clear signal of the MAC register, a CLRMAC signal (control signal B), a transfer signal of a multiplier To, STX signal (control signal B), as multiplicand transfer signal, STY signal (control signal B), as the transfer signal of the multiplication result, give MULRD signal (control signal C).

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

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

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

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

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

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

[表20]

Figure 2004295914
[Table 20]
Figure 2004295914

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

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

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

乗算器からCCRへの転送は、STMAC実行時に行われる。   The transfer from the multiplier to the CCR is performed when STMAC is executed.

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

2.Nフラグ、Zフラグ
MUL命令用N、ZフラグとMAC命令用N、Zフラグを別々に設けて出力する。
2. N flag and 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.

乗算器からCCRへの転送は、乗算(MUL)命令の場合、乗算結果の転送時、MAC命令の場合STMAC実行時に行われる。   The transfer from the multiplier to the CCR is performed at the time of transfer of the multiplication result in the case of a multiplication (MUL) instruction, and at the time of execution of STMAC in the case of a MAC instruction.

なお、NフラグとZフラグは、LDMAC/CLRMACによって変化しない。   Note that the N flag and the Z flag are not changed by LDMAC / CLRMAC.

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

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

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

MAC命令とその他の命令は並列して動作する。MAC命令のフラグを随時CCRに反映しては、並列実行中の命令のフラグ動作と矛盾してしまう。MAC命令のフラグを乗算器内部で保持して、STMAC命令実行時にCCRに転送するようにして、上記矛盾を回避することができる。   The MAC instruction and other instructions operate in parallel. If the flag of the MAC instruction is reflected in the CCR as needed, it contradicts the flag operation of the instruction being executed in parallel. The contradiction can be avoided by holding the flag of the MAC instruction inside the multiplier and transferring it to the CCR when the STMAC instruction is executed.

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

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

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

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

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

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

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

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

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

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

T3のφ#で、レジスタ制御信号Aに基づいて、第1のアドレスの内容をGBに読み出して、MAB33に転送し、IABに出力する。   At φ # of T3, the contents of the first address are read to GB based on the register control signal A, transferred to the MAB 33, and output to the IAB.

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

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

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 read out to GB and input to the ALU 26 to perform the 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, and the STY signal included in the control signal B is activated to cause the multiplier 2 to latch 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 using the contents of the PC 30 as an address is read, and the contents of the PC 30 are incremented.

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

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

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

乗算器2は、演算終了時点で、SYSCR13のMACSビットを参照して、オーバフローが発生していれば、MACレジスタの内容を、上限(H’7FFFFFFF)または下限(H’80000000)に固定する。   At the end of the operation, the multiplier 2 refers to the MACS bit of the SYSCR 13 and fixes the contents of the MAC register to the upper limit (H'7FFFFFFF) or the lower limit (H'80000000) if an overflow has occurred.

図21、22に、STMAC、LDMAC命令の動作タイミングを示す。   21 and 22 show the operation timing of the STMAC and LDMAC instructions.

例えば、STMAC MACH,ER2命令などの例である。前記同様に、T2からSTMAC命令の実行が開始される。   For example, it is an example of an STMAC MACH, ER2 instruction. As described above, the execution of the STMAC instruction is started from T2.

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

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

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 is active for three states, and the STMAC instruction is also in a three-state wait state.

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

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 an instruction to read the MAC register is issued. The contents of the MAC register are output to the X bus and the Y bus. Although there is no particular limitation, the X bus is the upper content and the Y bus is the lower content.

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

また、LDMAC ER1,MACL命令などの例である。   Also, examples are LDMAC ER1 and MACL instructions.

T8からLDMAC命令の実行が開始される。   The execution of the LDMAC instruction is started from T8.

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

T9のφ#で、LDMACHまたはLDMACL信号が活性状態になる。PC30の内容がGB経由で、MAB33とINC27に入力される。   At φ # of T9, the LDMACH or LDMACL signal is activated. The contents of the PC 30 are input to the MAB 33 and the INC 27 via GB.

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

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

CLRMAC命令は、概略LDMAC命令と同様の動作で、LDMAC命令のLDMACH、L信号と同じタイミングで、CLRMAC信号を活性状態にするようにすればよい。   The CLRMAC command may be configured to activate the CLRMAC signal at the same timing as the LDMACH and L signals of the LDMAC command, in substantially the same operation as the LDMAC command.

図23、24に、乗算器を用いた乗算命令のタイミング図を示す。   23 and 24 show timing diagrams of a multiplication instruction using a multiplier.

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

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

制御信号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 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. The control signal indicates from the CONT 22 the selection of byte / word, the selection of signed / unsigned, and the selection of multiplication / sum of products.

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

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

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

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

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

図25、26に、乗算器を用いない乗算命令のタイミング図を示す。乗算器を用いない乗算は、特に制限はされないものの、除算と類似のシーケンスで行なうようにする。   25 and 26 show timing diagrams of a multiplication instruction without using a multiplier. Multiplication without using a multiplier is performed in a sequence similar to division, although there is no particular limitation.

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

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

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

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 φ #. Also, the shifted out carry is held internally.

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

T13では、上記同様の判定を行い、前回のキャリが”1”である場合、部分積の下位8ビットに乗数を加算する。前記以外の場合、部分積を保持する。16ビットの積が得られる。かかる結果がφ#に同期してWBを経由して、Rdにライトされる。符号付きの場合は、T14で符号処理を行なう。また、ワードサイズの場合は、部分乗算処理が8回追加される。   At T13, the same determination as above is performed. If the previous carry is “1”, a 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 signed, sign processing is performed at T14. In the case of a word size, a partial multiplication process is added eight times.

先に保持した符号判定結果に基づいて、積の符号処理を行なう。すなわち、乗数・被乗数の一方が正数、他方が負数のときは、積の符号を反転する(0から積を引く)。   The sign processing of the product is performed based on the sign judgment result held earlier. 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).

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

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. The state of the BUSY signal is determined. In the test mode, the BUSY signal is in an inactive state, and the process immediately transits to step S2.

BUSY信号が活性状態であると、WAIT状態に遷移する。BUSY信号は非活性状態になるとステップ2に遷移する。   When the BUSY signal is in the active state, the state transitions to the WAIT state. When the BUSY signal goes into the inactive state, the flow goes to step 2.

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

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

ステップ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 result of the addition is selected. If the bit shifted out is "0", the contents of GB are selected and the shift is performed. This is repeated until step 10.

ステップ11では、GBに部分積を、DB下位に乗数を出力し、ALU26で加算を行なう。前のステップでシフトアウトしたビットが”1”であれば、加算した結果が選択され、シフトアウトしたビットが”0”であれば、GBの内容が選択される。シフトは行なわない。ステップ12で、命令のリードを行なう。例えば、積を検査して、CCRに反映する。次の命令の実行を開始する。   In step 11, 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 addition result is selected. If the bit shifted out is "0", the content of GB is selected. No shift is performed. In step 12, an instruction is read. For example, the product is checked and reflected in the CCR. Start executing the next instruction.

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

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 of the shift processing (partial remainder) is written to Rd via WB in synchronization with φ #. Also, the shifted out carry is held internally.

T6のφ1に同期して、Rdから部分剰余を読み込み、部分除算処理を行なう。前回のキャリが”1”である場合、または、部分剰余の上位8ビットが除数以上である場合、部分剰余の上位8ビットから除数を減算(除数の符号反転を行っている場合、除数の反転を加算)し、16ビットでシフト処理を行い、最下位ビットは”1”とする。前記以外の場合、部分剰余に16ビットでシフト処理を行い、最下位ビットは”0”とする。かかる結果がφ#に同期してWBを経由して、Rdにライトされる。また、シフトアウトされたキャリが内部で保持される。この動作を7回繰り返す。   In synchronization with φ1 of T6, a partial remainder is read from Rd, and a partial division process is performed. When the previous carry is “1”, or when the upper 8 bits of the partial remainder are 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 divisor is inverted). Are added), and a shift process is performed with 16 bits, and the least significant bit is set to “1”. In other cases, the partial remainder is shifted by 16 bits, and the least significant bit is set to “0”. The result is written to Rd via WB in synchronization with φ #. Also, the shifted out carry is held internally. This operation is repeated seven times.

T13では、上記同様の判定を行い、前回のキャリが”1”である場合、または、部分剰余の上位8ビットが除数以上である場合、部分剰余の上位8ビットから除数を減算し、下位8ビットでシフト処理を行い、最下位ビットは”1”とする。前記以外の場合、部分剰余に下位8ビットでシフト処理を行い、最下位ビットは”0”とする。いずれの場合も、ビット7の値は失われる。上位8ビットに剰余、下位8ビットに商が得られる。かかる結果がφ#に同期してWBを経由して、Rdにライトされる。   At T13, the same determination as above is performed, and if the previous carry is “1” or if the upper 8 bits of the partial remainder are greater than or equal to the divisor, the divisor is subtracted from the upper 8 bits of the partial remainder to obtain the lower 8 bits. Shift processing is performed on the bits, and the least significant bit is set to “1”. In other cases, the partial remainder is shifted by 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. The result is written to Rd via WB in synchronization with φ #.

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

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

算術論理演算回路76は、GBとDBの内容を入力して、加算、減算、論理積、論理和、排他的論理和などの演算を行い、結果を出力する。選択回路77は、算術論理演算回路の出力と、GBの内容を入力して、いずれかを選択して出力する。シフト回路78は、選択回路77の出力を入力して、シフト処理を行なう。   The arithmetic and logic operation circuit 76 inputs the contents of GB and DB, performs operations such as addition, subtraction, logical product, logical sum, and exclusive logical sum, and outputs the result. The selection circuit 77 receives the output of the arithmetic and logic operation circuit and the content of GB, selects one of them, and outputs it. Shift circuit 78 receives the output of selection circuit 77 and performs a shift process.

選択回路77、シフト回路78は制御回路79によって制御される。制御回路79は、CONT22の与える制御信号と算術論理演算回路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 controls the selection of the selection circuit 77 and the shift input of the shift circuit 78 based on the control signal supplied from the CONT 22 and the outputs of the arithmetic and logic operation circuit 76 and the shift circuit 78. The control circuit 79 determines the above-described partial multiplication and partial division. If the condition is satisfied, the output of the arithmetic and logic operation circuit 76 is selected. In the case of division, 1 is input to the shift circuit. If the condition is not satisfied, GB input 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.

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

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

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

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

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

複数命令の待避命令は、待避するレジスタの本数に対応して、
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 save instruction of multiple instructions corresponds to the number of registers to be saved,
STM (ERl-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, 4. Save the specified general-purpose register to the stack. For example, when saving ER0 and ER1 to the stack,
STM (ER0-ER1), @ -SP
Is used. The data is written to the stack in the order of ER0 and ER1, and the stack pointer (ER7) is incremented by +8. The register designation part in the instruction code is the register number to be saved first.

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

前記同様に、T2から除算命令の実行が開始される。特に制限はされないものの、命令コードの第1ワードはプリフィックスコードであり、次の命令コードの動作を指定し、PCをインクリメントするほかの動作は行なわない。   As described 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 any other operation for incrementing the PC.

第2ワードの命令コードは、PUSH命令と共通にされる。   The instruction code of the second word is made common to the PUSH instruction.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

ビット2には、オペコードのレジスタ指定フィールドのビット2がそのまま入力される。ビット1、0には、オアゲートとアンドゲートを介して入力される。オアゲートの他方の入力はSTM制御信号1、0であり、アンドゲートの他方の入力はLDM制御信号1、0の反転とされる。STM制御信号1、0およびLDM制御信号1、0は、CONT22の出力である制御信号Bに含まれる。   In the bit 2, the bit 2 of the register designation field of the operation code is input as it is. 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, and the other input of the AND gate is the inverse of the LDM control signal 1, 0. The STM control signals 1 and 0 and the LDM control signals 1 and 0 are included in the control signal B that is the output of the CONT 22.

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

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

図35、36に、C言語で書かれた関数と、これをCPUの命令に変換したリストの概略を示す。このリストには、オフセット(相対アドレス)、命令コード、Cラベル、Cソース及びアセンブラ命令の各項目が示されている。   35 and 36 schematically show functions written in the C language and lists converted from the functions into CPU instructions. This list shows items of offset (relative address), instruction code, C label, C source, and assembler instruction.

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

関数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, an argument is passed to a register and is assigned to ER0. Since ER2, ER3, ER4, ER6 are used in the processing within the function, at the beginning of the function processing,
STM (ER2-ER3), @ -SP
STM (ER4-ER6), @ -SP
And at the end of the function,
LDM @ SP +, (ER4-ER6)
LDM @ SP +, (ER2-ER3)
And returns from the subroutine (RTS).

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

また、この関数内で呼び出される関数Proc3は、引数をレジスタ渡しとし、これをER0に割り当てている。関数内の処理で、ER5を使用するため、関数処理の先頭で、1レジスタの待避
PUSH.L ER5
を実行して、関数の最後で、
POP.L ER5
を実行して、サブルーチンからリターン(RTS)している。
The function Proc3 called in this function passes an argument by register and assigns it to ER0. Since ER5 is used in the processing in the function, one register is saved at the beginning of the function processing. L ER5
And at the end of the function,
POP. L ER5
And returns from the subroutine (RTS).

スタックポインタは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, when saving all the registers that can be used when performing task switching,
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,
LDM @ SP +, (ER4-ER6)
LDM @ SP +, (ER0-ER3)
Are used. Return from the stack in the order of ER6 to ER0.

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

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

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

また、固定の組み合わせにし、各命令の実行ステート数を固定にすることにより、内部の条件分岐を行なうことをなくし、内部論理を簡潔にし、論理規模を縮小できる。マイクロプログラムによらず、ワイアードロジックなどでも容易に実現できる。マイクロプログラムによらず、ワイアードロジックなどとすることにより、論理回路の高速化に寄与することができる。特に、C言語など関数乃至サブルーチンを多く用いるプログラムを高速に実行することができる。   Further, 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 using a microprogram. By using wired logic or the like regardless of the microprogram, it is possible to contribute to speeding up of a logic circuit. In particular, a program that uses many functions or subroutines such as the C language can be executed at high speed.

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

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

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

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

T3のφで、デクリメントした結果を、WB経由で一旦PC30に格納する。   The result of the decrement at φ of T3 is temporarily stored in the PC 30 via WB.

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

T3のφ#で、デクリメントした結果を、WB経由でSPに格納するとともに、GB経由でMAB33に転送し、IABに出力させる。   At φ # of T3, the decremented result is stored in the SP via the WB, transferred to the MAB 33 via the GB, and output to the IAB.

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 contents of the DBW 24 are output from φ # of T4 to the internal data bus.

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

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

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

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

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 flow goes to step 12 to decrement SP and perform a write operation using this content as an address and the EXR content as data.

T5のφで、SPの内容を読み出して、GB経由でALU27でデクリメント(−2)を行なう。   At φ of T5, the contents of SP are read, and decrement (-2) is performed by ALU 27 via GB.

T5のφ#で、デクリメントした結果を、WB経由でSPに格納する。   At φ5 of T5, the result of the decrement is stored in the SP via WB.

T6のφで、EXRの内容をDB経由でDBW24に転送する。T6のφ#から、内部データバスに出力される。   At φ of T6, the contents of EXR are transferred to DBW 24 via DB. From φ # of T6, it is output to the internal data bus.

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

T5のφ#で、同時に、VAGの内容をGB経由でMAB33に転送し、IABに出力させる。VAGには、図示されない、割り込みコントローラから与えられるベクタ番号に基づいて、ベクタアドレスを生成する。   At φ # of T5, the contents of VAG are simultaneously transferred to MAB 33 via GB and output to IAB. The VAG generates a vector address based on a vector number provided from an interrupt controller (not shown).

ステップ5で、ベクタアドレスのリード動作の終了を待つ。   In step 5, the process waits for the end of the vector address read operation.

ステップ6で、DBR25に格納した、ベクタアドレスの内容をアドレスとして、命令のリードを行なう。DBR25の内容をインクリメントし、PC30に格納する。   In step 6, an instruction is read using the contents of the vector address stored in the DBR 25 as an address. The contents of the DBR 25 are incremented and stored in the PC 30.

T8のφ#で、DBR25に格納したベクタアドレスのリード内容(分岐先の先頭アドレス)をGB経由で、MAB33に転送し、IABに出力させ、ALU26でインクリメント(+2)する。   At φ # of T8, the read content (start address of the branch destination) of the vector address stored in the DBR 25 is transferred to the MAB 33 via GB, output to the IAB, and incremented (+2) by the ALU 26.

T9のφで、インクリメントした結果を、WB経由でPC30に格納する。   At φ of T9, the incremented result is stored in the PC 30 via WB.

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

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

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

次の命令の実行を開始させる。   Starts execution of the next instruction.

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

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

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

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

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

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

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

T3のφで、SPの内容を読み出して、GB経由で、ALU27でインクリメント(+2)する。IABのアドレスでスタックをリードする。T3のφ#で、リードした内容をDBR25に格納する。   At φ of T3, the contents of the SP are read and incremented (+2) by the ALU 27 via GB. Read the stack with the IAB address. At φ # of T3, the read contents are stored in the DBR 25.

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 in the active state, the flow goes to step 10 to store the read result in EXR. SP is incremented, and reading is performed with this content.

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

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

ステップ2で、リードした結果をCCR31に格納する。MAB33に格納した内容を、MAB33でインクリメントさせる。この内容でリードを行なう。なお、MAB33のインクリメント機能は、特開平4−333153号公報などに記載されている。   In step 2, the read result is stored in the CCR 31. The contents stored in the MAB 33 are incremented by the MAB 33. A read is performed with these contents. The increment function of the MAB 33 is described in, for example, JP-A-4-333153.

T5のφで、DBR25の内容をGBに読み出し、これをALU27に入力する。T5のφ#で、ALU27はGBから入力した内容をそのまま、WBに出力し、CCR31に格納する。   At φ of T5, the contents of the DBR 25 are read to GB, and this is input to the ALU 27. At φ # 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.

ステップ3で、SPの内容をインクリメント(+4)する。   In step 3, the content of the SP is incremented (+4).

T6のφで、SPの内容を読み出して、GB経由で、ALU26でインクリメント(+4)する。   At φ of T6, the contents of the SP are read and incremented (+4) by the ALU 26 via GB.

T6のφ#で、インクリメントした結果を、WB経由でSPに格納する。   At φ6 of T6, the increment result is stored in the SP via WB.

ステップ4で、DBR25に格納した、スタックから復帰したPC30の内容をアドレスとして、命令のリードを行なう。DBR25の内容をインクリメントし、PC30に格納する。   In step 4, an instruction is read using the contents of the PC 30 restored from the stack stored in the DBR 25 as an address. The contents of the DBR 25 are incremented and stored in the PC 30.

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

T7のφで、インクリメントした結果を、WB経由でPC30に格納する。   At φ of T7, the increment result is stored in the PC 30 via WB.

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

T7のφ#で、PC30の内容(分岐先の先頭アドレス)をGB経由で、MAB33に転送し、IABに出力させ、ALU26でインクリメント(+2)する。リードした命令をIRに格納する。   At φ # of T7, the contents of the PC 30 (the leading address of the branch destination) are transferred to the MAB 33 via GB, output to the IAB, and incremented (+2) by the ALU 26. The read instruction is stored in the IR.

T8のφで、インクリメントした結果を、WB経由でPC30に格納する。次の命令の実行を開始させる。   At φ of T8, the increment result is stored in the PC 30 via WB. Starts execution of the next instruction.

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

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

なお、前記の通りINTM1ビットがSYSCRに存在し、このビットの状態がINTM1信号に反映されるようになっている。リセット後に、かかるSYSCRの設定を行なうことにより、EXRを使用するかしないかが選択される。   As described above, the INTM1 bit exists in the SYSCR, and the state of this bit is reflected in the INTM1 signal. After the reset, the setting of the SYSCR is performed to select whether to use the EXR.

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

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

次に、図4におけるエミュレーション用インタフェース39に含まれる制御レジスタ41の構成を示す。この制御レジスタ41は、以下説明するように、(1)ASEコントロールレジスタ D (ASECRD)、(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 described. As described below, this control register 41 includes (1) ASE control register D (ASECRD), (2) break control register AB (BRCR, B), and (3) break address register A, B (BARA, B). ), (4) Break address mask register A, B (BAMRA, B), and (5) ASE dedicated stack register (BRKSTKR).

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

[表21]

Figure 2004295914
[Table 21]
Figure 2004295914

[表22]

Figure 2004295914
[Table 22]
Figure 2004295914

[表23]

Figure 2004295914
[Table 23]
Figure 2004295914

[表24]

Figure 2004295914
[Table 24]
Figure 2004295914

図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 (BRCR, B). This register is composed of (a) BRCRA and (b) BRCRB, each of which is an 8-bit readable / writable register and controls the PC break channels A and B, respectively. Tables 25 to 28 show the contents of each bit.

[表25]

Figure 2004295914
[Table 25]
Figure 2004295914

[表26]

Figure 2004295914
[Table 26]
Figure 2004295914

[表27]

Figure 2004295914
[Table 27]
Figure 2004295914

[表28]

Figure 2004295914
[Table 28]
Figure 2004295914

図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 address of a channel A or B of a PC break, respectively. A 32-bit register may be divided into byte sizes and denoted as BARR, E, H, and L. The top BARR is reserved. When read, an undefined value is read. Light is invalid.

図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 comprises (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 a PC break, respectively. When the bit of BAMR is set to "1", the bit of the address corresponding to this bit is excluded from the address comparison target. In some cases, a 32-bit register is divided into byte sizes and denoted as BAMRR, E, H, and L. The top BARR is reserved. When read, an undefined value is read. Light is invalid.

図49に、(5)ASE専用スタックレジスタ(BRKSTKR)の構成を示す。このレジスタは、6バイト(48ビット)のリード/ライトが可能なレジスタで、ユーザモード⇔ブレークモードの遷移時に、スタック領域として使用する。ユーザのSPは使用せず、保持される。スタックされるリソースおよびスタックの構造は、MCU動作モード(ノーマルモード/アドバンストモード)および、制御レジスタの設定(SYSCRのINTM1ビット)によって相違される。表29にこのレジスタの使用方法を示す。   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 when transitioning from user mode to break mode. The user's SP is not used and is retained. The resources to be stacked and the structure of the stack differ depending on the MCU operation mode (normal mode / advanced mode) and the setting of the control register (INTM1 bit of SYSCR). Table 29 shows how to use this register.

[表29]

Figure 2004295914
[Table 29]
Figure 2004295914

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

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

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

通常のレジスタ回路が、データを保持するためのラッチ回路を持たなければならないが、EMLSP29は、これを持たず、小型化を図っている。   A normal register circuit must have a latch circuit for holding data, but the EMLSP 29 does not have this and is trying to reduce the size.

従って、ブレークスタックレジスタの先頭アドレスは、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. The address can be changed depending on the arrangement of the internal I / O registers of the microcomputer.

ブレーク例外処理の実行シーケンスは、図37、38と同様であり、そこでのSP(ER7)の読み出しに代わって、EMLSP29を読み出すようにする。
この場合、最初(T3のφ)は下位アドレスをB’000110として、デクリメントした内容のB’000100がスタックのアドレスとされる。
The execution sequence of the break exception process is the same as that shown in FIGS. 37 and 38, and the EMLSP 29 is read instead of reading the SP (ER7) there.
In this case, at the beginning (φ of T3), the lower address is B'000110, and the decremented content B'000100 is set as the address of the stack.

2回目(T4のφ)は下位アドレスをB’000100として、デクリメントした内容のB’000010がスタックのアドレスとされる。   In the second time (φ of T4), the lower address is set to B'000100, and the decremented content B'000010 is set as the stack address.

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

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

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

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

3回目はMAB33のインクリメントによってアドレスを生成し、EMLSP29は使用しない。   In the third time, an address is generated by incrementing the MAB 33, and the EMLSP 29 is not used.

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

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

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

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

図52に、ブレーク制御論理の回路構成を示す。この回路は、アンド回路81A乃至81G、オア回路82A乃至82D、フリップフロップ83から構成されている。   FIG. 52 shows a 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.

CPUに対するブレーク要求は、3要因が存在する。第1はBRK端子による要求である。第2はアドレス比較Aによる要求であり、これは、BRKCRのBIEAビットによって許可される。第3はアドレス比較Bによる要求であり、これは、BRKCRのBIEBビットによって許可される。なお、かかるアドレス比較は、前記の通り、(CA23・AR23+¬CA23・¬AR23+AMR23)・…・(CAn・ARn+¬CAn・¬ARn+AMRn)・…・(CA0・AR0+¬CA0・¬AR0+AMR0)と表現される。(¬は論理反転を示す)。   There are three causes for a break request to the CPU. The first is a request by the BRK terminal. The second is a request by address comparison A, which is granted by the BIEA bit of BRKCR. Third is a request by address compare B, which is granted by the BIEB bit of BRKCR. As described above, this address comparison is expressed as (CA23 / AR23 + @ CA23 / @ AR23 + AMR23)... (CAn / ARn + @ CAn / @ ARn + AMRn)... (CA0.AR0 + @ CA0. @ AR0 + AMR0). You. (¬ indicates logical inversion).

これらの論理和信号が、ブレーク要求として、CPUに与えられる。ブレークモードでは、MBIEビットの状態によってBRK端子によるブレーク要求の許可禁止が選択される。即ち、ブレークモードでMBIEビットが”0”にクリアされている場合は、ブレーク要求が抑止される。アドレス比較によるブレーク要求は、ブレークモードで禁止される。   These OR signals are supplied to the CPU as a break request. In the break mode, permission / prohibition of the break request by the BRK terminal is selected according to the state of the MBIE bit. That is, when the MBIE bit is cleared to "0" in the break mode, the break request is suppressed. Break requests by address comparison are prohibited in the break mode.

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

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

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

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

上記実施の形態 によれば、以下の作用効果を得るものである。   According to the above embodiment, the following operation and effect can be obtained.

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

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

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

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

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

(5)乗算器のテストモードを設定して、このときの乗算器の処理を1ステップのみにすることによって、論理規模の増加を最低限にして、テストの容易性を向上することができる。テストステップを短縮することができる。   (5) By setting the test mode of the multiplier and performing only one step of the processing of the multiplier at this time, it is possible to minimize the increase in the logic scale and improve the testability. Test steps can be shortened.

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

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

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

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

また、エミュレータ用のスタックポインタを固定的にすることによって、ユーザに公開しない資源を最小限の論理的・物理的規模にすることができる。ユーザプログラムからエミュレーションプログラムへの遷移(ブレーク)を多重に行なうことを禁止することを可能にすることによって、不所望のスタックの内容の破壊を防止することができる。   In addition, by fixing the stack pointer for the emulator, resources that are not disclosed to the user can be reduced to a minimum 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 contents of the stack.

以上本発明者等によってなされた発明を実施の形態 に限定されるものではなく、その要旨を逸脱しない範囲において種々変更可能である。実施の形態 を相互に組み合せて使用することもできる。   The invention made by the inventors of the present invention is not limited to the embodiment, but can be variously changed without departing from the gist of the invention. The embodiments may be used in combination with each other.

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

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

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

さらにまた、乗算器に限らず除算器を内蔵するものであっても良い。   Furthermore, the present invention is not limited to the multiplier, and may include a divider.

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

さらに、シングルチップマイクロコンピュータのその他の機能ブロックについても何等制約されない。   Further, the other functional blocks of the single-chip microcomputer are not restricted at all.

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

本発明の実施の形態によるマイクロコンピュータの構成を示すブロック図である。FIG. 1 is a block diagram illustrating a configuration of a microcomputer according to an embodiment of the present invention. 本実施の形態のマイクロコンピュータのシステムコントロールレジスタの構成図であるFIG. 3 is a configuration diagram of a system control register of the microcomputer according to the present embodiment. 本実施の形態のマイクロコンピュータに用いられるCPUの命令フォーマットの構成図である。FIG. 2 is a configuration diagram of an instruction format of a CPU used in the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータに用いられるCPUと乗算器を示すブロック図である。FIG. 2 is a block diagram illustrating a CPU and a multiplier used in the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータにおける制御レジスタの1ビットの構成図である。FIG. 2 is a configuration diagram of one bit of a control register in the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータにおける制御信号の設定方法の一例を示すブロックである。3 is a block diagram illustrating an example of a control signal setting method in the microcomputer according to the present embodiment. 本実施の形態のマイクロコンピュータにおける制御信号の設定方法の一例を示す概略図である。FIG. 4 is a schematic diagram illustrating an example of a control signal setting method in the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータに用いられるCPUのレジスタの構成図である。FIG. 2 is a configuration diagram of a register of a CPU used in the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータに用いられるCPUのレジスタの構成図である。FIG. 2 is a configuration diagram of a register of a CPU used in the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータに用いられるCPUのレジスタの使用方法を説明するフロック図である。FIG. 4 is a block diagram illustrating a method of using a register of a CPU used in the microcomputer of the present embodiment. 本実施の形態 のマイクロコンピュータに用いられるCPUのレジスタのスタックの状態の説明図である。FIG. 3 is an explanatory diagram of a state of a stack of registers of a CPU used in the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータに用いられるCPUの基本動作のタイミング図である。FIG. 3 is a timing chart of a basic operation of a CPU used in the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータに用いられるCPUの基本動作のタイミング図である。FIG. 3 is a timing chart of a basic operation of a CPU used in the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータに用いられる乗算器の構成を示すブロック図である。FIG. 2 is a block diagram illustrating a configuration of a multiplier used in the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータに用いられる乗算器による演算方法の説明図である。FIG. 4 is an explanatory diagram of a calculation method by a multiplier used in the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータに用いられる乗算器のフラグの実現方法の説明図である。FIG. 3 is an explanatory diagram of a method of realizing a flag of a multiplier used in the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータに用いられる乗算器のフラグの実現方法の説明図である。FIG. 3 is an explanatory diagram of a method of realizing a flag of a multiplier used in the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータに用いられるバススイッチの構成を示すブロック図である。FIG. 2 is a block diagram illustrating a configuration of a bus switch used in the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータにおけるMAC命令の動作のタイミング図である。FIG. 4 is a timing chart of an operation of a MAC instruction in the microcomputer of the embodiment. 図19に連続する動作のタイミング図である。FIG. 20 is a timing chart of the operation following FIG. 19. 本実施の形態のマイクロコンピュータにおけるSTMAC命令およびLDMAC命令の動作のタイミング図である。FIG. 5 is a timing chart of the operation of the STMAC instruction and the LDMAC instruction in the microcomputer of the embodiment. 図21に連続する動作のタイミング図である。FIG. 22 is a timing chart of the operation following FIG. 21. 本実施の形態のマイクロコンピュータにおいて乗算器を用いた場合の乗算命令の動作のタイミング図である。FIG. 5 is a timing chart of an operation of a multiplication instruction when a multiplier is used in the microcomputer of the present embodiment. 図19に連続する動作のタイミング図である。FIG. 20 is a timing chart of the operation following FIG. 19. 本実施の形態のマイクロコンピュータにおいて乗算器を用いない場合の乗算命令の動作のタイミング図である。FIG. 5 is a timing chart of an operation of a multiplication instruction when a multiplier is not used in the microcomputer of the present embodiment. 図25に連続する動作のタイミング図である。FIG. 26 is a timing chart of the operation following FIG. 25. 本実施の形態のマイクロコンピュータにおける乗算命令の状態遷移図である。FIG. 4 is a state transition diagram of a multiplication instruction in the microcomputer of the embodiment. 本実施の形態のマイクロコンピュータに用いられる演算器の構成を示すブロック図である。FIG. 2 is a block diagram illustrating a configuration of an arithmetic unit used in the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータにおける複数レジスタの退避命令の実行シーケンス図である。FIG. 5 is an execution sequence diagram of a save instruction of a plurality of registers in the microcomputer according to the present embodiment. 図29に連続する動作のタイミング図である。FIG. 30 is a timing chart of the operation following FIG. 29. 本実施の形態のマイクロコンピュータにおける複数レジスタの復帰命令の実行シーケンス図である。FIG. 5 is an execution sequence diagram of a return instruction of a plurality of registers in the microcomputer of the present embodiment. 図31に連続する動作のタイミング図である。FIG. 32 is a timing chart of the operation following FIG. 31. 本実施の形態のマイクロコンピュータにおけるRSEL2入力制御回路の構成を示すブロック図である。FIG. 2 is a block diagram illustrating a configuration of an RSEL2 input control circuit in the microcomputer of the present embodiment. 図33の動作の説明図である。FIG. 34 is an explanatory diagram of the operation in FIG. 33. 本実施の形態のマイクロコンピュータに適用されるC言語による変換リストの概略例である。3 is a schematic example of a conversion list in C language applied to the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータに適用されるC言語による変換リストの概略例である。3 is a schematic example of a conversion list in C language applied to the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータにおける割込例外処理の実行シーケンス図である。FIG. 4 is an execution sequence diagram of interrupt exception processing in the microcomputer of the present embodiment. 図37に連続する動作のタイミング図である。FIG. 38 is a timing chart of the operation following FIG. 37. 本実施の形態のマイクロコンピュータにおける例外処理の状態遷移図である。FIG. 6 is a state transition diagram of exception processing in the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータにおける例外処理後のスタックの状態の説明図である。FIG. 4 is an explanatory diagram of a state of a stack after exception processing in the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータにおける例外処理後のスタックの状態の説明図である。FIG. 4 is an explanatory diagram of a state of a stack after exception processing in the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータにおけるRTE命令の実行シーケンス図である。FIG. 3 is an execution sequence diagram of an RTE instruction in the microcomputer of the embodiment. 本実施の形態のマイクロコンピュータにおける例外処理の状態遷移図である。FIG. 6 is a state transition diagram of exception processing in the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータにおける制御回路の構成の説明図である。FIG. 2 is an explanatory diagram of a configuration of a control circuit in the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータにおける制御レジスタの構成図である。FIG. 2 is a configuration diagram of a control register in the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータにおける制御レジスタの構成図である。FIG. 2 is a configuration diagram of a control register in the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータにおける制御レジスタの構成図である。FIG. 2 is a configuration diagram of a control register in the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータにおける制御レジスタの構成図である。FIG. 2 is a configuration diagram of a control register in the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータにおける制御レジスタの構成図である。FIG. 2 is a configuration diagram of a control register in the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータにおけるエミュレーションスタックポインタの構成の説明図である。FIG. 3 is an explanatory diagram of a configuration of an emulation stack pointer in the microcomputer according to the present embodiment. 本実施の形態のマイクロコンピュータにおけるブレーク割込みシーケンスの実行タイミング図である。FIG. 4 is a timing chart of the execution of a break interrupt sequence in the microcomputer of the present embodiment. 本実施の形態のマイクロコンピュータにおけるブレーク制御処理の回路構成図である。FIG. 3 is a circuit configuration diagram of a break control process in the microcomputer of the present embodiment.

符号の説明Explanation of reference numerals

1…CPU、2…乗算器、3…システムコントローラ(SYSC)、4…割込コントローラ(INT)、5…ROM、6…RAM、9…シリアルコミュニケーションインターフェース(SCI)、13…システムコントロールレジスタ(SYSCR)、14…制御レジスタ(CPUCR)、21…命令レジスタ(IR)、22…命令デコーダ・制御回路(CONT)、23…レジスタセレクタ(RSEL)、24…ライトデータバッファ(DBW)、25…リードデータバッファ(DBR)、26、27…演算器、29…エミュレータスタックポインタ(EMLSP)、30…プログラムカウンタ(PC)、31…コンディションレジスタ(CCR)、32…拡張レジスタ(EXR)、33…アドレスバッファ(MAB)、34…バススイッチ、38…エミュレーション用プロセッサ、39…エミュレーション用インタフェース、44…インタフェースケーブル、48…エミュレーションメモリ、49…ブレーク制御回路、50…リアルタイムトレース回路、58…CMOSインバータ回路、65A〜65C…デコーダ、66A〜66C、71A、71B、77…選択回路、67…加算器、72A〜72C…拡張回路、76…算術論理演算回路、78…シフト回路、79…制御回路、75A、75B、81A〜81G、86A〜86D…アンド回路、80A、80B、82A〜82D…オア回路、83…フリップフロップ。
DESCRIPTION OF SYMBOLS 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 (CPUCR), 21: instruction register (IR), 22: instruction decoder / control circuit (CONT), 23: register selector (RSEL), 24: write data buffer (DBW), 25: read data Buffers (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 ( MAB), 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 to 65C, decoder, 66A to 66C , 71A, 71B, 77: selection circuit, 67: adder, 72A to 72C: expansion circuit, 76: arithmetic and logic operation circuit, 78: shift circuit, 79: control circuit, 75A, 75B, 81A to 81G, 86A to 86D ... AND circuits, 80A, 80B, 82A to 82D ... OR circuits, 83 ... flip-flops.

Claims (6)

所定の命令を順次実行するデータ処理装置であって、
前記命令を実行する実行手段を制御する制御手段に、指定可能な複数のレジスタの組み合わせを固定にし、前記複数のレジスタの待避/復帰命令を有することを特徴とするデータ処理装置。
A data processing device that sequentially executes a predetermined instruction,
A data processing apparatus, wherein a combination of a plurality of registers that can be specified is fixed to a control unit that controls an execution unit that executes the instruction, and a save / restore instruction for the plurality of registers is provided.
前記待避/復帰命令は、指定することのできるレジスタの組み合わせの異なる複数種類であることを特徴とする請求項1記載のデータ処理装置。 2. The data processing apparatus according to claim 1, wherein the save / restore instructions are a plurality of different types of register combinations that can be specified. 前記待避命令と前記復帰命令は、指定することのできるレジスタの組み合わせが同じであることを特徴とする請求項1または2記載のデータ処理装置。 3. The data processing device according to claim 1, wherein the save instruction and the return instruction have the same combination of registers that can be specified. 前記待避/復帰させる複数のレジスタは、連続するレジスタ番号を有する複数のレジスタであることを特徴とする請求項1乃至3のいずれか1項記載のデータ処理装置。 4. The data processing device according to claim 1, wherein the plurality of registers to be saved / restored are a plurality of registers having consecutive register numbers. 前記待避/復帰命令の命令コードのレジスタ指定部は、待避/復帰させる複数のレジスタの組み合わせを、最初に待避されるレジスタ番号で代表させることを特徴とする請求項4記載のデータ処理装置。 5. The data processing apparatus according to claim 4, wherein the register designator of the instruction code of the save / restore instruction represents a combination of a plurality of registers to be saved / restored by a register number saved first. 待避/復帰命令で指定できるレジスタの組み合わせを固定にしたことを特徴とするデータ処理装置。
A data processing device wherein a combination of registers that can be designated by a save / restore instruction is fixed.
JP2004161157A 2004-05-31 2004-05-31 Data processing device Pending JP2004295914A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004161157A JP2004295914A (en) 2004-05-31 2004-05-31 Data processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004161157A JP2004295914A (en) 2004-05-31 2004-05-31 Data processing device

Related Parent Applications (1)

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

Publications (1)

Publication Number Publication Date
JP2004295914A true JP2004295914A (en) 2004-10-21

Family

ID=33411298

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004161157A Pending JP2004295914A (en) 2004-05-31 2004-05-31 Data processing device

Country Status (1)

Country Link
JP (1) JP2004295914A (en)

Similar Documents

Publication Publication Date Title
US6560697B2 (en) Data processor having repeat instruction processing using executed instruction number counter
US8612726B2 (en) Multi-cycle programmable processor with FSM implemented controller selectively altering functional units datapaths based on instruction type
JPH09311786A (en) Data processing device
JP2001202243A (en) Data processing device
JP4004915B2 (en) Data processing device
JP4073721B2 (en) Data processing device
JP3578883B2 (en) Data processing device
JP2006313561A (en) Data processor
US6078940A (en) Microprocessor with an instruction for multiply and left shift with saturate
US6055628A (en) Microprocessor with a nestable delayed branch instruction without branch related pipeline interlocks
US6209080B1 (en) Constant reconstruction processor that supports reductions in code size and processing time
JP4800582B2 (en) Arithmetic processing unit
US6112291A (en) Method and apparatus for performing a shift instruction with saturate by examination of an operand prior to shifting
JP3786575B2 (en) Data processing device
JP3759742B2 (en) Data processing device
JP2000207210A (en) Microprocessor
JP2004295914A (en) Data processing device
JP3740321B2 (en) Data processing device
US6128725A (en) Microprocessor with an instruction for setting or clearing a bit field
JPH08263290A (en) Data processing device
JP4545777B2 (en) Data processing device
US5784634A (en) Pipelined CPU with instruction fetch, execution and write back stages
JP4382076B2 (en) Data processing device
JP3760093B2 (en) Microcomputer
JP3839835B2 (en) Data processing apparatus and microcomputer

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060404

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060602

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20060627

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060828

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20060904

A912 Re-examination (zenchi) completed and case transferred to appeal board

Free format text: JAPANESE INTERMEDIATE CODE: A912

Effective date: 20061027