JP2006293824A - Semiconductor device - Google Patents

Semiconductor device Download PDF

Info

Publication number
JP2006293824A
JP2006293824A JP2005115775A JP2005115775A JP2006293824A JP 2006293824 A JP2006293824 A JP 2006293824A JP 2005115775 A JP2005115775 A JP 2005115775A JP 2005115775 A JP2005115775 A JP 2005115775A JP 2006293824 A JP2006293824 A JP 2006293824A
Authority
JP
Japan
Prior art keywords
access
invalid
debug
product
resource
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
JP2005115775A
Other languages
Japanese (ja)
Inventor
Tsuneo Uenishi
恒雄 上西
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP2005115775A priority Critical patent/JP2006293824A/en
Publication of JP2006293824A publication Critical patent/JP2006293824A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a semiconductor device which is capable of detecting erroneous access to restricted resources in the case that a memory size or peripheral functions are restricted in a mask ROM microcomputer chip to be mounted on a final set with respect to an emulation chip supporting software development of the final set. <P>SOLUTION: An access monitor circuit 1003 for monitoring operations of a bus controller 1006 is provided. When being connected to a debugging host as the emulation chip, the access monitor circuit 1003 determines an access from the bus controller 1006 to be invalid in the case that an object address of the access is within an invalid address range set to an invalid address table part 1004 as an invalid access, and causes an invalid access detection interruption to a CPU 1002. The CPU 1002 receives this interruption to inform the debugging host of detection of the invalid access through a debugging I/F 110. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は、内蔵メモリサイズや内蔵周辺回路にバリエーションをもつマイクロコントローラやマイクロコンピュータのシリーズ品において、そのベース品種によりソフトウエアデバッグ環境を提供する半導体装置に関する。   The present invention relates to a semiconductor device that provides a software debugging environment according to its base product in a series of microcontrollers and microcomputers having variations in built-in memory size and built-in peripheral circuits.

半導体デバイスベンダにおいては、マイクロコントローラやマイクロコンピュータ(以下、単にマイコンと呼ぶ)は通常、内蔵メモリサイズや内蔵周辺回路にバリエーションをもつシリーズ品として開発されることが多い。たとえば命令ROM内蔵品種シリーズでは、命令ROMにフラッシュメモリを使用する品種とマスクROMを使用する品種とがあり、さらにマスクROMのメモリサイズを変更した品種が用意される。   In semiconductor device vendors, microcontrollers and microcomputers (hereinafter simply referred to as microcomputers) are usually developed as series products with variations in built-in memory sizes and built-in peripheral circuits. For example, in the product series with a built-in instruction ROM, there are a product using a flash memory for the command ROM and a product using a mask ROM, and a product in which the memory size of the mask ROM is changed is prepared.

半導体デバイスユーザでのセット量産時には、コスト面からマスクROM品が適用されることが多い。   Mask ROM products are often applied from the standpoint of cost when mass production is performed by semiconductor device users.

また半導体デバイスユーザに対し、セットのソフトウエア開発やシステム評価を行うためのインサーキットエミュレータ(ICE)やオンボードデバッガなどの開発支援ツール(エミュレータともよぶ)が半導体デバイスベンダから提供される。開発支援ツールは、セットあるいはセット相当の配線基板などに実装されるエミュレーションチップと、このエミュレーションチップを制御しセット開発者とデバッグ情報をやり取りするデバッグホストからなっている。   In addition, semiconductor device vendors provide development support tools (also called emulators) such as an in-circuit emulator (ICE) and an on-board debugger for conducting software development and system evaluation of a set. The development support tool includes an emulation chip mounted on a set or a wiring board equivalent to the set, and a debug host that controls the emulation chip and exchanges debug information with the set developer.

半導体デバイスユーザは、エミュレーションチップを実装したセットやセット相当のプリント基板(以下、これを単にターゲットとよぶ)でソフトウエアを開発し、このソフトウエアをマスクROM化することでマスクROM品を入手し最終セットを量産する。   A semiconductor device user develops software on a set mounted with an emulation chip or a printed circuit board equivalent to the set (hereinafter simply referred to as a target), and obtains a mask ROM product by turning this software into a mask ROM. Mass-produce the final set.

しかしながらエミュレーションチップはシリーズ品のうち内蔵メモリサイズや周辺回路規模などが最大の品種をベースに作成もしくは兼用されることが多く、セット量産に適用されるマスクROM品種とは内蔵メモリサイズや周辺機能が必ずしも一致しないことがある。さらにエミュレーションチップのベースとなる品種もしくはエミュレーションチップを兼ねる品種は、シリーズのマスクROM品種と同時に開発されるのではなく先行して開発されることが多い。またこのエミュレーションチップのベースとなる品種は内蔵命令ROMがマスクROMではなく、セット先行生産の要求を満たすべくフラッシュメモリやEPROMとなっている場合がある。   However, emulation chips are often created or combined based on products with the largest built-in memory size and peripheral circuit scale among the series products, and the mask ROM types that are applied to set mass production are those with built-in memory size and peripheral functions. It may not always match. Furthermore, the type that is the base of the emulation chip or the type that also serves as the emulation chip is often developed in advance, not simultaneously with the series of mask ROM types. In addition, in the product type that is the base of this emulation chip, the built-in instruction ROM is not a mask ROM, but may be a flash memory or an EPROM to meet the requirements of set prior production.

すなわち、ターゲットと最終セットでは、そのソフトウエアを実行するマイコンの内蔵メモリサイズや周辺機能が必ずしも一致しないために、最終セットが正常動作しないことがある。   That is, the final set may not operate normally because the internal memory size and peripheral functions of the microcomputer executing the software do not always match between the target and the final set.

このような不具合を根本的に解消するには、内蔵メモリサイズや周辺機能の異なるマスクROM品種ごとにエミュレーションチップを作成しなくてはならず非常にコストがかかることになる。またエミュレーションチップはセットのソフトウエア開発に用いられることからマスクROM品種の開発に先立って作成されなくてはならず、ベンダでの工数が非常に増加することになる。   In order to solve such a problem fundamentally, it is necessary to create an emulation chip for each type of mask ROM having different built-in memory sizes and peripheral functions, which is very expensive. Also, since the emulation chip is used for software development of the set, it must be created prior to the development of the mask ROM type, which greatly increases the man-hours at the vendor.

上記のような事例の解決案として、内蔵周辺機能が異なるシリーズに対応する場合のエミュレータについては、特許文献1に開示されたものがある。この特許文献1で開示されている技術は、エミュレーションチップに品種識別レジスタを設けておき、エミュレータのパワーオンリセットのたびに品種識別レジスタに格納された品種コードに応じて周辺機能を選択的に活性化するものである。
特開平3−263132号公報
As a solution to the above case, there is one disclosed in Patent Document 1 for an emulator in the case of corresponding to a series having different built-in peripheral functions. In the technique disclosed in Patent Document 1, a product type identification register is provided in an emulation chip, and peripheral functions are selectively activated according to the product type code stored in the product type identification register each time the emulator is powered on. It is to become.
Japanese Patent Laid-Open No. 3-263132

しかしながら上記従来技術のように品種コードに応じて周辺機能を選択的に活性化したとしても、セット開発時に非活性な周辺機能に誤ってアクセスするソフトウエアが作成され、また該当品種コードのマスクROM品が入手できるまでにベース品種のフラッシュ品を先行生産に適用した場合、ベース品種で誤動作が発生する可能性がある。すなわち非活性な周辺機能に誤ってアクセスしたことを検知する手段がなく、ソフトウエア開発者に報知されないためにこのような問題が発生する。   However, even if peripheral functions are selectively activated according to the product code as in the prior art, software that erroneously accesses peripheral functions that are inactive during set development is created, and the mask ROM of the corresponding product code is created. If the flash product of the base product is applied to the pre-production before the product is available, malfunction may occur in the base product. That is, there is no means for detecting that an inactive peripheral function has been accessed by mistake, and this problem occurs because the software developer is not notified.

また上記従来技術ではROMやRAMなどのメモリサイズがベース品種にくらべマスクROMでは制限がある場合でも、同様な理由より制限されたメモリ領域への誤ったアクセスが検知されない問題がある。   Further, in the above prior art, there is a problem that erroneous access to the limited memory area is not detected for the same reason even when the memory size such as ROM and RAM is limited in the mask ROM compared to the base type.

さらに周辺機能がたとえば汎用シリアル回路でありシリアル資源がいくつか選択できるようになっているが、マスクROM化した際には適用セットが決定しているためにマスクROM品には回路簡素化のため専用シリアル回路を実装する場合には、この汎用シリアル回路全体を活性化するためにマスクROM品での制限が検出できない問題がある。   Furthermore, the peripheral function is, for example, a general-purpose serial circuit, and several serial resources can be selected. However, since the applicable set is determined when the mask ROM is used, the mask ROM product is designed to simplify the circuit. In the case of mounting a dedicated serial circuit, there is a problem that the restriction in the mask ROM product cannot be detected in order to activate the entire general-purpose serial circuit.

本発明の目的は、シリーズのベース品種を用いたエミュレーションチップを用い、ベース品種に比較しメモリサイズや周辺機能が制限されるマスクROM品用のソフトウエアを開発するエミュレータに関し、シリーズ品種のおのおのの半導体装置に対応するエミュレーションチップおよびデバッグ環境を早期かつ安価にデバッガユーザであるセット開発者に提供でき、さらには制限される資源への誤ったアクセスを検出することが可能となる半導体装置を提供することにある。   An object of the present invention relates to an emulator for developing software for a mask ROM product that uses an emulation chip using a base product of a series and whose memory size and peripheral functions are limited as compared to the base product. Provided is a semiconductor device capable of providing an emulation chip and a debugging environment corresponding to a semiconductor device to a set developer who is a debugger user at an early stage and at a low cost, and capable of detecting erroneous access to a limited resource. There is.

本発明の第1の半導体装置は、中央処理装置と複数の内部資源とを備え、複数のうちのいずれかの内部資源の領域および機能のいずれかもしくは両方にバリエーションをもつ複数品種からなるシリーズ品のうちの一の品種の半導体装置であって、外部のデバッグホストと通信するデバッグ情報入出力装置と、シリーズ品のうちの他の品種の品種情報を格納する品種情報格納領域とを設け、デバッグ情報入出力装置とデバッグホストとの接続時において品種情報格納領域に格納された品種情報に基づいて他の品種の動作を代行するようにしたことを特徴とする。   A first semiconductor device of the present invention includes a central processing unit and a plurality of internal resources, and is a series product composed of a plurality of products having variations in one or both of the area and function of any of the plurality of internal resources. A debug information input / output device that communicates with an external debug host, and a product information storage area that stores product information of other product types in the series product. When the information input / output device and the debug host are connected, the operation of another product is performed based on the product information stored in the product information storage area.

ここで、内部資源とは、半導体装置に内蔵されるメモリや周辺回路のことである。また、品種情報とは、各内部資源の有無もしくは有効アドレス範囲を表すものである。例えば、内蔵メモリであれば容量の違いにより、大容量品にくらべ、小容量品では上位にマッピングされた該当空間が無効になるので、このような無効空間/有効空間の情報が品種情報になる。   Here, the internal resource is a memory or a peripheral circuit built in the semiconductor device. The product type information represents the presence or absence of each internal resource or the effective address range. For example, in the case of a built-in memory, due to the difference in capacity, the corresponding space mapped at the upper level becomes invalid in a small-capacity product compared to a large-capacity product, so such invalid space / effective space information becomes product type information. .

また、第2の半導体装置は、第1の半導体装置において、デバッグ情報入出力装置とデバッグホストとの接続時において、デバッグ割込みにより起動され中央処理装置にて実行されるデバッグプログラムにより品種情報格納領域への品種情報の書き込みが行われることを特徴とする。   In addition, the second semiconductor device includes a product information storage area by a debug program that is activated by a debug interrupt and executed by the central processing unit when the debug information input / output device and the debug host are connected in the first semiconductor device. It is characterized in that the product information is written to the device.

また、第3の半導体装置は、第1の半導体装置において、デバッグ情報入出力装置とデバッグホストとの接続時において、起動直後に内蔵するシーケンサにより品種情報格納領域への品種情報の書き込みが行われることを特徴とする。   In the third semiconductor device, when the debug information input / output device and the debug host are connected to each other in the first semiconductor device, the product information is written into the product information storage area by a built-in sequencer immediately after startup. It is characterized by that.

また、第4の半導体装置は、第1〜第3の半導体装置において、他の品種は一の品種に比べていずれかの内部資源の領域が制限されており、デバッグ情報入出力装置とデバッグホストとの接続時において、品種情報格納領域に格納された品種情報に基づいて制限された内部資源を判別し、この制限された内部資源の領域へ中央処理装置から書き込みもしくは読み出しのアクセスがあった場合にはこのアクセスを無効アクセスと判断し無視して動作することを特徴とする。   In addition, the fourth semiconductor device is the first to third semiconductor devices, and other types have limited internal resource areas compared to one type, and the debug information input / output device and the debug host. When a restricted internal resource is determined based on the product type information stored in the product type information storage area, and the central processing unit has access to write or read the restricted internal resource area This access is judged to be invalid access and is ignored.

また、第5の半導体装置は、第1〜第3の半導体装置において、他の品種は一の品種に比べていずれかの内部資源の領域が制限されており、デバッグ情報入出力装置とデバッグホストとの接続時において、品種情報格納領域に格納された品種情報に基づいて制限された内部資源を判別し、この制限された内部資源の領域へ中央処理装置から書き込みもしくは読み出しのアクセスがあった場合にはこのアクセスを無効アクセスと判断し、固定値の無効データを書き込みもしくは読み出すように動作することを特徴とする。   In addition, the fifth semiconductor device is the first to third semiconductor devices, and other types have limited internal resource areas compared to one type, and the debug information input / output device and the debug host. When a restricted internal resource is determined based on the product type information stored in the product type information storage area, and the central processing unit has access to write or read the restricted internal resource area This access is judged to be invalid access, and it operates to write or read fixed value invalid data.

また、第6の半導体装置は、第1〜第3の半導体装置において、他の品種は一の品種に比べていずれかの内部資源の領域が制限されており、デバッグ情報入出力装置とデバッグホストとの接続時において、品種情報格納領域に格納された品種情報に基づいて制限された内部資源を判別し、この制限された内部資源の領域へ中央処理装置から書き込みもしくは読み出しのアクセスがあった場合にはこのアクセスを無効アクセスと判断し、ランダムな無効データを書き込みもしくは読み出すように動作することを特徴とする。   In addition, the sixth semiconductor device is the first to third semiconductor devices, and the other resources are limited in the area of any internal resources as compared to the one product, and the debug information input / output device and the debug host. When a restricted internal resource is determined based on the product type information stored in the product type information storage area, and the central processing unit has access to write or read the restricted internal resource area This access is judged to be invalid access, and random invalid data is written or read.

また、第7の半導体装置は、第1〜第6の半導体装置において、他の品種は一の品種に比べていずれかの内部資源の領域が制限されており、デバッグ情報入出力装置とデバッグホストとの接続時において、品種情報格納領域に格納された品種情報に基づいて制限された内部資源を判別し、この制限された内部資源の領域へ中央処理装置から書き込みもしくは読み出しのアクセスがあった場合にはこのアクセスを無効アクセスと判断し、中央処理装置およびデバッグ情報入出力装置のいずれかもしくは両方に無効アクセス検出の情報を伝達するように動作することを特徴とする。   Also, the seventh semiconductor device is the first to sixth semiconductor devices, and the other types have limited internal resource areas compared to the one type, and the debug information input / output device and the debug host When a restricted internal resource is determined based on the product type information stored in the product type information storage area, and the central processing unit has access to write or read the restricted internal resource area This access is determined to be invalid access, and operates to transmit invalid access detection information to one or both of the central processing unit and the debug information input / output device.

また、第8の半導体装置は、第1〜第7の半導体装置において、他の品種は一の品種に比べていずれかの内部資源の領域が制限されており、デバッグ情報入出力装置とデバッグホストとの接続時において、品種情報格納領域に格納された品種情報に基づいて制限された内部資源を判別し、この制限された内部資源の領域を活性化するように中央処理装置から書き込みのアクセスがあった場合にはこのアクセスを無効アクセスと判断し、中央処理装置およびデバッグ情報入出力装置のいずれかもしくは両方に無効アクセス検出の情報を伝達するように動作することを特徴とする。   In addition, the eighth semiconductor device is the first to seventh semiconductor devices, and other types have limited internal resource areas compared to one type, and the debug information input / output device and the debug host When the connection is established, the restricted internal resource is determined based on the product information stored in the product information storage area, and the central processing unit has write access so as to activate the restricted internal resource region. If there is, it is determined that this access is an invalid access, and the operation is performed to transmit invalid access detection information to one or both of the central processing unit and the debug information input / output device.

本発明の第1の半導体装置によれば、外部のデバッグホストと通信するデバッグ情報入出力装置と、シリーズ品のうちの他の品種の品種情報を格納する品種情報格納領域とを設け、デバッグ情報入出力装置とデバッグホストとの接続時において品種情報格納領域に格納された品種情報に基づいて他の品種の動作を代行するようにしたことにより、シリーズ品種のおのおのの半導体装置に対応するエミュレーションチップおよびデバッグ環境を早期かつ安価にデバッガユーザであるセット開発者に提供可能である。   According to the first semiconductor device of the present invention, there is provided a debug information input / output device that communicates with an external debug host, and a product information storage area that stores product information of other products of the series, and includes debug information. Emulation chip corresponding to each semiconductor device of the series product type by performing the operation of other product types based on the product type information stored in the product type information storage area when connecting the I / O device and debug host In addition, it is possible to provide a debugging environment to a set developer who is a debugger user early and inexpensively.

本発明の第2の半導体装置によれば、デバッグホストとの接続時において、デバッグ割込みにより起動され中央処理装置にて実行されるデバッグプログラムにより品種情報格納領域への品種情報の書き込みが行われるので、デバッグホストから品種情報を送りこむことができ、多様なシリーズ品種に対応可能である。   According to the second semiconductor device of the present invention, when connecting to the debug host, the product information is written to the product information storage area by the debug program started by the debug interrupt and executed by the central processing unit. The product information can be sent from the debug host, and it can support various series products.

本発明の第3の半導体装置によれば、デバッグホストとの接続時において、起動直後に内蔵するシーケンサにより品種情報格納領域への品種情報の書き込みが行われるので、半導体装置上に品種情報格納領域とは別に設けられた不揮発性もしくは揮発性の情報格納領域に予め格納した品種情報をデバッグプログラムによらず書き込みを行うことができ、ユーザプログラム実行開始前からシリーズの他の品種の動作を代行することが可能である。   According to the third semiconductor device of the present invention, since the product information is written into the product information storage area by the built-in sequencer immediately after startup when connected to the debug host, the product information storage area on the semiconductor device. The product information stored in the nonvolatile or volatile information storage area provided separately can be written without using the debug program, and the operation of the other products in the series is performed before the start of the user program execution. It is possible.

本発明の第4の半導体装置によれば、デバッグホストとの接続時において、品種情報格納領域に格納された品種情報に基づいて制限された内部資源を判別し、この制限された内部資源の領域へ中央処理装置から書き込みもしくは読み出しのアクセスがあった場合にはこのアクセスを無効アクセスと判断し無視して動作するので、シリーズの他の品種の動作を代行することができ、その品種でのユーザプログラムの振る舞いを再現することが可能である。   According to the fourth semiconductor device of the present invention, at the time of connection with the debug host, the restricted internal resource is determined based on the kind information stored in the kind information storage area, and the restricted internal resource area is determined. When there is a write or read access from the central processing unit, this access is judged as invalid access and the operation is ignored, so that the operation of other products in the series can be performed on behalf of the user of that product type. It is possible to reproduce the behavior of the program.

本発明の第5の半導体装置によれば、デバッグホストとの接続時において、品種情報格納領域に格納された品種情報に基づいて制限された内部資源を判別し、この制限された内部資源の領域へ中央処理装置から書き込みもしくは読み出しのアクセスがあった場合にはこのアクセスを無効アクセスと判断し、固定値の無効データを書き込みもしくは読み出すように動作するので、シリーズの他の品種の動作を代行することができ、制限された内部資源へ誤ってアクセスするユーザプログラムの誤りを検出することが可能である。   According to the fifth semiconductor device of the present invention, at the time of connection with the debug host, the restricted internal resource is determined based on the kind information stored in the kind information storage area, and the restricted internal resource area is determined. When there is a write or read access from the central processing unit to this, it is determined that this access is an invalid access, and it operates to write or read fixed-value invalid data. It is possible to detect errors in user programs that erroneously access restricted internal resources.

本発明の第6の半導体装置によれば、デバッグホストとの接続時において、品種情報格納領域に格納された品種情報に基づいて制限された内部資源を判別し、この制限された内部資源の領域へ中央処理装置から書き込みもしくは読み出しのアクセスがあった場合にはこのアクセスを無効アクセスと判断し、ランダムな無効データを書き込みもしくは読み出すように動作するので、シリーズの他の品種の動作を代行することができ、制限された内部資源へ誤ってアクセスするユーザプログラムの誤りを検出することが可能である。   According to the sixth semiconductor device of the present invention, at the time of connection with the debug host, the restricted internal resource is determined based on the kind information stored in the kind information storage area, and the restricted internal resource area is determined. When there is a write or read access from the central processing unit, this access is judged to be invalid access, and random invalid data is written or read. It is possible to detect an error in a user program that erroneously accesses a limited internal resource.

本発明の第7の半導体装置によれば、デバッグホストとの接続時において、品種情報格納領域に格納された品種情報に基づいて制限された内部資源を判別し、この制限された内部資源の領域へ中央処理装置から書き込みもしくは読み出しのアクセスがあった場合にはこのアクセスを無効アクセスと判断し、中央処理装置およびデバッグ情報入出力装置のいずれかもしくは両方に無効アクセス検出の情報を伝達するように動作するので、シリーズの他の品種の動作を代行することができ、制限された内部資源へ誤ってアクセスするユーザプログラムの誤りを検出することが可能である。   According to the seventh semiconductor device of the present invention, at the time of connection with the debug host, the restricted internal resource is determined based on the kind information stored in the kind information storage area, and the restricted internal resource area is determined. When there is a write or read access from the central processing unit, this access is determined to be invalid access, and invalid access detection information is transmitted to one or both of the central processing unit and debug information input / output device. Since it operates, it is possible to perform operations of other varieties of the series, and it is possible to detect an error of a user program that erroneously accesses a limited internal resource.

本発明の第8の半導体装置によれば、デバッグホストとの接続時において、品種情報格納領域に格納された品種情報に基づいて制限された内部資源を判別し、この制限された内部資源の領域を活性化するように中央処理装置から書き込みのアクセスがあった場合にはこのアクセスを無効アクセスと判断し、中央処理装置およびデバッグ情報入出力装置のいずれかもしくは両方に無効アクセス検出の情報を伝達するように動作するので、シリーズの他の品種の動作を代行することができ、制限された内部資源を誤って活性化するユーザプログラムの誤りを検出することが可能である。   According to the eighth semiconductor device of the present invention, at the time of connection with the debug host, the restricted internal resource is determined based on the product information stored in the product information storage area, and the restricted internal resource area is determined. If there is a write access from the central processing unit so as to activate it, this access is judged as invalid access, and information on invalid access detection is transmitted to one or both of the central processing unit and debug information input / output device. Therefore, it is possible to perform the operations of other varieties of the series, and it is possible to detect an error of the user program that erroneously activates the limited internal resource.

(第1の実施形態)
本発明の第1の実施形態を図1〜5を用いて説明する。
(First embodiment)
A first embodiment of the present invention will be described with reference to FIGS.

図1は本発明の第1の実施形態のマイクロコントローラチップを示している。このマイクロコントローラチップ101は、シリーズのベース品種であり命令ROMとしてフラッシュメモリ(FlashROM103)を内蔵している。セット先行生産時などには内蔵フラッシュメモリ(103)にユーザプログラムを書き込み、最終セットに実装することが可能である。またこのマイクロコントローラチップ101はユーザプログラム開発のためのエミュレーションチップとして用いることも可能である。エミュレーションチップとして用いる場合には、セットもしくはセット相当の配線基板に実装されてデバッグホストと接続しデバッグ情報を入出力する。   FIG. 1 shows a microcontroller chip according to a first embodiment of the present invention. The microcontroller chip 101 is a series base product and incorporates a flash memory (Flash ROM 103) as an instruction ROM. At the time of pre-set production, the user program can be written in the built-in flash memory (103) and mounted in the final set. The microcontroller chip 101 can also be used as an emulation chip for user program development. When used as an emulation chip, it is mounted on a wiring board equivalent to a set or connected to a debug host to input / output debug information.

図2は図1に示したマイクロコントローラのベース品種とそのシリーズ展開品であるマスクROM品種AおよびBにおける、メモリサイズとそのアドレスアップ、周辺回路の有無と各々の制御レジスタのアドレスマップを示している。マスクROM品種AおよびBは命令ROMとしてマスクROMを内蔵しており、量産のおこなわれる最終セットに実装されるものである。   FIG. 2 shows the memory size, its address increase, the presence / absence of peripheral circuits, and the address map of each control register in the base type of the microcontroller shown in FIG. Yes. Mask ROM types A and B have a built-in mask ROM as an instruction ROM, and are mounted on a final set where mass production is performed.

図2に示すように、マスクROM品種Aはベース品種とメモリサイズ、周辺機能とそれらのアドレスマッピングが同一であるが、マスクROM品種Bは相違がある。すなわちマスクROM品種BはメモリサイズがROM,RAMとも半減しアドレスの若い側のみ有効領域であり、また周辺機能についても周辺回路Bが実装されていない。   As shown in FIG. 2, the mask ROM type A has the same base type, memory size, peripheral functions, and their address mapping, but the mask ROM type B differs. That is, the mask ROM type B has a memory size that is halved in both ROM and RAM, and is an effective area only on the younger address side, and no peripheral circuit B is mounted for peripheral functions.

図1に示すように、エミュレーションチップ兼用のベース品種のマイクロコントローラチップ101は、命令を実行することでチップ全体を制御するCPU102と、ユーザプログラムを格納しユーザプログラムの命令をCPU102に供給するFlashROM103と、CPU102とアクセス監視回路109によって制御され内部バス105を制御するバスコントローラ104と、内部バス105を介しCPU102からデータが入出力されるSRAM106と、内部に制御レジスタを備え内部バス105を介しCPU102から制御レジスタに値を設定されることで周辺機能の実行を制御される周辺回路A107および周辺回路B108と、バスコントローラ104を監視するアクセス監視回路109と、CPU102と接続しソフトウエアデバッグ時にデバッグ情報をデバッグホストに入出力するデバッグI/F110とを備える。   As shown in FIG. 1, a microcontroller chip 101 of a base type that also serves as an emulation chip includes a CPU 102 that controls the entire chip by executing instructions, and a Flash ROM 103 that stores user programs and supplies user program instructions to the CPU 102. , A bus controller 104 controlled by the CPU 102 and the access monitoring circuit 109 to control the internal bus 105, an SRAM 106 to which data is input / output from the CPU 102 via the internal bus 105, an internal control register, and from the CPU 102 via the internal bus 105. A peripheral circuit A 107 and a peripheral circuit B 108 whose execution of peripheral functions is controlled by setting a value in the control register, an access monitoring circuit 109 that monitors the bus controller 104, and the CPU 102 are connected to the software. And a debug I / F110 to output the debug information to the debug host during wear debugging.

アクセス監視回路109は、バスコントローラ104を介しマスクROM品種に応じた無効アドレス範囲データが書き込まれる無効アドレステーブル部111と、バスコントローラ104のアクセスしようとする対象アドレスと無効アドレステーブル部111に設定された無効アドレス範囲とを比較するアドレス比較部112とを備える。   The access monitoring circuit 109 is set in the invalid address table unit 111 to which invalid address range data corresponding to the mask ROM type is written via the bus controller 104, and the target address and invalid address table unit 111 to be accessed by the bus controller 104. And an address comparison unit 112 for comparing the invalid address range.

アクセス監視回路109は、無効アドレステーブル部111に無効アドレス範囲データが書き込まれていない場合にはバスコントローラ104のアクセスを監視せずバスコントローラ104に作用せず、無効アドレス範囲データが書き込まれている場合にはバスコントローラ104のアクセスを監視する。   When the invalid address range data is not written in the invalid address table unit 111, the access monitoring circuit 109 does not monitor the access of the bus controller 104 and does not act on the bus controller 104, and the invalid address range data is written. In this case, the access of the bus controller 104 is monitored.

アクセス監視回路109がバスコントローラ104のアクセスを監視し、アドレス比較部112での結果が、バスコントローラ104のアクセスしようとする対象アドレスが無効アドレス範囲外である場合、すなわち有効な領域へのアクセスであった場合にはこれを有効アクセスと判断しバスコントローラ104に作用せず、またバスコントローラ104のアクセスしようとする対象アドレスが無効アドレス範囲内である場合にはこれを無効アクセスと判定し、アクセスが書き込みの場合はこれを無視し対象アドレスへ書き込まないようバスコントローラ104に作用し、またアクセスが読み出しの場合には対象アドレスへの読み出しは行わずCPU102へは無効な読み出し値として固定値のall_0を返すようバスコントローラ104に作用する。   The access monitoring circuit 109 monitors the access of the bus controller 104, and the result of the address comparison unit 112 indicates that the target address to be accessed by the bus controller 104 is outside the invalid address range, that is, the access to the valid area. If there is, it is determined as a valid access and does not act on the bus controller 104, and if the target address to be accessed by the bus controller 104 is within the invalid address range, this is determined as an invalid access and the access is made. When the address is a write, the bus controller 104 is ignored so that it is not written to the target address. When the access is a read, the target address is not read and the CPU 102 does not read the fixed address as an invalid read value. Bus controller 104 to return It acts.

次にマイクロコントローラチップ101の動作を説明する。動作の一例としてマイクロコントローラチップ101のFlashROM103にユーザプログラムが書き込まれており、最終セットに実装されて最終セット上で動作している場合を図3のフロー図を用いて説明する。   Next, the operation of the microcontroller chip 101 will be described. As an example of the operation, a case where a user program is written in the flash ROM 103 of the microcontroller chip 101, mounted in the final set, and operating on the final set will be described with reference to the flowchart of FIG.

図3において、期間301はユーザプログラムの実行が開始されるまでの動作であり、マスクROMマイコンも同一の動作である。   In FIG. 3, a period 301 is an operation until the execution of the user program is started, and the mask ROM microcomputer is the same operation.

期間302はユーザプログラムが周辺回路B108の制御レジスタのアドレスにwrite動作(書き込み動作)を行った場合であり、アクセス監視回路109には無効アドレス範囲データが書き込まれていないためアクセス監視をせず、このwrite動作は通常どおり実行されて周辺回路B108の制御レジスタに値が設定される。   A period 302 is a case where the user program performs a write operation (write operation) on the address of the control register of the peripheral circuit B108. Since invalid address range data is not written in the access monitoring circuit 109, access monitoring is not performed. This write operation is executed as usual, and a value is set in the control register of the peripheral circuit B108.

期間303はユーザプログラムが内蔵SRAM106のアドレス0x00003000番地にread動作(読み出し動作)を行った場合であり、アクセス監視回路109には無効アドレス範囲データが書き込まれていないためアクセス監視をせず、このread動作は通常どおり実行されて内蔵SRAM106のアドレス0x00003000番地に格納されているデータがCPU102に返される。   Period 303 is a case where the user program performs a read operation (read operation) at address 0x00003000 in the built-in SRAM 106. Since the invalid address range data is not written in the access monitoring circuit 109, access monitoring is not performed. The operation is executed as usual, and the data stored at address 0x00003000 of the built-in SRAM 106 is returned to the CPU 102.

マイクロコントローラチップ101の動作の次の例として、マイクロコントローラチップ101がエミュレーションチップとしてセットに実装されておりデバッグホストと接続されエミュレーションチップとして動作し、セット開発者がマスクROM品種A用のソフトウエア開発を行っている場合を図4のフロー図を用いて説明する。   As the next example of the operation of the microcontroller chip 101, the microcontroller chip 101 is mounted on the set as an emulation chip, connected to the debug host and operates as an emulation chip, and the set developer develops software for the mask ROM type A The case of performing the above will be described with reference to the flowchart of FIG.

図4において、期間401はユーザプログラムの実行が開始されるまでの動作であり、マスクROMマイコンも同一の動作である。   In FIG. 4, a period 401 is an operation until the execution of the user program is started, and the mask ROM microcomputer is the same operation.

期間402はユーザプログラム実行中にデバッグI/F110を通じデバッグホストからデバッグ割込みがかかっており、この期間において品種情報としてマスクROM品種Aの無効アドレス範囲データがデバッグホストよりデバッグI/F110およびCPU102を経由して送り込まれバスコントローラ104を介しアクセス監視回路109に書き込まれる。   During a period 402, a debug interrupt is issued from the debug host through the debug I / F 110 during execution of the user program. During this period, the invalid address range data of the mask ROM type A passes from the debug host via the debug I / F 110 and the CPU 102 as the type information. Is sent to the access monitoring circuit 109 via the bus controller 104.

上記の品種情報とは、内部資源であるメモリや周辺回路の有無もしくは有効アドレス範囲を表すものである。例えば、内蔵メモリであれば容量の違いにより、大容量品にくらべ、小容量品では上位にマッピングされた該当空間が無効になるので、このような無効空間/有効空間の情報が品種情報になる。また、ROM品種Bのように、周辺回路Bが実装されていない場合では、この周辺回路Bのアドレスマッピングが無効という情報が品種情報になる。   The product type information represents the presence or absence of an internal resource such as a memory or a peripheral circuit, or an effective address range. For example, in the case of a built-in memory, due to the difference in capacity, the corresponding space mapped at the upper level becomes invalid in a small-capacity product compared to a large-capacity product, so such invalid space / effective space information becomes product type information. . Further, when the peripheral circuit B is not mounted as in the ROM type B, information that the address mapping of the peripheral circuit B is invalid becomes the type information.

ここでアクセス監視回路109は無効アドレス範囲データが書き込まれたので無効アドレステーブル部111にマスクROM品種Aの無効アドレス範囲が設定されバスコントローラ104の動作を監視する。   Here, since the invalid address range data is written, the access monitoring circuit 109 sets the invalid address range of the mask ROM type A in the invalid address table unit 111 and monitors the operation of the bus controller 104.

期間403はユーザプログラムが周辺回路B108の制御レジスタのアドレスにwrite動作を行った場合であり、アクセス監視回路109はアクセスを監視しているが、このwrite動作はマスクROM品種Aで有効なアドレスへのアクセスなのでアクセス監視回路109は有効アクセスと判断しバスコントローラ104に作用しないので、このwrite動作は通常どおり実行され周辺回路B108の制御レジスタに値が設定される。   The period 403 is a case where the user program performs a write operation on the address of the control register of the peripheral circuit B108, and the access monitoring circuit 109 monitors the access, but this write operation is performed to an address effective in the mask ROM type A. Since the access monitoring circuit 109 determines that the access is valid and does not act on the bus controller 104, this write operation is executed as usual and a value is set in the control register of the peripheral circuit B108.

期間404はユーザプログラムが内蔵SRAM106のアドレス0x00003000番地にread動作を行った場合であり、アクセス監視回路109はアクセスを監視しているが、このread動作はマスクROM品種Aで有効なアドレスへのアクセスなのでアクセス監視回路109は有効アクセスと判断しバスコントローラ104に作用しないので、このread動作は通常どおり実行され内蔵SRAM106のアドレス0x00003000番地に格納されているデータがCPU102に返される。   Period 404 is a case where the user program performs a read operation at address 0x00003000 of the built-in SRAM 106, and the access monitoring circuit 109 monitors the access, but this read operation is an access to an address effective in the mask ROM type A. Therefore, the access monitoring circuit 109 determines that the access is valid and does not act on the bus controller 104. Therefore, this read operation is executed as usual, and the data stored at address 0x00003000 in the built-in SRAM 106 is returned to the CPU 102.

マイクロコントローラチップ101のエミュレーションチップ動作の次の例として、マイクロコントローラチップ101がエミュレーションチップとしてセットに実装されており、デバッグホストと接続され、セット開発者がマスクROM品種B用のソフトウエア開発を行っている場合を図5のフロー図を用いて説明する。   As the next example of the emulation chip operation of the microcontroller chip 101, the microcontroller chip 101 is mounted on the set as an emulation chip, connected to the debug host, and the set developer develops software for the mask ROM type B This case will be described with reference to the flowchart of FIG.

図5において、期間501はユーザプログラムの実行が開始されるまでの動作であり、マスクROMマイコンと同一の動作である。   In FIG. 5, a period 501 is an operation until the execution of the user program is started, and is the same operation as the mask ROM microcomputer.

期間502はユーザプログラム実行中にデバッグI/F110を通じデバッグホストからデバッグ割込みがかかっており、この期間において品種情報としてマスクROM品種Bの無効アドレス範囲データがデバッグホストよりデバッグI/F110およびCPU102を経由して送り込まれバスコントローラ104を介しアクセス監視回路109に書き込まれる。   During a period 502, a debug interrupt is issued from the debug host through the debug I / F 110 during execution of the user program. During this period, the invalid address range data of the mask ROM type B passes from the debug host via the debug I / F 110 and the CPU 102 as the type information. Is sent to the access monitoring circuit 109 via the bus controller 104.

ここでアクセス監視回路109は無効アドレス範囲データが書き込まれたので無効アドレステーブル部111にマスクROM品種Bの無効アドレス範囲が設定されバスコントローラ104の動作を監視する。   Here, since the invalid address range data is written, the access monitoring circuit 109 sets the invalid address range of the mask ROM type B in the invalid address table unit 111 and monitors the operation of the bus controller 104.

期間503はユーザプログラムのデバッグが未完了なため誤って周辺回路B108の制御レジスタのアドレスにwrite動作を行った場合であり、アクセス監視回路109はアクセスを監視しており、このwrite動作がマスクROM品種Bには実装されていない無効アドレスへのアクセスなのでアクセス監視回路109は無効アクセスと判断しバスコントローラ104にwrite動作を実行しないように作用する。したがってこのwrite動作は無視され周辺回路B108の制御レジスタには値が設定されず初期状態のままとなる。   The period 503 is a case where the user program has not been debugged yet, so that the write operation is erroneously performed on the address of the control register of the peripheral circuit B108. The access monitoring circuit 109 monitors the access, and this write operation is performed by the mask ROM. Since the access is to an invalid address that is not mounted in the product type B, the access monitoring circuit 109 determines that the access is invalid and acts on the bus controller 104 not to execute the write operation. Therefore, this write operation is ignored and no value is set in the control register of the peripheral circuit B108, and the initial state remains unchanged.

期間504はユーザプログラムのデバッグが未完了なため誤って内蔵SRAM106のアドレス0x00003000番地にread動作を行った場合であり、アクセス監視回路109はアクセスを監視しており、このread動作がマスクROM品種Bには実装されていない無効アドレスへのアクセスなのでアクセス監視回路109は無効アクセスと判断しバスコントローラ104にread動作を実行しないように作用する。したがってこのread動作は無視され内蔵SRAM106へはread動作が行われず、CPU102へは無効データが返される。   A period 504 is a case where the user program has not been debugged yet and the read operation is erroneously performed at address 0x00003000 in the built-in SRAM 106. The access monitoring circuit 109 monitors the access, and this read operation is the mask ROM type B. The access monitoring circuit 109 determines that the access is invalid and does not execute the read operation on the bus controller 104 because the access is to an invalid address that is not implemented in the. Therefore, this read operation is ignored, the read operation is not performed to the built-in SRAM 106, and invalid data is returned to the CPU 102.

なお、有効アドレスへのアクセスの場合には、アクセス監視回路109は有効アクセスと判断しバスコントローラ104に作用せず、バスコントローラ104は通常どおり動作する。   In the case of accessing a valid address, the access monitoring circuit 109 determines that the access is valid and does not act on the bus controller 104, and the bus controller 104 operates normally.

以上のように動作することで、上記マイクロコントローラチップ101はベース品種としての動作をすることができ、エミュレーションチップとしてデバッグホストと接続している場合にはデバッグ割込みにより品種情報をアクセス監視回路109に設定することでマスクROM品種AもしくはBの機能を代行することができる。   By operating as described above, the microcontroller chip 101 can operate as a base product, and when connected to a debug host as an emulation chip, product information is sent to the access monitoring circuit 109 by a debug interrupt. By setting, the function of the mask ROM type A or B can be substituted.

マスクROM品種Bの機能を代行している場合にはマスクROM品種Bと同じく無効アドレスへのwriteを無視し無効アドレスへのreadに対しては無効データを返すので、セットのソフトウエア開発者はマスクROM品種Bでのプログラムの振る舞いを知ることができ、量産セットにマスクROM品種を適用した際の不具合を事前に防止することが可能である。   If the function of the mask ROM type B is substituted, the write to the invalid address is ignored and the invalid data is returned for the read to the invalid address as with the mask ROM type B. It is possible to know the behavior of the program in the mask ROM type B, and it is possible to prevent in advance problems when the mask ROM type is applied to the mass production set.

なお上記の構成においては品種情報として無効アドレス範囲データをデバッグホストから転送するようにしたが、フラッシュメモリなどに不揮発に保持したり、チップ上に揮発的に品種情報を保持する手段を設けデバッグに先立ち品種情報を設定しておく構成としても同等の効果が得られる。   In the above configuration, invalid address range data is transferred from the debug host as product type information, but it is stored in a flash memory or the like in a non-volatile manner, or a means for holding product type information volatilely on the chip is provided for debugging. The same effect can be obtained even when the product information is set in advance.

また上記の構成においては品種により異なる無効アドレス範囲データを無効アドレステーブル部111に転送し格納するようにしたが、品番情報を転送し品番情報から無効アドレス範囲データをデコードする構成とすることも可能である。   In the above configuration, invalid address range data that varies depending on the product type is transferred and stored in the invalid address table unit 111. However, it is also possible to transfer the product number information and decode the invalid address range data from the product number information. It is.

また上記の構成においては説明の簡略化のため、命令ROMおよびSRAMをそれぞれ1個ずつ、また周辺回路を2個搭載しているが、各要素が1つもしくは複数持つ構成や要素によっては搭載しない構成とすることも可能である。   In the above configuration, for simplicity of explanation, one instruction ROM and one SRAM and two peripheral circuits are mounted. However, depending on the configuration or elements each element has one or more, it is not mounted. A configuration is also possible.

また上記の構成においては無効データを固定値のall_0としたがその他の任意の固定値でも同等の効果が得られる。   In the above configuration, the invalid data is set to the fixed value all_0, but the same effect can be obtained with any other fixed value.

また上記の構成においては無効アクセスの際に対象アドレスへのread動作を行わないようにしたが、対象アドレスへのread動作を行いCPU102へは無効データを返す構成としてもよい。   Further, in the above configuration, the read operation to the target address is not performed at the time of invalid access, but the read operation to the target address may be performed and invalid data may be returned to the CPU 102.

また上記の構成においては無効アクセスの際に対象アドレスへのwrite動作を行わないようにしたが、対象アドレスへ固定値の無効データのwrite動作を行う構成としてもよい。   Further, in the above configuration, the write operation to the target address is not performed at the time of invalid access, but the configuration may be such that the write operation of fixed value invalid data to the target address is performed.

また上記の構成においてはユーザプログラムの実行開始後にデバッグホストからデバッグ割込みをかけて品種情報を転送しているが、ユーザプログラム実行前にデバッグホストよりデバッグ割込みをかけ品種情報を転送する構成にしてもよい。   In the above configuration, the product information is transferred from the debug host after the start of execution of the user program, but the product information is transferred from the debug host before execution of the user program. Good.

(第2の実施形態)
本発明の第2の実施形態を図6〜7を用いて説明する。
(Second Embodiment)
A second embodiment of the present invention will be described with reference to FIGS.

図6は本発明の第2の実施形態のマイクロコントローラチップを示している。このマイクロコントローラチップ601は、マイクロコントローラチップ101同様、シリーズのベース品種であり命令ROMとしてフラッシュメモリ(FlashROM603)を内蔵し、最終セットに実装することが可能であるとともに、ユーザプログラム開発のためのエミュレーションチップとして用いることも可能である。   FIG. 6 shows a microcontroller chip according to a second embodiment of the present invention. Like the microcontroller chip 101, this microcontroller chip 601 is a base product of the series and has a built-in flash memory (FlashROM 603) as an instruction ROM, which can be mounted in the final set and is an emulation for user program development. It can also be used as a chip.

図6に示すように、エミュレーションチップ兼用のベース品種のマイクロコントローラチップ601は、バスコントローラ104の動作を監視するアクセス監視回路602と、ユーザプログラムを格納するユーザROM領域604とマスクROM品種の無効アドレス範囲データを格納する品種データ領域605を備えユーザプログラムの命令をCPU608に供給するFlashROM603と、FlashROM603の品種データ領域605に格納されている無効アドレス範囲データをアクセス監視回路602に自動転送するシーケンサ606と、デバッグホストとの接続状況をシーケンサ606に伝達し、CPU608と接続しソフトウエアデバッグ時にデバッグ情報をデバッグホストに入出力するデバッグI/F607と、シーケンサ606によりプログラムカウンタのカウント開始抑制を制御され、命令を実行することでチップ全体を制御するCPU608と、そのほかにマイクロコントローラチップ101と同様の構成要素(105、106、107、108)とを備える。   As shown in FIG. 6, the microcontroller chip 601 of the base type also serving as an emulation chip includes an access monitoring circuit 602 that monitors the operation of the bus controller 104, a user ROM area 604 that stores a user program, and an invalid address of the mask ROM type. A flash ROM 603 having a product type data area 605 for storing range data and supplying user program instructions to the CPU 608; a sequencer 606 for automatically transferring invalid address range data stored in the product data area 605 of the flash ROM 603 to the access monitoring circuit 602; A debug I / F 607 that transmits the connection status with the debug host to the sequencer 606, connects to the CPU 608, and inputs / outputs debug information to / from the debug host during software debugging, 606 is controlled count start suppression of the program counter by comprises a CPU608 for controlling the entire chip by executing the instruction, the same components (105, 106, 107, 108) and the microcontroller chip 101 to other.

シーケンサ606は、マイクロコントローラチップ601がデバッグホストに接続されている場合に起動し、ユーザプログラム実行開始までにFlashROM603の品種データ領域605に格納されている無効アドレス範囲データをアクセス監視回路602に転送する。   The sequencer 606 is activated when the microcontroller chip 601 is connected to the debug host, and transfers invalid address range data stored in the product data area 605 of the Flash ROM 603 to the access monitoring circuit 602 until the start of user program execution. .

アクセス監視回路602は、シーケンサ606により内部バス105を介しマスクROM品種に応じた無効アドレス範囲が書き込まれる無効アドレステーブル部609と、バスコントローラ104のアクセスしようとするアドレスと無効アドレステーブル部609に設定された無効アドレス範囲と比較するアドレス比較部610とを備える。   The access monitoring circuit 602 sets the invalid address table unit 609 to which an invalid address range corresponding to the mask ROM type is written via the internal bus 105 by the sequencer 606, and the address to be accessed by the bus controller 104 and the invalid address table unit 609. And an address comparison unit 610 that compares the invalid address range.

アクセス監視回路602は、無効アドレステーブル部609に無効アドレス範囲データが書き込まれていない場合にはバスコントローラ104のアクセスを監視せずバスコントローラ104に作用せず、無効アドレス範囲データが書き込まれている場合にはバスコントローラ104のアクセスを監視する。   When the invalid address range data is not written in the invalid address table unit 609, the access monitoring circuit 602 does not monitor the access of the bus controller 104 and does not act on the bus controller 104, and the invalid address range data is written. In this case, the access of the bus controller 104 is monitored.

アクセス監視回路602がバスコントローラ104のアクセスを監視し、アドレス比較部610での結果が、バスコントローラ104のアクセスしようとするアドレスが無効アドレス範囲外である場合、すなわち有効な領域へのアクセスであった場合にはこれを有効アクセスと判断しバスコントローラ104に作用せず、またバスコントローラ104のアクセスしようとするアドレスが無効アドレス範囲内である場合にはこれを無効アクセスと判定し、無効アドレスへの書き込みの場合はこれを無視し対象アドレスへ書き込まないようバスコントローラ104に作用し、また無効アドレスの読み出しの場合には対象アドレスへの読み出しは行わずCPU608へは無効な読み出し値として固定値のall_0を返すようバスコントローラ104に作用する。   The access monitoring circuit 602 monitors the access of the bus controller 104, and the result of the address comparison unit 610 indicates that the address to be accessed by the bus controller 104 is outside the invalid address range, that is, an access to a valid area. If the address is determined to be valid access and does not act on the bus controller 104, and the address to be accessed by the bus controller 104 is within the invalid address range, this is determined to be invalid access and the invalid address is set. In the case of writing, the bus controller 104 is ignored so that it is not written to the target address. In the case of reading an invalid address, the target address is not read and the CPU 608 has a fixed value as an invalid read value. bus controller 10 to return all_0 Acting on.

次にマイクロコントローラチップ601の動作を説明する。マイクロコントローラチップ601のFlashROM603にユーザプログラムが書き込まれており、最終セットに実装されて最終セット上で動作している場合については、マイクロコントローラチップ101と同様である。   Next, the operation of the microcontroller chip 601 will be described. The case where the user program is written in the flash ROM 603 of the microcontroller chip 601 and is mounted on the final set and is operating on the final set is the same as that of the microcontroller chip 101.

マイクロコントローラチップ601のエミュレーションチップ動作の例として、マイクロコントローラチップ601がエミュレーションチップとしてセットに実装されており、デバッグホストと接続され、セット開発者が図2に示したマスクROM品種B用のソフトウエア開発を行っている場合を図7のフロー図を用いて説明する。なお、セットデバッグに先立ちFlashROM603の品種データ領域605にはマスクROM品種Bの品種情報がROMライタなどで書き込まれており、品種情報は不揮発に保持されている。   As an example of the emulation chip operation of the microcontroller chip 601, the microcontroller chip 601 is mounted on the set as an emulation chip, connected to the debug host, and the set developer uses the software for the mask ROM type B shown in FIG. A case where development is performed will be described with reference to the flowchart of FIG. Prior to set debugging, the type information of the mask ROM type B is written in the type data area 605 of the flash ROM 603 by a ROM writer or the like, and the type information is held in a nonvolatile manner.

図7において、期間701はユーザプログラムの実行が開始されるまでの動作であり、マイクロコントローラチップ601がデバッグホストと接続されていることがデバッグI/F607により検出されるため内部リセット解除直後にシーケンサ606が起動する。   In FIG. 7, a period 701 is an operation until the execution of the user program is started. Since the debug I / F 607 detects that the microcontroller chip 601 is connected to the debug host, the sequencer immediately after the internal reset is released. 606 starts.

期間702では、シーケンサ606の起動によりシーケンサ606は、CPU608のプログラムカウンタのカウント開始を抑制し、プログラムカウント抑制中にFlashROM603の品種データ領域605に格納されているマスクROM品種Bの無効アドレス範囲データを内部バス105を介し転送しアクセス監視回路602に書き込む。アクセス監視回路602は無効アドレス範囲データが書き込まれたのでマスクROM品種Bに応じた無効アドレス範囲が無効アドレステーブル部609に設定され、バスコントローラ104の動作を監視する。アクセス監視回路602への無効アドレス範囲データの転送が完了するとシーケンサ606はCPU608のプログラムカウンタのカウント開始抑制を解除するので、CPU608はユーザプログラムの実行を開始する。   In the period 702, the sequencer 606 suppresses the start of counting of the program counter of the CPU 608 by the activation of the sequencer 606, and the invalid address range data of the mask ROM type B stored in the type data area 605 of the FlashROM 603 during the program count suppression. The data is transferred via the internal bus 105 and written to the access monitoring circuit 602. Since the invalid address range data is written, the access monitoring circuit 602 sets the invalid address range corresponding to the mask ROM type B in the invalid address table unit 609 and monitors the operation of the bus controller 104. When the transfer of the invalid address range data to the access monitoring circuit 602 is completed, the sequencer 606 cancels the count start suppression of the program counter of the CPU 608, so the CPU 608 starts executing the user program.

期間703はユーザプログラムのデバッグが未完了なため誤って周辺回路B108の制御レジスタのアドレスにwrite動作を行った場合であり、アクセス監視回路602はアクセスを監視しており、このwrite動作がマスクROM品種Bには実装されていない無効アドレスへのアクセスなのでアクセス監視回路602は無効アクセスと判断しバスコントローラ104にwrite動作を実行しないように作用する。したがってこのwrite動作は無視され周辺回路B108の制御レジスタには値が設定されず初期状態のままとなる。   The period 703 is a case where the user program has not been debugged yet, so that the write operation is erroneously performed on the address of the control register of the peripheral circuit B108. The access monitoring circuit 602 monitors the access, and this write operation is performed by the mask ROM. Since the access is to an invalid address that is not mounted in the product type B, the access monitoring circuit 602 determines that the access is invalid and acts on the bus controller 104 not to execute the write operation. Therefore, this write operation is ignored and no value is set in the control register of the peripheral circuit B108, and the initial state remains unchanged.

期間704はユーザプログラムのデバッグが未完了なため誤って内蔵SRAM106のアドレス0x00003000番地にread動作を行った場合であり、アクセス監視回路602はアクセスを監視しており、このread動作がマスクROM品種Bには実装されていない無効アドレスへのアクセスなのでアクセス監視回路602は無効アクセスと判断しバスコントローラ104にread動作を実行しないように作用する。したがってこのread動作は無視され内蔵SRAM106へはread動作が行われず、CPU608へは無効データを返す。   The period 704 is a case where the user program has not been debugged yet, so that the read operation is mistakenly performed at the address 0x00003000 of the built-in SRAM 106. The access monitoring circuit 602 monitors the access. The access monitoring circuit 602 determines that the access is invalid, and thus does not execute the read operation on the bus controller 104. Therefore, this read operation is ignored, the read operation is not performed on the built-in SRAM 106, and invalid data is returned to the CPU 608.

なお、有効アドレスへのアクセスの場合には、アクセス監視回路602は有効アクセスと判断しバスコントローラ104に作用せずバスコントローラ104は通常どおり動作する。   In the case of accessing a valid address, the access monitoring circuit 602 determines that the access is valid and does not act on the bus controller 104, and the bus controller 104 operates normally.

以上のように動作することで、上記マイクロコントローラチップ601はベース品種としての動作をすることができ、エミュレーションチップとしてデバッグホストと接続している場合にはユーザプログラム実行前に自動で品種情報を設定するのでマスクROM品種AもしくはBの機能を代行することができる。   By operating as described above, the microcontroller chip 601 can operate as a base product, and when connected to a debug host as an emulation chip, product information is automatically set before executing a user program. Therefore, the function of the mask ROM type A or B can be substituted.

マスクROM品種Bの機能を代行している場合にはマスクROM品種Bと同じく無効アドレスへのwriteを無視し無効アドレスへのreadに対しては無効データを返すので、セットのソフトウエア開発者はマスクROM品種Bでのプログラムの振る舞いを知ることができ、量産セットにマスクROM品種を適用した際の不具合を事前に防止することが可能である。   If the function of the mask ROM type B is substituted, the write to the invalid address is ignored and the invalid data is returned for the read to the invalid address as with the mask ROM type B. It is possible to know the behavior of the program in the mask ROM type B, and it is possible to prevent in advance problems when the mask ROM type is applied to the mass production set.

なお上記の構成においては品種情報をフラッシュメモリに不揮発に保持する構成としたが、揮発的に品種情報を保持する手段を備えシーケンサ606の起動前にデバッグホストから直接品種情報をこの保持手段に設定するようにしても同等の効果が得られる。   In the above configuration, the product information is stored in the flash memory in a nonvolatile manner. However, the product information is volatilely stored, and the product information is directly set from the debug host before the sequencer 606 is started. Even if this is done, the same effect can be obtained.

また上記の構成においては品種により異なる無効アドレス範囲データを無効アドレステーブル部609に転送し格納するようにしたが、品番情報を転送し品番情報から無効アドレス範囲データをデコードする構成とすることも可能である。   In the above configuration, invalid address range data that differs depending on the product type is transferred and stored in the invalid address table unit 609. However, it is also possible to transfer the product number information and decode the invalid address range data from the product number information. It is.

また上記の構成においては説明の簡略化のため、命令ROMおよびSRAMをそれぞれ1個ずつ、また周辺回路を2個搭載しているが、各要素が1つもしくは複数持つ構成や要素によっては搭載しない構成とすることも可能である。   In the above configuration, for simplicity of explanation, one instruction ROM and one SRAM and two peripheral circuits are mounted. However, depending on the configuration or elements each element has one or more, it is not mounted. A configuration is also possible.

また上記の構成においては無効データを固定値のall_0としたがその他の任意の固定値でも同等の効果が得られる。   In the above configuration, the invalid data is set to the fixed value all_0, but the same effect can be obtained with any other fixed value.

また上記の構成においては無効アクセスの際に対象アドレスへのread動作を行わないようにしたが、対象アドレスへのread動作を行いCPU608へは無効データを返す構成としてもよい。   In the above configuration, the read operation to the target address is not performed at the time of invalid access. However, the read operation to the target address may be performed and invalid data may be returned to the CPU 608.

また上記の構成においては無効アクセスの際に対象アドレスへのwrite動作を行わないようにしたが、対象アドレスへ固定値の無効データのwrite動作を行う構成としてもよい。   Further, in the above configuration, the write operation to the target address is not performed at the time of invalid access, but the configuration may be such that the write operation of fixed value invalid data to the target address is performed.

また上記の構成においてはデバッグホスト接続時の内部リセット解除後にシーケンサ606を起動しているが、デバッグホスト接続時の内部リセット解除前に内部リセットとは無関係にシーケンサ606を起動する構成にしてもよい。   In the above configuration, the sequencer 606 is activated after the internal reset is released when the debug host is connected. However, the sequencer 606 may be activated before the internal reset is released when the debug host is connected. .

(第3の実施形態)
本発明の第3の実施形態を図8〜9を用いて説明する。
(Third embodiment)
A third embodiment of the present invention will be described with reference to FIGS.

図8は本発明の第3の実施形態のマイクロコントローラチップを示している。このマイクロコントローラチップ801は、マイクロコントローラチップ101同様、シリーズのベース品種であり命令ROMとしてフラッシュメモリ(FlashROM103)を内蔵し、最終セットに実装することが可能であるとともに、ユーザプログラム開発のためのエミュレーションチップとして用いることも可能である。   FIG. 8 shows a microcontroller chip according to a third embodiment of the present invention. Like the microcontroller chip 101, this microcontroller chip 801 is a base product of the series and incorporates a flash memory (Flash ROM 103) as an instruction ROM, can be mounted in the final set, and is an emulation for user program development. It can also be used as a chip.

図8に示すように、エミュレーションチップ兼用のベース品種のマイクロコントローラチップ801は、CPU102とアクセス監視回路803によって制御され内部バス105を制御するバスコントローラ802と、乱数発生器804を持ちバスコントローラ802の動作を監視するアクセス監視回路803と、そのほかにマイクロコントローラチップ101と同様の構成要素(102、103、105、106、107、108、110)とを備える。   As shown in FIG. 8, a microcontroller chip 801 of the base type that also serves as an emulation chip includes a bus controller 802 that is controlled by the CPU 102 and the access monitoring circuit 803 to control the internal bus 105, a random number generator 804, and a bus controller 802. An access monitoring circuit 803 that monitors the operation and other components (102, 103, 105, 106, 107, 108, 110) similar to the microcontroller chip 101 are provided.

アクセス監視回路803は、乱数発生器804と、内部バス105を介しマスクROM品種に応じた無効アドレス範囲データが書き込まれる無効アドレステーブル部805と、バスコントローラ802のアクセスしようとするアドレスと無効アドレステーブル部805に設定された無効アドレス範囲とを比較するアドレス比較部806とを備える。   The access monitoring circuit 803 includes a random number generator 804, an invalid address table unit 805 to which invalid address range data corresponding to the mask ROM type is written via the internal bus 105, and an address and invalid address table to be accessed by the bus controller 802. An address comparison unit 806 that compares the invalid address range set in the unit 805.

アクセス監視回路803は、無効アドレステーブル部805に無効アドレス範囲データが書き込まれていない場合にはバスコントローラ802のアクセスを監視せずバスコントローラ802に作用せず、無効アドレス範囲データが書き込まれている場合にはバスコントローラ802のアクセスを監視する。   When the invalid address range data is not written in the invalid address table unit 805, the access monitoring circuit 803 does not monitor the access of the bus controller 802 and does not act on the bus controller 802, and invalid address range data is written. In this case, the access of the bus controller 802 is monitored.

アクセス監視回路803がバスコントローラ802のアクセスを監視し、アドレス比較部806での結果が、バスコントローラ802のアクセスしようとするアドレスが無効アドレス範囲外である場合、すなわち有効な領域へのアクセスであった場合にはこれを有効アクセスと判断しバスコントローラ802に作用せず、またバスコントローラ802のアクセスしようとするアドレスが無効アドレス範囲内である場合にはこれを無効アクセスと判定し、無効アドレスへの書き込みの場合はこれを無視し対象アドレスへ書き込まないようバスコントローラ802に作用し、また無効アドレスの読み出しの場合には対象アドレスへの読み出しは行わず無効な読み出し値として内蔵する乱数発生器804が都度発生するランダムな値をCPU102へ返すようバスコントローラ802に作用する。   The access monitoring circuit 803 monitors the access of the bus controller 802, and the result of the address comparison unit 806 indicates that the address to be accessed by the bus controller 802 is outside the invalid address range, that is, an access to a valid area. If it is determined that the access is valid, it does not act on the bus controller 802, and if the address to be accessed by the bus controller 802 is within the invalid address range, it is determined that the access is invalid and the invalid address is entered. In the case of writing, the bus controller 802 is ignored so that it is not written to the target address. In the case of reading the invalid address, the random number generator 804 is built in as an invalid read value without reading the target address. Is a random value that occurs each time the CPU 102 Acting on the bus controller 802 to return.

次にマイクロコントローラチップ801の動作を説明する。マイクロコントローラチップ801の内蔵フラッシュメモリにユーザプログラムが書き込まれており、最終セットに実装されて最終セット上で動作している場合については、マイクロコントローラチップ101と同様である。   Next, the operation of the microcontroller chip 801 will be described. The case where the user program is written in the built-in flash memory of the microcontroller chip 801, mounted in the final set, and operating on the final set is the same as that of the microcontroller chip 101.

マイクロコントローラチップ801のエミュレーションチップ動作の例として、マイクロコントローラチップ801がエミュレーションチップとしてセットに実装されており、デバッグホストと接続され、セット開発者が図2に示したマスクROM品種B用のソフトウエア開発を行っている場合を図9のフロー図を用いて説明する。   As an example of the emulation chip operation of the microcontroller chip 801, the microcontroller chip 801 is mounted as an emulation chip in a set, connected to a debug host, and the set developer uses the software for the mask ROM type B shown in FIG. A case where development is performed will be described with reference to the flowchart of FIG.

図9において、期間901はユーザプログラムの実行が開始されるまでの動作であり、マスクROMマイコンと同一の動作である。   In FIG. 9, a period 901 is an operation until the execution of the user program is started, and is the same operation as the mask ROM microcomputer.

期間902はユーザプログラム実行中にデバッグI/F110を通じデバッグホストからデバッグ割込みがかかっており、この期間において品種情報としてマスクROM品種Bの無効アドレス範囲データがデバッグホストよりデバッグI/F110およびCPU102を経由して送り込まれバスコントローラ802を介しアクセス監視回路803に書き込まれる。アクセス監視回路803は無効アドレス範囲データが書き込まれたのでマスクROM品種Bに応じた無効アドレス範囲が無効アドレステーブル部805に設定され、バスコントローラ802の動作を監視する。   During a period 902, a debug interrupt is received from the debug host through the debug I / F 110 during execution of the user program. During this period, the invalid address range data of the mask ROM type B passes from the debug host via the debug I / F 110 and the CPU 102 as the type information. Are sent to the access monitoring circuit 803 via the bus controller 802. Since the invalid address range data is written, the access monitoring circuit 803 sets the invalid address range corresponding to the mask ROM type B in the invalid address table unit 805 and monitors the operation of the bus controller 802.

期間903はユーザプログラムのデバッグが未完了なため誤って周辺回路B108の制御レジスタのアドレスにwrite動作を行った場合であり、アクセス監視回路803はアクセスを監視しており、このwrite動作がマスクROM品種Bには実装されていない無効アドレスへのアクセスなのでアクセス監視回路803は無効アクセスと判断しバスコントローラ802にwrite動作を実行しないように作用する。したがってこのwrite動作は無視され周辺回路B108の制御レジスタには値が設定されず初期状態のままとなる。   A period 903 is a case where the write operation is erroneously performed on the address of the control register of the peripheral circuit B 108 because debugging of the user program is not completed. The access monitoring circuit 803 monitors the access, and this write operation is performed by the mask ROM. Since the access is to an invalid address that is not mounted in the product type B, the access monitoring circuit 803 determines that the access is invalid and acts on the bus controller 802 not to execute the write operation. Therefore, this write operation is ignored and no value is set in the control register of the peripheral circuit B108, and the initial state remains unchanged.

期間904はユーザプログラムのデバッグが未完了なため誤って内蔵SRAM106のアドレス0x00003000番地にread動作を行った場合であり、アクセス監視回路803はアクセスを監視しており、このread動作がマスクROM品種Bには実装されていない無効アドレスへのアクセスなのでアクセス監視回路803は無効アクセスと判断しバスコントローラ802にread動作を実行しないように作用する。したがって内蔵SRAM106へはread動作が行われず、CPU102へは乱数発生器804の生成するランダム値が無効データとして転送される。   A period 904 is a case where the user program has not been debugged yet, so that the read operation is mistakenly performed at the address 0x00003000 of the built-in SRAM 106. The access monitoring circuit 803 monitors the access. The access monitoring circuit 803 determines that the access is invalid and does not execute the read operation on the bus controller 802 because the access is to an invalid address that is not implemented in the. Therefore, the read operation is not performed on the built-in SRAM 106, and the random value generated by the random number generator 804 is transferred to the CPU 102 as invalid data.

なお、有効アドレスへのアクセスの場合には、アクセス監視回路803は有効アクセスと判断しバスコントローラ802に作用せず、バスコントローラ802は通常どおり動作する。   In the case of accessing a valid address, the access monitoring circuit 803 determines that the access is valid and does not act on the bus controller 802, and the bus controller 802 operates normally.

以上のように動作することで、上記マイクロコントローラチップ801はベース品種としての動作をすることができ、エミュレーションチップとしてデバッグホストと接続している場合にはデバッグ割込みにより品種情報を転送することでマスクROM品種AもしくはBの機能を代行することができる。   By operating as described above, the microcontroller chip 801 can operate as a base product, and when connected to a debug host as an emulation chip, mask information can be obtained by transferring product information by a debug interrupt. The function of ROM type A or B can be substituted.

マスクROM品種Bの機能を代行している場合にはマスクROM品種Bと同じく無効アドレスへのwriteを無視し無効アドレスへのreadに対しては無効データとしてランダム値を返すので、セットのソフトウエア開発者はマスクROM品種Bでのプログラムの振る舞いを知ることができ、また無効なread動作をした場合には第1、第2の実施形態とは異なり対象アドレスからはランダム値が読み出されるように動作するのでプログラムミスを発見しやすくなり、量産セットにマスクROM品種を適用した際の不具合を事前に防止することが可能である。   If the function of the mask ROM type B is substituted, the write to the invalid address is ignored as in the mask ROM type B, and a random value is returned as invalid data for the read to the invalid address. The developer can know the behavior of the program in the mask ROM type B, and when an invalid read operation is performed, a random value is read from the target address unlike the first and second embodiments. Since it operates, it becomes easy to find a program error, and it is possible to prevent in advance problems when a mask ROM type is applied to a mass production set.

なお上記の構成においては品種情報として無効アドレス範囲データをデバッグホストから転送するようにしたが、フラッシュメモリなどに不揮発に保持したり、チップ上に揮発的に品種情報を保持する手段を設けデバッグに先立ち品種情報を設定しておく構成としても同等の効果が得られる。   In the above configuration, invalid address range data is transferred from the debug host as product type information, but it is stored in a flash memory or the like in a non-volatile manner, or a means for holding product type information volatilely on the chip is provided for debugging. The same effect can be obtained even when the product information is set in advance.

また上記の構成においては品種により異なる無効アドレス範囲データを無効アドレステーブル部805に転送し格納するようにしたが、品番情報を転送し品番情報から無効アドレス範囲データをデコードする構成とすることも可能である。   In the above configuration, invalid address range data that differs depending on the product type is transferred to and stored in the invalid address table unit 805. However, it is also possible to transfer the product number information and decode the invalid address range data from the product number information. It is.

また上記の構成においては説明の簡略化のため、命令ROMおよびSRAMをそれぞれ1個ずつ、また周辺回路を2個搭載しているが、各要素が1つもしくは複数持つ構成や要素によっては搭載しない構成とすることも可能である。   In the above configuration, for simplicity of explanation, one instruction ROM and one SRAM and two peripheral circuits are mounted. However, depending on the configuration or elements each element has one or more, it is not mounted. A configuration is also possible.

また上記の構成においては無効アクセスの際に対象アドレスへのread動作を行わないようにしたが、対象アドレスへのread動作を行いCPU102へは無効データを返す構成としてもよい。   Further, in the above configuration, the read operation to the target address is not performed at the time of invalid access, but the read operation to the target address may be performed and invalid data may be returned to the CPU 102.

また上記の構成においては無効アクセスのwrite動作についてはwrite動作を無視するよう構成したが、乱数発生器804の生成するランダム値を書き込むよう構成してもよい。   In the above configuration, the write operation is ignored for the invalid access write operation, but the random value generated by the random number generator 804 may be written.

また上記の構成においてはユーザプログラムの実行開始後にデバッグホストからデバッグ割込みをかけて品種情報を転送しているが、ユーザプログラム実行前にデバッグホストよりデバッグ割込みをかけ品種情報を転送する構成にしてもよい。   In the above configuration, the product information is transferred from the debug host after the start of execution of the user program, but the product information is transferred from the debug host before execution of the user program. Good.

また上記の構成においては品種情報の転送のためデバッグホストよりデバッグ割込みをかける構成としたが、第2の実施形態のごとくシーケンサを備える構成としてもよい。   In the above configuration, a debug interrupt is issued from the debug host for transferring the product type information. However, as in the second embodiment, a sequencer may be provided.

(第4の実施形態)
本発明の第4の実施形態を図10〜11を用いて説明する。
(Fourth embodiment)
A fourth embodiment of the present invention will be described with reference to FIGS.

図10は本発明の第4の実施形態のマイクロコントローラチップを示している。このマイクロコントローラチップ1001は、マイクロコントローラチップ101同様、シリーズのベース品種であり命令ROMとしてフラッシュメモリ(FlashROM103)を内蔵し、最終セットに実装することが可能であるとともに、ユーザプログラム開発のためのエミュレーションチップとして用いることも可能である。   FIG. 10 shows a microcontroller chip according to a fourth embodiment of the present invention. Like the microcontroller chip 101, the microcontroller chip 1001 is a base product of the series and has a built-in flash memory (FlashROM 103) as an instruction ROM. The microcontroller chip 1001 can be mounted in a final set, and is an emulation for developing a user program. It can also be used as a chip.

図10に示すように、エミュレーションチップ兼用のベース品種のマイクロコントローラチップ1001は、命令を実行することでチップ全体を制御するCPU1002と、バスコントローラ1006の動作を監視し無効アクセスのあった際にはCPU1002に無効アクセス検出割込みをかけるアクセス監視回路1003と、CPU1002によって制御され内部バス105を制御するバスコントローラ1006と、そのほかにマイクロコントローラチップ101と同様の構成要素(103、105、106、107、108、110)とを備える。   As shown in FIG. 10, the microcontroller chip 1001 of the base type also used as an emulation chip monitors the operation of the CPU 1002 that controls the entire chip by executing instructions and the bus controller 1006, and when there is an invalid access. An access monitoring circuit 1003 that issues an invalid access detection interrupt to the CPU 1002, a bus controller 1006 that is controlled by the CPU 1002 and controls the internal bus 105, and other components (103, 105, 106, 107, 108 similar to the microcontroller chip 101) 110).

アクセス監視回路1003は、バスコントローラ1006を介しマスクROM品種に応じた無効アドレス範囲データが書き込まれる無効アドレステーブル部1004と、バスコントローラ1006のアクセスしようとする対象アドレスと無効アドレステーブル部1004に設定された無効アドレス範囲とを比較するアドレス比較部1005とを備える。   The access monitoring circuit 1003 is set in the invalid address table unit 1004 to which invalid address range data corresponding to the mask ROM type is written via the bus controller 1006, and the target address and invalid address table unit 1004 to be accessed by the bus controller 1006. And an address comparison unit 1005 for comparing the invalid address range.

アクセス監視回路1003は、無効アドレステーブル部1004に無効アドレス範囲データが書き込まれていない場合にはバスコントローラ1006のアクセスを監視せずCPU1002に作用せず、無効アドレス範囲データが書き込まれている場合にはバスコントローラ1006のアクセスを監視する。   The access monitoring circuit 1003 does not monitor the access of the bus controller 1006 when the invalid address range data is not written in the invalid address table unit 1004, does not act on the CPU 1002, and when invalid address range data is written. Monitors the access of the bus controller 1006.

アクセス監視回路1003がバスコントローラ1006を監視し、アドレス比較部1005での結果が、バスコントローラ1006のアクセスしようとする対象アドレスが無効アドレス範囲外である場合、すなわち有効な領域へのアクセスであった場合にはこれを有効アクセスと判断しCPU1002に作用せず、またバスコントローラ1006のアクセスしようとする対象アドレスが無効アドレス範囲内である場合にはこれを無効アクセスと判定し、CPU1002へは無効アクセス検出割込みをかけるように作用する。   The access monitoring circuit 1003 monitors the bus controller 1006, and the result of the address comparison unit 1005 indicates that the target address to be accessed by the bus controller 1006 is outside the invalid address range, that is, an access to a valid area. In this case, it is determined that the access is valid and does not act on the CPU 1002, and when the target address to be accessed by the bus controller 1006 is within the invalid address range, this is determined to be invalid access, and the CPU 1002 is invalid accessed. Acts as a detection interrupt.

次にマイクロコントローラチップ1001の動作を説明する。マイクロコントローラチップ1001のFlashROM103にユーザプログラムが書き込まれており、最終セットに実装されて最終セット上で動作している場合については、マイクロコントローラチップ101と同様である。   Next, the operation of the microcontroller chip 1001 will be described. The case where the user program is written in the flash ROM 103 of the microcontroller chip 1001, is mounted on the final set, and operates on the final set, is the same as that of the microcontroller chip 101.

マイクロコントローラチップ1001のエミュレーションチップ動作の例として、マイクロコントローラチップ1001がエミュレーションチップとしてセットに実装されており、デバッグホストと接続され、セット開発者が図2に示したマスクROM品種B用のソフトウエア開発を行っている場合を図11のフロー図を用いて説明する。   As an example of the emulation chip operation of the microcontroller chip 1001, the microcontroller chip 1001 is mounted as an emulation chip in a set, connected to a debug host, and the set developer uses software for the mask ROM type B shown in FIG. A case where development is performed will be described with reference to the flowchart of FIG.

図11において、期間1101はユーザプログラムの実行が開始されるまでの動作であり、マスクROMマイコンと同一の動作である。   In FIG. 11, a period 1101 is an operation until the execution of the user program is started, and is the same operation as the mask ROM microcomputer.

期間1102はユーザプログラム実行中にデバッグI/F110を通じデバッグホストからデバッグ割込みがかかっており、この期間において品種情報としてマスクROM品種Bの無効アドレス範囲データがデバッグホストよりデバッグI/F110およびCPU1002を経由して送り込まれバスコントローラ1006を介しアクセス監視回路1003に書き込まれる。アクセス監視回路1003は無効アドレス範囲データが書き込まれたのでマスクROM品種Bに応じた無効アドレス範囲が無効アドレステーブル部1004に設定され、バスコントローラ1006の動作を監視する。   During the period 1102, a debug interrupt is received from the debug host through the debug I / F 110 during execution of the user program. During this period, the invalid address range data of the mask ROM type B is sent from the debug host via the debug I / F 110 and the CPU 1002 as the type information. Are sent to the access monitoring circuit 1003 via the bus controller 1006. Since the invalid address range data is written, the access monitoring circuit 1003 sets the invalid address range corresponding to the mask ROM type B in the invalid address table unit 1004 and monitors the operation of the bus controller 1006.

期間1103はユーザプログラムのデバッグが未完了なため誤って周辺回路B108の制御レジスタのアドレスにwrite動作を行った場合であり、アクセス監視回路1003はアクセスを監視しており、このwrite動作がマスクROM品種Bには実装されていない無効アドレスへのアクセスなのでアクセス監視回路1003は無効アクセスと判断しCPU1002へ割込みをかけるように作用する。CPU1002は割込みがかかったため、デバッグI/F110を通じデバッグホストに無効アクセスの検出を通知する。   The period 1103 is a case where the user program has not been debugged yet and the write operation is erroneously performed on the address of the control register of the peripheral circuit B108. The access monitoring circuit 1003 monitors the access, and this write operation is performed by the mask ROM. Since access is to an invalid address that is not implemented in the product type B, the access monitoring circuit 1003 determines that the access is invalid and acts to interrupt the CPU 1002. Since an interrupt has occurred, the CPU 1002 notifies the debug host of detection of invalid access through the debug I / F 110.

期間1104はユーザプログラムのデバッグが未完了なため誤って内蔵SRAM106のアドレス0x00003000番地にread動作を行った場合であり、アクセス監視回路1003はアクセスを監視しており、このread動作がマスクROM品種Bには実装されていない無効アドレスへのアクセスなのでアクセス監視回路1003は無効アクセスと判断しCPU1002へ割込みをかけるように作用する。CPU1002は割込みがかかったため、デバッグI/F110を通じデバッグホストに無効アクセスの検出を通知する。   The period 1104 is a case where the user program has not been debugged and the read operation is erroneously performed at address 0x00003000 of the built-in SRAM 106. The access monitoring circuit 1003 monitors the access, and this read operation is the mask ROM type B. The access monitoring circuit 1003 determines that it is an invalid access, and acts to interrupt the CPU 1002 because it is an access to an invalid address that is not implemented in. Since an interrupt has occurred, the CPU 1002 notifies the debug host of detection of invalid access through the debug I / F 110.

なお、有効アドレスへのアクセスの場合には、アクセス監視回路1003は有効アクセスと判断しCPU1002に作用せず、CPU1002とデバッグI/F110は通常どおり動作する。   In the case of accessing a valid address, the access monitoring circuit 1003 determines that the access is valid and does not act on the CPU 1002, and the CPU 1002 and the debug I / F 110 operate normally.

以上のように動作することで、上記マイクロコントローラチップ1001はベース品種としての動作をすることができ、エミュレーションチップとしてデバッグホストと接続している場合にはデバッグ割込みにより品種情報を転送することでマスクROM品種AもしくはBの機能を代行することができる。   By operating as described above, the microcontroller chip 1001 can operate as a base product, and when connected to a debug host as an emulation chip, mask information can be obtained by transferring product information by a debug interrupt. The function of ROM type A or B can be substituted.

マスクROM品種Bの機能を代行している場合にはマスクROM品種Bと同じく無効アドレスへのwriteとreadに対しては、CPU1002へ割込みを発生するので無効アクセスの検出を通知でき、セットのソフトウエア開発者はマスクROM品種Bでのプログラムの不具合を早期に検出でき、量産セットにマスクROM品種を適用した際の不具合を事前に防止することが可能である。   When the function of the mask ROM type B is substituted, the write to and read from the invalid address is interrupted to the CPU 1002 in the same manner as the mask ROM type B, so that the detection of invalid access can be notified, and the software of the set The software developer can detect a problem of the program in the mask ROM type B at an early stage, and can prevent a problem when the mask ROM type is applied to the mass production set in advance.

なお上記の構成においては品種情報として無効アドレス範囲データをデバッグホストから転送するようにしたが、フラッシュメモリなどに不揮発に保持したり、チップ上に揮発的に品種情報を保持する手段を設けデバッグに先立ち品種情報を設定しておく構成としても同等の効果が得られる。   In the above configuration, invalid address range data is transferred from the debug host as product type information, but it is stored in a flash memory or the like in a non-volatile manner, or a means for holding product type information volatilely on the chip is provided for debugging. The same effect can be obtained even when the product information is set in advance.

また上記の構成においては品種により異なる無効アドレス範囲データを無効アドレステーブル部1004に転送し格納するようにしたが、品番情報を転送し品番情報から無効アドレス範囲データをデコードする構成とすることも可能である。   In the above configuration, invalid address range data that differs depending on the product type is transferred and stored in the invalid address table unit 1004. However, it is also possible to transfer the product number information and decode the invalid address range data from the product number information. It is.

また上記の構成においては説明の簡略化のため、命令ROMおよびSRAMをそれぞれ1個ずつ、また周辺回路を2個搭載しているが、各要素が1つもしくは複数持つ構成や要素によっては搭載しない構成とすることも可能である。   In the above configuration, for simplicity of explanation, one instruction ROM and one SRAM and two peripheral circuits are mounted. However, depending on the configuration or elements each element has one or more, it is not mounted. A configuration is also possible.

また上記の構成においては無効アドレスへのreadの際にCPU1002に割込みをかける構成としたが、割込み発生に加え対象アドレスへのread動作を行わないようにしたりもしくは対象アドレスへのread動作を行う構成としてもよい。   In the above configuration, the CPU 1002 is interrupted when reading to an invalid address. However, in addition to the generation of an interrupt, the read operation to the target address is not performed or the read operation to the target address is performed. It is good.

また上記の構成においては無効アドレスへのwriteの際にCPU1002に割込みをかける構成としたが、割込み発生に加えwrite動作も行ったりwrite動作を無視したり第3の実施形態のごとく乱数発生器を備えておきランダム値を書き込むよう構成してもよい。   In the above configuration, the CPU 1002 is interrupted when writing to an invalid address. However, in addition to the generation of an interrupt, a write operation is performed or the write operation is ignored, or a random number generator is used as in the third embodiment. A random value may be written in advance.

また上記の構成においてはユーザプログラムの実行開始後にデバッグホストからデバッグ割込みをかけて品種情報を転送しているが、ユーザプログラム実行前にデバッグホストよりデバッグ割込みをかけ品種情報を転送する構成にしてもよい。   In the above configuration, the product information is transferred from the debug host after the start of execution of the user program, but the product information is transferred from the debug host before execution of the user program. Good.

また上記の構成においては品種情報の転送のためデバッグホストよりデバッグ割込みをかける構成としたが、第2の実施形態のごとくシーケンサを備える構成としてもよい。
また上記の構成では無効アクセス検出の際にCPU1002に割込みをかけCPU1002からデバッグI/F110に無効アクセスの検出を通知する構成としたが、無効アクセスの際にアクセス監視回路1003からデバッグI/F110に直接無効アクセスの検出を通知する構成としてもよい。
In the above configuration, a debug interrupt is issued from the debug host for transferring the product type information. However, as in the second embodiment, a sequencer may be provided.
In the above configuration, the CPU 1002 is interrupted when invalid access is detected, and the detection of invalid access is notified from the CPU 1002 to the debug I / F 110. However, the access monitor circuit 1003 notifies the debug I / F 110 when invalid access is made. It may be configured to notify detection of direct invalid access.

(第5の実施形態)
本発明の第5の実施形態を図12〜18を用いて説明する。
(Fifth embodiment)
A fifth embodiment of the present invention will be described with reference to FIGS.

図12は本発明の第5の実施形態のマイクロコントローラチップを示している。このマイクロコントローラチップ1201は、マイクロコントローラチップ101同様、シリーズのベース品種であり命令ROMとしてフラッシュメモリ(FlashROM103)を内蔵し、最終セットに実装することが可能であるとともに、ユーザプログラム開発のためのエミュレーションチップとして用いることも可能である。   FIG. 12 shows a microcontroller chip according to a fifth embodiment of the present invention. Like the microcontroller chip 101, the microcontroller chip 1201 is a series base product, and includes a flash memory (FlashROM 103) as an instruction ROM, which can be mounted in the final set, and is an emulation for developing a user program. It can also be used as a chip.

図12に示すように、エミュレーションチップ兼用のベース品種のマイクロコントローラチップ1201は、命令を実行することでチップ全体を制御するCPU1202と、内部に制御レジスタ1204と資源無効化レジスタ1205を備え内部バス105を介し制御レジスタ1204および資源無効化レジスタ1205に値を設定されることで制御される周辺回路A1203と、内部に制御レジスタ1207と資源無効化レジスタ1208を備え内部バス105を介し制御レジスタ1207および資源無効化レジスタ1208に値を設定されることで制御される周辺回路C1206と、CPU1202によって制御され内部バス105を制御するバスコントローラ1209と、そのほかにマイクロコントローラチップ101と同様の構成要素(103、105、106、110)とを備える。   As shown in FIG. 12, the microcontroller chip 1201 of the base type that also serves as an emulation chip includes a CPU 1202 that controls the entire chip by executing instructions, an internal control register 1204, and a resource invalidation register 1205. A peripheral circuit A 1203 controlled by setting values in the control register 1204 and the resource invalidation register 1205 via the internal control register 1207 and the resource invalidation register 1208 provided therein, and the control register 1207 and the resource via the internal bus 105. A peripheral circuit C1206 controlled by setting a value in the invalidation register 1208, a bus controller 1209 controlled by the CPU 1202 to control the internal bus 105, and other components similar to those of the microcontroller chip 101 (103,105,106,110) and a.

周辺回路A1203の資源無効化レジスタ1205は、初期値が0であり、資源無効化レジスタ1205の値が0のときは制御レジスタ1204に作用せず周辺回路A1203の資源を無効化せず周辺回路A1203へのバスアクセスを監視しないが、デバッグホスト接続時に資源無効化レジスタ1205に0以外の値が書き込まれると値に応じ制御レジスタ1204に作用し周辺回路A1203の資源の一部もしくは全てを無効化するとともに周辺回路A1203へのバスアクセスを監視する。   The resource invalidation register 1205 of the peripheral circuit A 1203 has an initial value of 0. When the value of the resource invalidation register 1205 is 0, the peripheral circuit A 1203 does not invalidate the resource of the peripheral circuit A 1203 without acting on the control register 1204. However, if a value other than 0 is written to the resource invalidation register 1205 when the debug host is connected, it acts on the control register 1204 according to the value and invalidates some or all of the resources of the peripheral circuit A1203. At the same time, the bus access to the peripheral circuit A 1203 is monitored.

周辺回路A1203へのバスアクセスを監視している際に、周辺回路A1203の資源無効化レジスタ1205の設定に反して資源を有効化するようなバスアクセスがあった場合には無効アクセスと判断し、CPU1202へ無効アクセス検出割込みをかけるように作用する。   While monitoring the bus access to the peripheral circuit A 1203, if there is a bus access that enables the resource against the setting of the resource invalidation register 1205 of the peripheral circuit A 1203, it is determined that the access is invalid. This acts to give an invalid access detection interrupt to the CPU 1202.

周辺回路C1206についても周辺回路A1203と同様である。   The peripheral circuit C1206 is similar to the peripheral circuit A1203.

図13は図12に示したマイクロコントローラのベース品種とそのシリーズ展開品であるマスクROM品種AおよびCにおける、メモリサイズと周辺回路の差異を示している。このマスクROM品種AおよびCは命令ROMとしてマスクROMを内蔵しており、量産のおこなわれる最終セットに実装されるものである。   FIG. 13 shows the difference in memory size and peripheral circuit between the base type of the microcontroller shown in FIG. 12 and the mask ROM types A and C which are the series development products. The mask ROM types A and C have a built-in mask ROM as an instruction ROM, and are mounted on a final set where mass production is performed.

図13に示すように、ベース品種はエミュレーションチップを兼ねており、マスクROM品種と比較し各周辺回路ごとに資源無効化レジスタを備えている。マスクROM品種Aはベース品種と比較し資源無効化レジスタを備えないこと以外はメモリサイズ、周辺機能が同一である。マスクROM品種Cはベース品種と比較し資源無効化レジスタを備えないこと以外にもメモリサイズ、周辺機能に相違がある。すなわちマスクROM品種CにおいてはメモリサイズがROM,RAMとも半減し、また周辺機能についても周辺回路Cの一部が実装されていない。   As shown in FIG. 13, the base type also serves as an emulation chip, and has a resource invalidation register for each peripheral circuit as compared with the mask ROM type. The mask ROM type A has the same memory size and peripheral functions as the base type, except that it does not have a resource invalidation register. The mask ROM type C is different from the base type in that it does not have a resource invalidation register, but has a difference in memory size and peripheral functions. That is, in the mask ROM type C, the memory size is reduced by half for both ROM and RAM, and a part of the peripheral circuit C is not mounted for peripheral functions.

周辺回路Cは、ベース品種およびマスクROM品種AにおいてはUARTとクロック同期シリアル機能のいずれかが制御レジスタのプロトコル選択ビットで選択可能な汎用シリアルであるが、マスクROM品種Cではクロック同期専用の回路構成となっている。すなわちマスクROM品種Cの周辺回路CではUARTが無効な資源となる。   The peripheral circuit C is a general-purpose serial in which either the UART or the clock synchronous serial function can be selected by the protocol selection bit of the control register in the base type and the mask ROM type A. It has a configuration. That is, the UART becomes an invalid resource in the peripheral circuit C of the mask ROM type C.

図14にベース品種およびマスクROM品種Aに実装されている周辺回路Cの制御レジスタを示す。この制御レジスタ1401はプロトコル選択ビット1402を備え、プロトコル選択ビット1402は初期値としてクロック同期シリアルを選択し、書換えが可能である。   FIG. 14 shows a control register of the peripheral circuit C mounted on the base type and the mask ROM type A. The control register 1401 includes a protocol selection bit 1402, and the protocol selection bit 1402 selects a clock synchronous serial as an initial value and can be rewritten.

図15にマスクROM品種Cに実装されている周辺回路Cの制御レジスタを示す。この制御レジスタ1501はプロトコル選択ビット1502を備えるが、プロトコル選択ビット1502は初期値が固定でクロック同期シリアルを選択し、書換えできない。なお、マスクROM品種Cにおいてプロトコル選択ビット1502を書換えるアクセスがあった場合には、プロトコル選択ビット1502はこのアクセスを無視する。   FIG. 15 shows a control register of the peripheral circuit C mounted on the mask ROM type C. The control register 1501 includes a protocol selection bit 1502, but the protocol selection bit 1502 has a fixed initial value and selects a clock synchronous serial and cannot be rewritten. If there is an access to rewrite the protocol selection bit 1502 in the mask ROM type C, the protocol selection bit 1502 ignores this access.

図16にベース品種とマスクROM品種AとマスクROM品種Cの、おのおのの周辺回路Cの動作をしめす。   FIG. 16 shows the operation of each peripheral circuit C of the base type, the mask ROM type A, and the mask ROM type C.

図16に示すようにベース品種とマスクROM品種Aにおいて、プロトコル選択ビット1502の初期値は0でありプロトコルとしてクロック同期シリアルを選択しているが、プロトコル選択ビット1502の値を1に書換えるアクセスがあった場合には、プロトコル選択ビット1502は1に書換えられプロトコルとしてUARTを選択する。   As shown in FIG. 16, in the base type and the mask ROM type A, the initial value of the protocol selection bit 1502 is 0 and the clock synchronous serial is selected as the protocol, but the access for rewriting the value of the protocol selection bit 1502 to 1 If there is, the protocol selection bit 1502 is rewritten to 1 to select UART as the protocol.

また図16に示すようにマスクROM品種Cにおいて、プロトコル選択ビット1502の初期値は0でありプロトコルとしてクロック同期シリアルを選択しているが、プロトコル選択ビット1502の値を1に書換えるアクセスがあった場合には、プロトコル選択ビット1502はこのアクセスを無視して0を保持しプロトコルとしてクロック同期シリアルを選択する。   As shown in FIG. 16, in the mask ROM type C, the initial value of the protocol selection bit 1502 is 0 and the clock synchronous serial is selected as the protocol. However, there is an access to rewrite the value of the protocol selection bit 1502 to 1. In this case, the protocol selection bit 1502 ignores this access and holds 0 to select the clock synchronous serial as the protocol.

図17にエミュレーション動作をおこなっているベース品種チップに品種ごとの情報を設定し、ベース品種もしくはマスクROM品種AもしくはマスクROM品種Cの動作をエミュレートする場合の周辺回路C1206の動作をしめす。   FIG. 17 shows the operation of the peripheral circuit C1206 when information for each product type is set in the base product chip performing the emulation operation and the operation of the base product, mask ROM product type A or mask ROM product type C is emulated.

図17に示すようにベース品種もしくはマスクROM品種Aの動作をエミュレートする際には、デバッグホストに接続し周辺回路C1206の資源無効化レジスタ1208に初期値と同じ0を書き込む。資源無効化レジスタ1208の値が0なのでエミュレーションチップの周辺回路C1206のプロトコル選択ビット1502は書換え可能であり、周辺回路C1206はプロトコル選択ビット1502の値に応じたプロトコルが選択される。   As shown in FIG. 17, when emulating the operation of the base type or the mask ROM type A, it is connected to the debug host, and the same 0 as the initial value is written in the resource invalidation register 1208 of the peripheral circuit C1206. Since the value of the resource invalidation register 1208 is 0, the protocol selection bit 1502 of the peripheral circuit C1206 of the emulation chip can be rewritten, and the protocol corresponding to the value of the protocol selection bit 1502 is selected for the peripheral circuit C1206.

また図17に示すようにマスクROM品種Cの動作をエミュレートする際には、デバッグホストに接続し周辺回路C1206の資源無効化レジスタ1208を1に書換える。資源無効化レジスタ1208の値が1なのでエミュレーションチップの周辺回路C1206のプロトコル選択ビット1502は書換えできなくなり、周辺回路C1206はプロトコル選択ビット1502の値0に応じたクロック同期シリアルのプロトコルが選択される。さらに資源無効化レジスタ1208の値が1の場合にはエミュレーションチップの周辺回路C1206のプロトコル選択ビット1502は書換えできないが、これに反してマスクROM品種Cでは実装されないUARTのプロトコルを選択するようにプロトコル選択ビット1502の値を書き換えるアクセスがあった場合には、このアクセスを無視するとともに無効アクセスと判断し、CPU1202へ無効アクセス検出割込みをかけるように作用する。   As shown in FIG. 17, when emulating the operation of the mask ROM type C, the resource invalidation register 1208 of the peripheral circuit C 1206 is rewritten to 1 by connecting to the debug host. Since the value of the resource invalidation register 1208 is 1, the protocol selection bit 1502 of the peripheral circuit C1206 of the emulation chip cannot be rewritten, and the clock synchronization serial protocol corresponding to the value 0 of the protocol selection bit 1502 is selected for the peripheral circuit C1206. Further, when the value of the resource invalidation register 1208 is 1, the protocol selection bit 1502 of the peripheral circuit C1206 of the emulation chip cannot be rewritten. On the other hand, the protocol is selected so that the UART protocol that is not implemented in the mask ROM type C is selected. When there is an access for rewriting the value of the selection bit 1502, the access is ignored and it is determined as an invalid access, and an invalid access detection interrupt is applied to the CPU 1202.

次にマイクロコントローラチップ1201の動作を説明する。マイクロコントローラチップ1201の内蔵フラッシュメモリにユーザプログラムが書き込まれており、最終セットに実装されて最終セット上で動作している場合については、マイクロコントローラチップ101と同様である。   Next, the operation of the microcontroller chip 1201 will be described. The case where the user program is written in the built-in flash memory of the microcontroller chip 1201, is mounted on the final set, and operates on the final set, is the same as that of the microcontroller chip 101.

マイクロコントローラチップ1201のエミュレーションチップ動作の例として、マイクロコントローラチップ1201がエミュレーションチップとしてセットに実装されており、デバッグホストと接続されセット開発者がマスクROM品種C用のソフトウエア開発を行っている場合を図18を用いて説明する。   As an example of the emulation chip operation of the microcontroller chip 1201, when the microcontroller chip 1201 is mounted on the set as an emulation chip and connected to the debug host, the set developer is developing software for the mask ROM type C Will be described with reference to FIG.

図18において、期間1801はユーザプログラムの実行が開始されるまでの動作でありマスクROMマイコンと同一の動作である。   In FIG. 18, a period 1801 is an operation until the execution of the user program is started, and is the same operation as the mask ROM microcomputer.

期間1802はユーザプログラム実行中にデバッグI/F110を通じデバッグホストからデバッグ割込みがかかっており、この期間において品種情報としてマスクROM品種Cの無効資源データがデバッグホストよりデバッグI/F110およびCPU1202を経由して送り込まれバスコントローラ104を介し周辺回路A1203の資源無効化レジスタ1205と周辺回路C1206の資源無効化レジスタ1208に書き込まれる。   During a period 1802, a debug interrupt is issued from the debug host through the debug I / F 110 during execution of the user program. During this period, invalid resource data of the mask ROM type C is sent from the debug host via the debug I / F 110 and the CPU 1202 as product type information. And is written to the resource invalidation register 1205 of the peripheral circuit A 1203 and the resource invalidation register 1208 of the peripheral circuit C 1206 via the bus controller 104.

図13に示したようにこのROMマスク品種Cにおいては周辺回路A1203はベース品種およびROMマスク品種Aの周辺回路Aと同一の機能を備えるので周辺回路A1203の全ての資源が有効であり、資源無効化レジスタ1205には品種情報としてマスクROM品種Cの無効資源データ「0」が書き込まれる。周辺回路A1203の資源無効化レジスタ1205の値は「0」であるので制御レジスタ1204に作用せず周辺回路A1203へのバスアクセスを監視せず、CPU1202には作用しない。   As shown in FIG. 13, in this ROM mask type C, the peripheral circuit A 1203 has the same function as the peripheral circuit A of the base type and ROM mask type A, so all the resources of the peripheral circuit A 1203 are valid and the resource is invalid. The invalid resource data “0” of the mask ROM type C is written in the generalization register 1205 as the type information. Since the value of the resource invalidation register 1205 of the peripheral circuit A 1203 is “0”, it does not act on the control register 1204, does not monitor bus access to the peripheral circuit A 1203, and does not act on the CPU 1202.

また図13に示したようにこのROMマスク品種Cにおいては周辺回路C1206はベース品種およびROMマスク品種Aの周辺回路Cにくらべ制限があり周辺回路C1206のクロック同期シリアル機能のみ有効であるので、資源無効化レジスタ1208には品種情報としてマスクROM品種Cの無効資源データ「1」が書き込まれる。周辺回路C1206の資源無効化レジスタ1208の値は「1」であるので制御レジスタ1207に作用し周辺回路C1206へのバスアクセスを監視する。   Further, as shown in FIG. 13, in this ROM mask type C, the peripheral circuit C 1206 is limited compared to the peripheral circuit C of the base type and ROM mask type A, and only the clock synchronous serial function of the peripheral circuit C 1206 is effective. In the invalidation register 1208, invalid resource data “1” of the mask ROM type C is written as type information. Since the value of the resource invalidation register 1208 of the peripheral circuit C 1206 is “1”, it acts on the control register 1207 to monitor the bus access to the peripheral circuit C 1206.

期間1803はユーザプログラムのデバッグが未完了なため周辺回路C1206の制御レジスタ1207にwrite動作を行い、マスクROM品種Cでは制限される資源であるUARTを誤って有効化しようとしてプロトコル選択ビット1502を書き換える動作を行った場合であり、周辺回路C1206の資源無効化レジスタ1208は周辺回路C1206へのバスアクセスを監視しており、このwrite動作がマスクROM品種Cでは制限される資源であるUARTを有効化しようとするアクセスのため、周辺回路C1206の資源無効化レジスタ1208はこのアクセスを無効アクセスと判断し、CPU1202へ無効アクセス検出割込みを発生する。CPU1202は無効アクセス検出割込みがかかったため、デバッグI/F110を通じデバッグホストに無効アクセスの検出を通知する。   In period 1803, since the debugging of the user program is incomplete, a write operation is performed on the control register 1207 of the peripheral circuit C1206, and the protocol selection bit 1502 is rewritten in an attempt to erroneously enable UART, which is a limited resource in the mask ROM type C In this case, the resource invalidation register 1208 of the peripheral circuit C1206 monitors the bus access to the peripheral circuit C1206, and this write operation validates UART, which is a resource restricted in the mask ROM type C. Because of the access to be attempted, the resource invalidation register 1208 of the peripheral circuit C 1206 determines this access as invalid access and generates an invalid access detection interrupt to the CPU 1202. Since an invalid access detection interrupt has occurred, the CPU 1202 notifies the debug host through the debug I / F 110 that invalid access has been detected.

以上のように動作することで、上記マイクロコントローラチップ1201はベース品種としての動作をすることができ、エミュレーションチップとしてデバッグホストと接続している場合にはデバッグ割込みにより品種情報を転送することでマスクROM品種AもしくはCの動作を代行することができる。   By operating as described above, the microcontroller chip 1201 can operate as a base product, and when connected to a debug host as an emulation chip, mask information can be obtained by transferring product information by a debug interrupt. The operation of the ROM type A or C can be substituted.

マスクROM品種Cの動作を代行している場合にはマスクROM品種Cでは制限される資源への無効なwriteアクセスに対しては、CPU1202へ割込みを発生するので無効アクセスの検出を通知でき、セットのソフトウエア開発者はマスクROM品種Cでのプログラムの不具合を早期に検出でき、量産セットにマスクROM品種を適用した際の不具合を事前に防止することが可能である。   When the operation of the mask ROM type C is performed on behalf, an invalid write access to a resource restricted in the mask ROM type C generates an interrupt to the CPU 1202, so that the detection of the invalid access can be notified. The software developer can detect a problem of the program in the mask ROM type C at an early stage, and can prevent a problem when the mask ROM type is applied to the mass production set in advance.

なお上記の構成においては品種情報として無効アドレス範囲データをデバッグホストから転送するようにしたが、フラッシュメモリなどに不揮発に保持したり、チップ上に揮発的に品種情報を保持する手段を設けデバッグに先立ち品種情報を設定しておく構成としても同等の効果が得られる。   In the above configuration, invalid address range data is transferred from the debug host as product type information, but it is stored in a flash memory or the like in a non-volatile manner, or a means for holding product type information volatilely on the chip is provided for debugging. The same effect can be obtained even when the product information is set in advance.

また上記の構成においては説明の簡略化のため、命令ROMおよびSRAMをそれぞれ1個ずつ、また周辺回路を2個搭載しているが、各要素が1つもしくは複数持つ構成や要素によっては搭載しない構成とすることも可能である。   In the above configuration, for simplicity of explanation, one instruction ROM and one SRAM and two peripheral circuits are mounted. However, depending on the configuration or elements each element has one or more, it is not mounted. A configuration is also possible.

また上記の構成においては品種設定により制限される資源を有効に設定するようなwriteの際にCPU1202に割込みをかける構成としたが、割込み発生に加えwrite動作も行ったりwrite動作を無視したり第3の実施形態のごとく乱数発生器を備えておきランダム値を書き込むよう構成してもよい。   In the above configuration, the CPU 1202 is interrupted at the time of writing to effectively set the resource limited by the product type setting. However, in addition to the generation of the interrupt, the write operation is performed or the write operation is ignored. As in the third embodiment, a random number generator may be provided and a random value may be written.

また上記の構成においてはユーザプログラムの実行開始後にデバッグホストからデバッグ割込みをかけて品種情報を転送しているが、ユーザプログラム実行前にデバッグホストよりデバッグ割込みをかけ品種情報を転送する構成にしてもよい。   In the above configuration, the product information is transferred from the debug host after the start of execution of the user program, but the product information is transferred from the debug host before execution of the user program. Good.

また上記の構成においては品種情報の転送のためデバッグホストよりデバッグ割込みをかける構成としたが、第2の実施形態のごとくシーケンサを備える構成としてもよい。   In the above configuration, a debug interrupt is issued from the debug host for transferring the product type information. However, as in the second embodiment, a sequencer may be provided.

また上記の構成では無効アクセス検出の際にCPU1202に割込みをかけCPU1202からデバッグI/F110に無効アクセスを通知する構成としたが、無効アクセスの際にデバッグI/F110に直接無効アクセスを通知する構成としてもよい。   In the above-described configuration, the CPU 1202 is interrupted when invalid access is detected, and the invalid access is notified from the CPU 1202 to the debug I / F 110. However, the invalid access is directly notified to the debug I / F 110 when invalid access is performed. It is good.

また上記の構成に加え、第1〜第4の実施形態のごとくアクセス監視回路を備え、無効アクセスの監視を行い無効アクセスを検出した場合には第1〜第4の実施形態のごとく動作する構成としてもよい。   Further, in addition to the above configuration, an access monitoring circuit is provided as in the first to fourth embodiments, and when invalid access is monitored and invalid access is detected, the configuration operates as in the first to fourth embodiments. It is good.

本発明にかかる半導体装置は、内蔵メモリサイズや内蔵周辺回路にバリエーションをもつマイクロコントローラやマイクロコンピュータのシリーズ品において、そのベース品種によりソフトウエアデバッグ環境を提供するエミュレーションチップ等として有用である。   The semiconductor device according to the present invention is useful as an emulation chip or the like for providing a software debugging environment depending on the base product in a series of microcontrollers and microcomputers having variations in built-in memory size and built-in peripheral circuit.

本発明の第1の実施形態のマイクロコントローラチップのブロック図である。1 is a block diagram of a microcontroller chip according to a first embodiment of the present invention. 第1〜第4の実施形態のマイコンシリーズのベース品種およびROM品種のメモリサイズや周辺機能の比較表を示す図である。It is a figure which shows the comparison table of the memory size and peripheral function of the base kind of the microcomputer series of 1st-4th Embodiment, and ROM kind. 第1の実施形態のベース品種がユーザプログラムを実行する場合の動作の例を示すフロー図である。It is a flowchart which shows the example of operation | movement in case the base kind of 1st Embodiment performs a user program. 第1の実施形態のベース品種がエミュレーションチップとしてマスクROM品種Aの機能を代行している際の動作の例を示すフロー図である。It is a flowchart which shows the example of operation | movement when the base kind of 1st Embodiment substitutes the function of the mask ROM kind A as an emulation chip. 第1の実施形態のベース品種がエミュレーションチップとしてマスクROM品種Bの機能を代行している際の動作の例を示すフロー図である。It is a flowchart which shows the example of operation | movement when the base kind of 1st Embodiment substitutes the function of the mask ROM kind B as an emulation chip. 本発明の第2の実施形態のマイクロコントローラチップのブロック図である。It is a block diagram of the microcontroller chip | tip of the 2nd Embodiment of this invention. 第2の実施形態のベース品種がエミュレーションチップとしてマスクROM品種Bの機能を代行している際の動作の例を示すフロー図である。It is a flowchart which shows the example of operation | movement when the base kind of 2nd Embodiment substitutes the function of the mask ROM kind B as an emulation chip. 本発明の第3の実施形態のマイクロコントローラチップのブロック図である。It is a block diagram of the microcontroller chip | tip of the 3rd Embodiment of this invention. 第3の実施形態のベース品種がエミュレーションチップとしてマスクROM品種Bの機能を代行している際の動作の例を示すフロー図である。It is a flowchart which shows the example of operation | movement when the base kind of 3rd Embodiment substitutes the function of the mask ROM kind B as an emulation chip. 本発明の第4の実施形態のマイクロコントローラチップのブロック図である。It is a block diagram of the microcontroller chip | tip of the 4th Embodiment of this invention. 第4の実施形態のベース品種がエミュレーションチップとしてマスクROM品種Bの機能を代行している際の動作の例を示すフロー図である。It is a flowchart which shows the example of operation | movement when the base kind of 4th Embodiment substitutes the function of the mask ROM kind B as an emulation chip. 本発明の第5の実施形態のマイクロコントローラチップのブロック図である。It is a block diagram of the microcontroller chip | tip of the 5th Embodiment of this invention. 第5の実施形態のマイコンシリーズのベース品種およびROM品種のメモリサイズや周辺機能の比較表を示す図である。It is a figure which shows the comparison table of the memory size and peripheral function of the base kind and ROM kind of microcomputer series of 5th Embodiment. 第5の実施形態のベース品種およびマスクROM品種Aの周辺回路Bの制御レジスタの構成図である。It is a block diagram of the control register of the peripheral circuit B of the base type and mask ROM type A of the fifth embodiment. 第5の実施形態のマスクROM品種Cの周辺回路Bの制御レジスタの構成図である。It is a block diagram of the control register of the peripheral circuit B of the mask ROM type C of the fifth embodiment. 第5の実施形態のマイコンシリーズのベース品種およびROM品種の周辺回路Cの動作比較表を示す図である。It is a figure which shows the operation | movement comparison table of the peripheral circuit C of the base kind and ROM kind of microcomputer series of 5th Embodiment. 第5の実施形態のベース品種がエミュレーションチップとしてベース品種およびROM品種の機能を代行している際の周辺回路Cの動作比較表を示す図である。It is a figure which shows the operation | movement comparison table of the peripheral circuit C when the base kind of 5th Embodiment substitutes the function of a base kind and ROM kind as an emulation chip. 第5の実施形態のベース品種がエミュレーションチップとしてマスクROM品種Cの機能を代行している際の動作の例を示すフロー図である。It is a flowchart which shows the example of operation | movement when the base kind of 5th Embodiment substitutes the function of the mask ROM kind C as an emulation chip.

符号の説明Explanation of symbols

101:マイクロコントローラチップ
102:CPU
103:FlashROM
104:バスコントローラ
105:内部バス
106:SRAM
107:周辺回路A
108:周辺回路B
109:アクセス監視回路
110:デバッグI/F
111:無効アドレステーブル部
112:アドレス比較部
601:マイクロコントローラチップ
602:アクセス監視回路
603:FlashROM
604:ユーザROM領域
605:品種データ領域
606:シーケンサ
607:デバッグI/F
608:CPU
609:無効アドレステーブル部
610:アドレス比較部
801:マイクロコントローラチップ
802:バスコントローラ
803:アクセス監視回路
804:乱数発生器
805:無効アドレステーブル部
806:アドレス比較部
1001:マイクロコントローラチップ
1002:CPU
1003:アドレス監視回路
1004:無効アドレステーブル部
1005:アドレス比較部
1006:バスコントローラ
1201:マイクロコントローラチップ
1202:CPU
1203:周辺回路A
1204:制御レジスタ
1205:資源無効化レジスタ
1206:周辺回路C
1207:制御レジスタ
1208:資源無効化レジスタ
1209:バスコントローラ
1401:汎用シリアルの制御レジスタ
1402:プロトコル選択ビット
1501:クロック同期シリアルの制御レジスタ
1502:プロトコル選択ビット
101: Microcontroller chip 102: CPU
103: FlashROM
104: Bus controller 105: Internal bus 106: SRAM
107: Peripheral circuit A
108: Peripheral circuit B
109: Access monitoring circuit 110: Debug I / F
111: Invalid address table unit 112: Address comparison unit 601: Microcontroller chip 602: Access monitoring circuit 603: Flash ROM
604: User ROM area 605: Product data area 606: Sequencer 607: Debug I / F
608: CPU
609: Invalid address table unit 610: Address comparison unit 801: Microcontroller chip 802: Bus controller 803: Access monitoring circuit 804: Random number generator 805: Invalid address table unit 806: Address comparison unit 1001: Microcontroller chip 1002: CPU
1003: Address monitoring circuit 1004: Invalid address table unit 1005: Address comparison unit 1006: Bus controller 1201: Microcontroller chip 1202: CPU
1203: Peripheral circuit A
1204: Control register 1205: Resource invalidation register 1206: Peripheral circuit C
1207: Control register 1208: Resource invalidation register 1209: Bus controller 1401: General-purpose serial control register 1402: Protocol selection bit 1501: Clock synchronous serial control register 1502: Protocol selection bit

Claims (8)

中央処理装置と複数の内部資源とを備え、複数のうちのいずれかの前記内部資源の領域および機能のいずれかもしくは両方にバリエーションをもつ複数品種からなるシリーズ品のうちの一の品種の半導体装置であって、
外部のデバッグホストと通信するデバッグ情報入出力装置と、前記シリーズ品のうちの他の品種の品種情報を格納する品種情報格納領域とを設け、前記デバッグ情報入出力装置と前記デバッグホストとの接続時において前記品種情報格納領域に格納された品種情報に基づいて前記他の品種の動作を代行するようにしたことを特徴とする半導体装置。
A semiconductor device of one type of a series product comprising a plurality of types having a central processing unit and a plurality of internal resources and having variations in either or both of the internal resource area and function Because
A debug information input / output device that communicates with an external debug host and a product information storage area for storing product information of other products of the series are provided, and the debug information input / output device and the debug host are connected. 2. A semiconductor device according to claim 1, wherein an operation of the other product is performed on the basis of product information stored in the product information storage area.
前記デバッグ情報入出力装置と前記デバッグホストとの接続時において、デバッグ割込みにより起動され前記中央処理装置にて実行されるデバッグプログラムにより前記品種情報格納領域への品種情報の書き込みが行われることを特徴とする請求項1記載の半導体装置。   When the debug information input / output device and the debug host are connected, the product information is written into the product information storage area by a debug program that is activated by a debug interrupt and executed by the central processing unit. The semiconductor device according to claim 1. 前記デバッグ情報入出力装置と前記デバッグホストとの接続時において、起動直後に内蔵するシーケンサにより前記品種情報格納領域への品種情報の書き込みが行われることを特徴とする請求項1記載の半導体装置。   2. The semiconductor device according to claim 1, wherein when the debug information input / output device is connected to the debug host, the product information is written into the product information storage area by a built-in sequencer immediately after startup. 前記他の品種は前記一の品種に比べていずれかの前記内部資源の領域が制限されており、
前記デバッグ情報入出力装置と前記デバッグホストとの接続時において、前記品種情報格納領域に格納された品種情報に基づいて前記制限された内部資源を判別し、この制限された内部資源の領域へ前記中央処理装置から書き込みもしくは読み出しのアクセスがあった場合にはこのアクセスを無効アクセスと判断し無視して動作することを特徴とする請求項1〜3のいずれかに記載の半導体装置。
The other resource has a limited area of any of the internal resources compared to the one product.
When the debug information input / output device and the debug host are connected, the restricted internal resource is determined based on the product information stored in the product information storage region, and the restricted internal resource region is transferred to the restricted internal resource region. 4. The semiconductor device according to claim 1, wherein when there is a write or read access from the central processing unit, the access is determined to be an invalid access and ignored.
前記他の品種は前記一の品種に比べていずれかの前記内部資源の領域が制限されており、
前記デバッグ情報入出力装置と前記デバッグホストとの接続時において、前記品種情報格納領域に格納された品種情報に基づいて前記制限された内部資源を判別し、この制限された内部資源の領域へ中央処理装置から書き込みもしくは読み出しのアクセスがあった場合にはこのアクセスを無効アクセスと判断し、固定値の無効データを書き込みもしくは読み出すように動作することを特徴とする請求項1〜3のいずれかに記載の半導体装置。
The other resource has a limited area of any of the internal resources compared to the one product.
When the debug information input / output device and the debug host are connected, the restricted internal resource is determined based on the kind information stored in the kind information storage area, and the restricted internal resource area is centralized. 4. When there is a write or read access from a processing device, this access is determined to be invalid access, and operation is performed to write or read fixed value invalid data. The semiconductor device described.
前記他の品種は前記一の品種に比べていずれかの前記内部資源の領域が制限されており、
前記デバッグ情報入出力装置と前記デバッグホストとの接続時において、前記品種情報格納領域に格納された品種情報に基づいて前記制限された内部資源を判別し、この制限された内部資源の領域へ中央処理装置から書き込みもしくは読み出しのアクセスがあった場合にはこのアクセスを無効アクセスと判断し、ランダムな無効データを書き込みもしくは読み出すように動作することを特徴とする請求項1〜3のいずれかに記載の半導体装置。
The other resource has a limited area of any of the internal resources compared to the one product.
When the debug information input / output device and the debug host are connected, the restricted internal resource is determined based on the kind information stored in the kind information storage area, and the restricted internal resource area is centralized. 4. When there is a write or read access from a processing device, this access is judged as an invalid access, and random invalid data is written or read out. Semiconductor device.
前記他の品種は前記一の品種に比べていずれかの前記内部資源の領域が制限されており、
前記デバッグ情報入出力装置と前記デバッグホストとの接続時において、前記品種情報格納領域に格納された品種情報に基づいて前記制限された内部資源を判別し、この制限された内部資源の領域へ中央処理装置から書き込みもしくは読み出しのアクセスがあった場合にはこのアクセスを無効アクセスと判断し、前記中央処理装置および前記デバッグ情報入出力装置のいずれかもしくは両方に無効アクセス検出の情報を伝達するように動作することを特徴とする請求項1〜6のいずれかに記載の半導体装置。
The other resource has a limited area of any of the internal resources compared to the one product.
When the debug information input / output device and the debug host are connected, the restricted internal resource is determined based on the kind information stored in the kind information storage area, and the restricted internal resource area is centralized. When there is a write or read access from the processing device, this access is determined to be invalid access, and invalid access detection information is transmitted to one or both of the central processing unit and the debug information input / output device. The semiconductor device according to claim 1, wherein the semiconductor device operates.
前記他の品種は前記一の品種に比べていずれかの前記内部資源の領域が制限されており、
前記デバッグ情報入出力装置と前記デバッグホストとの接続時において、前記品種情報格納領域に格納された品種情報に基づいて前記制限された内部資源を判別し、この制限された内部資源の領域を活性化するように前記中央処理装置から書き込みのアクセスがあった場合にはこのアクセスを無効アクセスと判断し、前記中央処理装置および前記デバッグ情報入出力装置のいずれかもしくは両方に無効アクセス検出の情報を伝達するように動作することを特徴とする請求項1〜7のいずれかに記載の半導体装置。
The other resource has a limited area of any of the internal resources compared to the one product.
When the debug information input / output device and the debug host are connected, the restricted internal resource is determined based on the kind information stored in the kind information storage area, and the restricted internal resource area is activated. If there is a write access from the central processing unit, the access is determined as invalid access, and invalid access detection information is sent to one or both of the central processing unit and the debug information input / output device. The semiconductor device according to claim 1, wherein the semiconductor device operates to transmit.
JP2005115775A 2005-04-13 2005-04-13 Semiconductor device Pending JP2006293824A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005115775A JP2006293824A (en) 2005-04-13 2005-04-13 Semiconductor device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005115775A JP2006293824A (en) 2005-04-13 2005-04-13 Semiconductor device

Publications (1)

Publication Number Publication Date
JP2006293824A true JP2006293824A (en) 2006-10-26

Family

ID=37414315

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005115775A Pending JP2006293824A (en) 2005-04-13 2005-04-13 Semiconductor device

Country Status (1)

Country Link
JP (1) JP2006293824A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008250373A (en) * 2007-03-29 2008-10-16 Toshiba Corp Multiprocessor system
US10761969B2 (en) 2017-10-19 2020-09-01 Samsung Electronics Co., Ltd. Nonvolatile memory device and operation method thereof
JP2021006960A (en) * 2019-06-28 2021-01-21 株式会社アクセル Memory controller and nonvolatile storage device
US11256605B2 (en) 2017-10-19 2022-02-22 Samsung Electronics Co., Ltd. Nonvolatile memory device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8380933B2 (en) 2007-03-20 2013-02-19 Kabushiki Kaisha Toshiba Multiprocessor system including processor cores and a shared memory
JP2008250373A (en) * 2007-03-29 2008-10-16 Toshiba Corp Multiprocessor system
US10761969B2 (en) 2017-10-19 2020-09-01 Samsung Electronics Co., Ltd. Nonvolatile memory device and operation method thereof
US11256605B2 (en) 2017-10-19 2022-02-22 Samsung Electronics Co., Ltd. Nonvolatile memory device
JP2021006960A (en) * 2019-06-28 2021-01-21 株式会社アクセル Memory controller and nonvolatile storage device

Similar Documents

Publication Publication Date Title
EP0911735B1 (en) Microprocessor test system
JPH011039A (en) In-circuit emulator
US7913118B2 (en) In-circuit debugging system and related method
CN100437485C (en) System and method for configuring a computer system
JP2006293824A (en) Semiconductor device
US7210064B2 (en) Program controlled unit and method for debugging programs executed by a program controlled unit
JP4024026B2 (en) Semiconductor device and evaluation device
TWI769399B (en) Chip having debug memory interface and debug method thereof
JP2003263339A (en) Debug function-incorporated microcomputer
US6560698B1 (en) Register change summary resource
JP2005353020A (en) Simulation system for computer program
WO2019169615A1 (en) Method for accessing code sram, and electronic device
TWI794996B (en) Apparatus and system for debugging solid state disk devices
JP4324149B2 (en) Emulator and development support system using it
JPH0550016B2 (en)
JP2005338892A (en) Memory abnormal usage detecting device
JP2677043B2 (en) Program development support device
JP3166667B2 (en) Emulation microcomputer
JPH10247187A (en) One-chip microcomputer
JPS63291135A (en) Microcomputer developing device
JP2007323283A (en) Card type computer, computer system and debug method
JP2007157060A (en) Multiprocessor system, initiating method and program
JPH1021110A (en) Emulator
JPH04296942A (en) Microprocessor containing debugging function
JP2000132536A (en) Computer

Legal Events

Date Code Title Description
RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20061012