JP2012222614A - Semiconductor device - Google Patents

Semiconductor device Download PDF

Info

Publication number
JP2012222614A
JP2012222614A JP2011086470A JP2011086470A JP2012222614A JP 2012222614 A JP2012222614 A JP 2012222614A JP 2011086470 A JP2011086470 A JP 2011086470A JP 2011086470 A JP2011086470 A JP 2011086470A JP 2012222614 A JP2012222614 A JP 2012222614A
Authority
JP
Japan
Prior art keywords
state
data processing
predetermined
semiconductor device
designation code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP2011086470A
Other languages
Japanese (ja)
Inventor
Junpei Inoue
淳平 井上
Naoki Yada
直樹 矢田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Renesas Electronics Corp
Original Assignee
Renesas Electronics Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Renesas Electronics Corp filed Critical Renesas Electronics Corp
Priority to JP2011086470A priority Critical patent/JP2012222614A/en
Publication of JP2012222614A publication Critical patent/JP2012222614A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To set a state of an external terminal in a programmable way according to a condition after an operation start such as a type of a program to execute and a type of abnormality occurring.SOLUTION: Control data for controlling terminal states of input/output terminals at the time of abnormality occurrence with respect to each state of data processing executed by a program processing circuit, each type of program or each type of data processing executed by the program processing circuit, or each type of abnormality caused by data processing is preliminarily stored in a nonvolatile storage part (140). A search key for identifying the control data stored in the nonvolatile storage part is successively set before program execution or at the time of program execution. In the case where abnormality occurs, the state of each of the input/output terminals is set at a state of pull-up, pull-down, high-impedance or holding previous value in accordance with the control data referred based on the search key.

Description

本発明は、半導体装置の外部端子に対する初期設定若しくはプリセットに関し、例えばマイクロコンピュータ若しくはデータプロセッサなどのデータ処理デバイスにおける異常発生時の外部端子に対する初期化機能に適用して有効な技術に関する。   The present invention relates to an initial setting or preset for an external terminal of a semiconductor device, and relates to a technique effective when applied to an initialization function for an external terminal when an abnormality occurs in a data processing device such as a microcomputer or a data processor.

特許文献1には、電源投入時の初期化動作の一環として、不揮発性メモリの制御データでスイッチ制御されるスイッチを用いて入出力ポートの入力状態を選択的にプルアップまたはプルダウン状態にすることができる半導体装置について記載される。これにより、半導体装置にプルアップ回路又はプルダウン回路を外付けすることを要しない。更に制御データを変更することによって入出力ポートの初期状態を可変に設定することが可能になる。   In Patent Document 1, as part of the initialization operation at the time of power-on, the input state of the input / output port is selectively set to the pull-up or pull-down state using a switch that is switch-controlled by the control data of the nonvolatile memory. A semiconductor device is described. Thereby, it is not necessary to attach a pull-up circuit or a pull-down circuit to the semiconductor device. Further, the initial state of the input / output port can be variably set by changing the control data.

特開2010−147606号公報JP 2010-147606 A

特許文献1に記載の技術は電源投入時の初期化動作において入出力ポートの初期状態を決定するものであり、一度状態が決定されれば、その状態は電源が遮断されるまで維持される。初期設定後の変更については特に考慮されていない。本発明者は、電源投入時の初期化だけでなく、割り込みや例外の発生、電源電圧の不所望な低下等の事象がデータ処理途上で発生したとき、それに応じてモード端子や制御端子などの外部端子の入出力状態をプログラマブルに制御することについて検討した。即ち、半導体装置が実行するプログラムの種類毎、さらには発生した異常の種類毎など、状況に合わせて所望の外部端子の状態を固定できるようにすることがシステム構成さらにはシステム動作の柔軟性を高めることが可能になると認識した。特許文献1ではそのような観点について全く着眼されていない。   The technique described in Patent Document 1 determines an initial state of an input / output port in an initialization operation when power is turned on. Once the state is determined, the state is maintained until the power is turned off. No particular consideration is given to changes after the initial setting. The present inventor not only performs initialization at power-on, but also generates an interrupt or exception, an event such as an undesired decrease in power supply voltage occurs during data processing, and accordingly, a mode terminal, a control terminal, etc. We studied how to control the input / output states of external terminals in a programmable manner. In other words, it is possible to fix the state of the desired external terminal according to the situation, such as the type of program executed by the semiconductor device, and also the type of abnormality that has occurred. Recognized that it would be possible to increase. Patent Document 1 does not focus on such a viewpoint at all.

本発明の目的は、実行するプログラムの種類又は発生する異常の種類などの、動作開始後の状況に合わせて外部端子の状態をプログラムブルに設定することができる半導体装置を提供することにある。   An object of the present invention is to provide a semiconductor device in which the state of an external terminal can be set in a programmable manner in accordance with the situation after the start of operation, such as the type of program to be executed or the type of abnormality that occurs.

本発明の前記並びにその他の目的と新規な特徴は本明細書の記述及び添付図面から明らかになるであろう。   The above and other objects and novel features of the present invention will be apparent from the description of this specification and the accompanying drawings.

本願において開示される発明のうち代表的なものの概要を簡単に説明すれば下記の通りである。   The following is a brief description of an outline of typical inventions disclosed in the present application.

すなわち、プログラム処理回路によるデータ処理状態、前記プログラム処理回路が実行するプログラム若しくはデータ処理の種類、あるいはデータ処理による異常の種別毎に、異常発生時の入出力端子の端子状態を制御する制御データを予め不揮発性記憶部に保存し、プログラム実行前若しくはプログラムの実行時に逐次に不揮発性記憶部に前記制御データを特定する検索キーを設定する。異常が発生した場合は、当該検索キーに基づいて参照された制御データに従って、入出力端子の状態をプルアップ、プルダウン、ハイインピーダンス又は前値保持の状態に設定する。   That is, for each data processing state by the program processing circuit, a type of program or data processing executed by the program processing circuit, or for each type of abnormality due to data processing, control data for controlling the terminal state of the input / output terminals when an abnormality occurs A search key is stored in advance in the non-volatile storage unit, and a search key for specifying the control data is sequentially set in the non-volatile storage unit before or during execution of the program. When an abnormality occurs, the state of the input / output terminal is set to a pull-up, pull-down, high impedance, or previous value holding state in accordance with the control data referred to based on the search key.

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

すなわち、実行するプログラムの種類又は発生する異常の種類などの、動作開始後の状況に合わせて外部端子の状態をプログラマブルに固定することができる。したがって、半導体装置が認識した異常やそのとき当該半導体装置が実行中のプログラムに応じて、当該半導体装置の外部端子に接続された周辺回路の状態、更には当該半導体装置自らの状態を所要の状態に制御することができる。   That is, the state of the external terminal can be fixed in a programmable manner according to the situation after the start of operation, such as the type of program to be executed or the type of abnormality that occurs. Therefore, depending on the abnormality recognized by the semiconductor device and the program currently being executed by the semiconductor device, the state of the peripheral circuit connected to the external terminal of the semiconductor device, and further the state of the semiconductor device itself is a required state. Can be controlled.

図1は本発明の第1の実施の形態に係る半導体装置を例示するブロック図である。FIG. 1 is a block diagram illustrating a semiconductor device according to the first embodiment of the invention. 図2は図1の半導体装置のデータ処理動作に伴う不揮発性記憶部の動作タイミングを例示するタイミングチャートである。FIG. 2 is a timing chart illustrating the operation timing of the nonvolatile memory unit accompanying the data processing operation of the semiconductor device of FIG. 図3は図1の半導体装置を用いたデータ処理システムを例示するブロック図である。FIG. 3 is a block diagram illustrating a data processing system using the semiconductor device of FIG. 図4は図3のデータ処理システムの動作タイミングを例示するタイミングチャートである。FIG. 4 is a timing chart illustrating the operation timing of the data processing system of FIG. 図5は図1の半導体装置を用いたデータ処理システムの別の例示を示すブロック図である。FIG. 5 is a block diagram showing another example of a data processing system using the semiconductor device of FIG. 図6は図5のデータ処理システムの動作タイミングを例示するタイミングチャートである。FIG. 6 is a timing chart illustrating the operation timing of the data processing system of FIG. 図7は本発明の第2の実施の形態に係る半導体装置を例示するブロック図である。FIG. 7 is a block diagram illustrating a semiconductor device according to the second embodiment of the invention. 図8は図7の半導体装置のデータ処理動作に伴う不揮発性記憶部を用いた動作タイミングを例示するタイミングチャートである。FIG. 8 is a timing chart illustrating the operation timing using the nonvolatile memory portion accompanying the data processing operation of the semiconductor device of FIG. 図9は図7の半導体装置を用いたデータ処理システムを例示するブロック図である。FIG. 9 is a block diagram illustrating a data processing system using the semiconductor device of FIG. 図10は図9のデータ処理システムで用いる第1ルックアップテーブル244の記憶情報を例示する説明図である。FIG. 10 is an explanatory diagram illustrating information stored in the first lookup table 244 used in the data processing system of FIG. 図11は図9のデータ処理システムで用いる第2ルックアップテーブルの記憶情報を例示する説明図である。FIG. 11 is an explanatory diagram illustrating information stored in the second lookup table used in the data processing system of FIG. 図12は本発明の第3の実施の形態に係る半導体装置を例示するブロック図である。FIG. 12 is a block diagram illustrating a semiconductor device according to the third embodiment of the invention. 図13は本発明の第4の実施の形態に係る半導体装置を例示するブロック図である。FIG. 13 is a block diagram illustrating a semiconductor device according to the fourth embodiment of the invention.

1.実施の形態の概要
先ず、本願において開示される発明の代表的な実施の形態について概要を説明する。代表的な実施の形態についての概要説明で括弧を付して参照する図面中の参照符号はそれが付された構成要素の概念に含まれるものを例示するに過ぎない。
1. First, an outline of a typical embodiment of the invention disclosed in the present application will be described. Reference numerals in the drawings referred to in parentheses in the outline description of the representative embodiments merely exemplify what are included in the concept of the components to which the reference numerals are attached.

〔1〕<所定事象発生時の内部状態に応じた外部端子の設定、ハード依存>
本発明の代表的な実施の形態に係る半導体装置(100)は、複数個の外部端子(106)と、前記外部端子に接続されたインタフェース部(105)と、前記インタフェース部を制御するインタフェース制御部(132)と、を有する。更に前記半導体装置は、前記インタフェース制御部から入力した入力信号の処理、前記インタフェース部から出力する出力信号の生成、及びその他のデータ処理を行うデータ処理部(101)と、前記データ処理部に接続された不揮発性記憶部(140)と、を有する。前記インタフェース部は、所定の前記外部端子に出力端子が接続されたトライステート出力バッファ回路(110)と、所定の前記外部端子に入力端子が接続された入力バッファ回路(111)と、所定の前記外部端子に接続され当該外部端子を選択的にプルアップ、プルダウン、オープン又は前値保持の状態に設定する端子状態設定回路(112)とを有する。前記不揮発性記憶部は、前記外部端子の状態を指定するための状態指定コードを検索キーとする制御データのルックアップテーブル(141)を格納する領域を有し、前記データ処理部によるデータ処理に従って予め前記状態指定コードが格納され、前記データ処理部から所定事象の発生が通知されたとき前記データ処理に従って予め格納された前記状態指定コードを用いて前記ルックアップテーブルから制御データを読み出す。前記インタフェース制御部は前記読み出された前記制御データに従って前記トライステート出力バッファ回路及び前記端子状態設定回路を制御して前記所定の外部端子の状態を決定する。
[1] <External terminal setting according to the internal state when a predetermined event occurs, depending on hardware>
A semiconductor device (100) according to a representative embodiment of the present invention includes a plurality of external terminals (106), an interface unit (105) connected to the external terminals, and interface control for controlling the interface unit. Part (132). Further, the semiconductor device is connected to the data processing unit and a data processing unit (101) for processing an input signal input from the interface control unit, generating an output signal output from the interface unit, and other data processing A non-volatile storage unit (140). The interface unit includes a tristate output buffer circuit (110) having an output terminal connected to the predetermined external terminal, an input buffer circuit (111) having an input terminal connected to the predetermined external terminal, and the predetermined A terminal state setting circuit (112) that is connected to the external terminal and selectively sets the external terminal to a pull-up, pull-down, open, or previous value holding state; The non-volatile storage unit has an area for storing a control data look-up table (141) using a state specification code for specifying the state of the external terminal as a search key, and according to data processing by the data processing unit The state designation code is stored in advance, and when the occurrence of a predetermined event is notified from the data processing unit, control data is read from the lookup table using the state designation code stored in advance according to the data processing. The interface control unit controls the tristate output buffer circuit and the terminal state setting circuit according to the read control data to determine the state of the predetermined external terminal.

これにより、ルックアップテーブルを用意し、データ処理部によるデータ処理に従って予め状態指定コードを格納し、異常発生時などには当該状態指定コードを用いてルックアップテーブルを参照するから、実行するデータ処理状況に合わせて外部端子の状態をプログラマブルに設定することができる。特に、検索キーを用いたルックアップテーブルの検索と検索した制御データの入出力制御回路への供給を不揮発性記憶部が自立的に行うから、その処理には所定事象発生時にデータ処理部の健全性を担保しておくことを要しない。したがって、半導体装置が認識した異常やそのとき当該半導体装置が実行中のプログラムに応じて、当該半導体装置の外部端子に接続された周辺回路の状態、更には当該半導体装置自らの状態を所要の状態に制御することができる。   As a result, a lookup table is prepared, the state designation code is stored in advance according to the data processing by the data processing unit, and when the abnormality occurs, the lookup table is referenced using the state designation code. The state of the external terminal can be set in a programmable manner according to the situation. In particular, the non-volatile storage unit autonomously searches the lookup table using the search key and supplies the retrieved control data to the input / output control circuit. It is not necessary to secure sex. Therefore, depending on the abnormality recognized by the semiconductor device and the program currently being executed by the semiconductor device, the state of the peripheral circuit connected to the external terminal of the semiconductor device, and further the state of the semiconductor device itself is a required state. Can be controlled.

〔2〕<予め不揮発性レジスタに格納された状態指定コードを異常発生時に用いる>
項1の半導体装置において、前記不揮発性記憶部は、前記データ処理部によって前記状態指定コードを書き込み可能な不揮発性の状態指定コードレジスタ(143)を有し、前記データ処理部から所定事象の発生が通知されたとき前記状態指定コードレジスタの状態指定コードを用いて前記ルックアップテーブルから検索した前記制御データを前記インタフェース部に出力する。
[2] <Use state designation code stored in nonvolatile register in advance when an abnormality occurs>
2. The semiconductor device according to item 1, wherein the nonvolatile storage unit includes a nonvolatile state designation code register (143) in which the state designation code can be written by the data processing unit, and a predetermined event is generated from the data processing unit. Is notified, the control data retrieved from the lookup table using the state designation code of the state designation code register is output to the interface unit.

これによれば、データ処理の種別ごとにそれに対応する所定事象発生時の状態指定コードを不揮発性の状態指定コードレジスタにあらかじめ書き込めばよいから、予め設定された状態指定コードが所定事象の発生時によって失われたり変化されたりする事態の発生を未然に防止することができる。   According to this, since the state designation code corresponding to the occurrence of the predetermined event corresponding to each type of data processing has only to be written in the nonvolatile state designation code register in advance, the preset state designation code is used when the predetermined event occurs. It is possible to prevent the occurrence of a situation that is lost or changed by this.

〔3〕<データ処理部がデータ処理の一環として不揮発性のレジスタに制御コードをセット>
項2の半導体装置において、前記データ処理部はデータ処理の一環として、当該データ処理の先頭で所要の状態指定コードを予め前記状態指定コードレジスタに書き込む。
[3] <Data processing unit sets control code in nonvolatile register as part of data processing>
In the semiconductor device according to Item 2, the data processing unit writes a required status designation code in the status designation code register in advance at the beginning of the data processing as part of the data processing.

これによれば、データ処理部はデータ処理の種別ごとにそれに対応する所定事象発生時の状態指定コードを不揮発性記憶部に書き込む操作を負担すればよい。   According to this, the data processing part should just bear operation which writes the state designation | designated code at the time of the predetermined event corresponding to each classification of data processing in a non-volatile memory | storage part.

〔4〕<トライステート出力バッファをHiZにして端子状態を設定>
項3の半導体装置において、前記インタフェース制御部は、前記制御データに従って前記トライステート出力バッファをハイインピーダンスにして前記端子状態設定回路をプルアップ、プルダウン、オープン又は前値保持の状態とすることにより前記所定の外部端子の状態を決定する。
[4] <Set tristate output buffer to HiZ and set pin state>
In the semiconductor device according to Item 3, the interface control unit sets the terminal state setting circuit in a pull-up, pull-down, open, or previous value holding state by setting the tristate output buffer to high impedance according to the control data. The state of a predetermined external terminal is determined.

所定の事象が発生したときトライステート出力バッファがどの状態にあっても、制御データが指示する状態に外部入出力端子を安定化させることが容易になる。   Regardless of the state of the tristate output buffer when a predetermined event occurs, it becomes easy to stabilize the external input / output terminal to the state indicated by the control data.

〔5〕<電源電圧低下に応じた端子状態の設定>
項3の半導体装置において、前記所定の事象が電源検出器(152)によって検出される電源電圧の所定電圧以下への変化であるとき、前記不揮発性記憶部は、前記データ処理部から前記電源電圧の所定電圧以下への変化が通知されることにより、前記状態指定コードレジスタが保有する状態指定コードを用いてルックアップテーブルから検索した前記制御データを前記インタフェース部に出力する。
[5] <Pin state setting according to power supply voltage drop>
In the semiconductor device according to Item 3, when the predetermined event is a change of a power supply voltage detected by a power supply detector (152) to a predetermined voltage or less, the nonvolatile memory unit receives the power supply voltage from the data processing unit. When the change to the predetermined voltage or lower is notified, the control data retrieved from the look-up table using the state designation code stored in the state designation code register is output to the interface unit.

電源電圧の所定電圧以下への変化に応答して所定の外部端子の状態を所望に設定することができる。   The state of the predetermined external terminal can be set as desired in response to the change of the power supply voltage to a predetermined voltage or less.

〔6〕<所定の割り込み要因又は例外要因に応じた端子状態の設定>
項3の半導体装置において、前記所定の事象が所定の割り込み要因又は例外要因であるとき、前記不揮発性記憶部は、前記データ処理部から前記所定の割り込み要因又は例外要因の発生が通知されることにより、前記状態指定コードレジスタが保有する状態指定コードを用いてルックアップテーブルから検索した前記制御データを前記インタフェース部に出力する。
[6] <Pin state setting according to a predetermined interrupt factor or exception factor>
In the semiconductor device according to Item 3, when the predetermined event is a predetermined interrupt factor or exception factor, the nonvolatile storage unit is notified of the occurrence of the predetermined interrupt factor or exception factor from the data processing unit. Thus, the control data retrieved from the lookup table using the state designation code held in the state designation code register is output to the interface unit.

所定の割り込み要因又は例外要因の発生に応答して所定の外部端子の状態を所望に設定することができる。   The state of the predetermined external terminal can be set as desired in response to occurrence of a predetermined interrupt factor or exception factor.

〔7〕<所定事象発生時の命令実行アドレスと当該事象発生要因に基づく外部端子の設定、ハード依存>
本発明の別の実施の形態に係る半導体装置(200)は、複数個の外部端子(106)と、前記外部端子に接続されたインタフェース部(105)と、前記インタフェース部を制御するインタフェース制御部(132)と、を有する。更に前記半導体装置は、前記インタフェース制御部から入力した入力信号の処理、前記インタフェース部から出力する出力信号の生成、命令を実行するプログラム処理及びその他のデータ処理を行うデータ処理部(201)と、前記データ処理部に接続された不揮発性記憶部(240)と、を有する。前記インタフェース部は、所定の前記外部端子に出力端子が接続されたトライステート出力バッファ回路(110)と、所定の前記外部端子に入力端子が接続された入力バッファ回路(111)と、所定の前記外部端子に接続され当該外部端子を選択的にプルアップ、プルダウン、オープン又は前値保持の状態に設定する端子状態設定回路(112)とを有する。前記不揮発性記憶部は、前記データ処理部による現在の実行命令アドレスを捕捉するための命令アドレス情報を逐次保持する不揮発性の実行アドレスレジスタ(243)を格納する領域を有する。更に前記不揮発性記憶部は、前記データ処理部が実行するプログラムアドレス範囲毎に、その範囲のプログラムの実行中に想定される所定事象の発生要因に外部端子の状態指定コードを対応付けた第1ルックアップテーブル(244)と、前記状態指定コードを検索キーとする制御データの第2ルックアップテーブル(241)と、を格納する領域を有する。更に前記不揮発性記憶部は、前記データ処理部から所定事象の発生が通知されたとき前記実行アドレスレジスタの命令アドレス情報及び当該所定事象の発生要因に基づいて前記第1ルックアップテーブルから状態指定コードを取得すると共に取得した状態指定コードを用いて前記第2のルックアップテーブルから制御データを読み出してインタフェース制御部に与える。前記インタフェース制御部は、与えられた制御データに従って前記トライステート出力バッファ回路及び前記端子状態設定回路を制御して前記所定の外部端子の状態を決定する。
[7] <Instruction execution address when a predetermined event occurs and external terminal setting based on the event occurrence factor, hardware-dependent>
A semiconductor device (200) according to another embodiment of the present invention includes a plurality of external terminals (106), an interface unit (105) connected to the external terminals, and an interface control unit that controls the interface unit. (132). Further, the semiconductor device includes a data processing unit (201) that performs processing of an input signal input from the interface control unit, generation of an output signal output from the interface unit, program processing for executing an instruction, and other data processing; A nonvolatile storage unit (240) connected to the data processing unit. The interface unit includes a tristate output buffer circuit (110) having an output terminal connected to the predetermined external terminal, an input buffer circuit (111) having an input terminal connected to the predetermined external terminal, and the predetermined A terminal state setting circuit (112) that is connected to the external terminal and selectively sets the external terminal to a pull-up, pull-down, open, or previous value holding state; The non-volatile storage unit has an area for storing a non-volatile execution address register (243) that sequentially holds instruction address information for capturing a current execution instruction address by the data processing unit. Further, the nonvolatile storage unit is configured to associate a state designation code of an external terminal with a cause of occurrence of a predetermined event assumed during execution of a program in the range for each program address range executed by the data processing unit. It has an area for storing a lookup table (244) and a second lookup table (241) of control data using the state designation code as a search key. Further, when the occurrence of a predetermined event is notified from the data processing unit, the non-volatile storage unit receives a state designation code from the first lookup table based on the instruction address information of the execution address register and the occurrence factor of the predetermined event. And the control data is read from the second look-up table using the acquired state designation code and provided to the interface control unit. The interface control unit controls the tristate output buffer circuit and the terminal state setting circuit according to the given control data to determine the state of the predetermined external terminal.

これにより、第1及び第2ルックアップテーブルを予め不揮発性メモリ部に用意し、データ処理の進行とともに実行アドレスレジスタの情報を実行アドレスのアドレス情報に書き換えてゆき、異常発生時などにはその実行アドレス情報に基づいて第1及び第2ルックアップテーブルを参照するから、実行するデータ処理状況に合わせて外部端子の状態をプログラマブルに設定することができる。特に、第1及び第2ルックアップテーブルを用いた制御データの検索と検索した制御データの入出力制御回路への供給を不揮発性記憶部が自立的に行うから、その処理には所定事象発生時にデータ処理部の健全性を担保しておくことを要しない。したがって、半導体装置が認識した異常やそのとき当該半導体装置が実行中のプログラムに応じて、当該半導体装置の外部端子に接続された周辺回路の状態、更には当該半導体装置自らの状態を所要の状態に制御することができる。   As a result, the first and second look-up tables are prepared in the non-volatile memory portion in advance, and the information in the execution address register is rewritten with the address information of the execution address as the data processing proceeds. Since the first and second lookup tables are referred to based on the address information, the state of the external terminal can be set in a programmable manner according to the data processing status to be executed. In particular, the non-volatile storage unit autonomously searches for control data using the first and second look-up tables and supplies the retrieved control data to the input / output control circuit. There is no need to ensure the soundness of the data processing department. Therefore, depending on the abnormality recognized by the semiconductor device and the program currently being executed by the semiconductor device, the state of the peripheral circuit connected to the external terminal of the semiconductor device, and further the state of the semiconductor device itself is a required state. Can be controlled.

〔8〕<MRAMで構成された実行アドレスレジスタ>
項7の半導体装置において前記実行アドレスレジスタはMRAM(Magnetoresistive Random Access Memory)である。
[8] <Execution address register configured with MRAM>
In the semiconductor device of item 7, the execution address register is an MRAM (Magnetoresistive Random Access Memory).

命令実行サイクルに同期した命令アドレスの高速な書き換えが可能である。   The instruction address can be rewritten at high speed in synchronization with the instruction execution cycle.

〔9〕<トライステート出力バッファをHiZにして端子状態を設定>
項7の半導体装置において、前記インタフェース制御部は、前記制御データに従って前記トライステート出力バッファをハイインピーダンスにして前記端子状態設定回路をプルアップ、プルダウン、オープン又は前値保持の状態とすることにより前記所定の外部端子の状態を決定する。
[9] <Set the terminal state by setting the tristate output buffer to HiZ>
In the semiconductor device according to Item 7, the interface control unit sets the terminal state setting circuit in a pull-up, pull-down, open, or previous value holding state by setting the tristate output buffer to high impedance according to the control data. The state of a predetermined external terminal is determined.

所定の事象が発生したときトライステート出力バッファがどの状態にあっても、制御データが指示する状態に外部入出力端子を容易に安定化させることが可能になる。   It is possible to easily stabilize the external input / output terminal to the state indicated by the control data regardless of the state of the tristate output buffer when a predetermined event occurs.

〔10〕<電源電圧低下に応じた端子状態の設定>
項7の半導体装置において、前記所定の事象の発生要因が電源検出器によって検出される電源電圧の所定電圧以下への変化であるとき、前記不揮発性メモリ部は、前記所定電圧以下への変化による割り込み要因の発生が前記データ処理部から通知されることにより、前記実行アドレスレジスタの値と前記要因とに対応する前記状態指定コードを第1ルックアップテーブルから取得する。そして、取得した状態指定コードを用いて前記第2のルックアップテーブルから制御データを取得して前記インタフェース部に出力する。
[10] <Setting of terminal state according to power supply voltage drop>
In the semiconductor device according to Item 7, when the generation factor of the predetermined event is a change of a power supply voltage detected by a power supply detector to a predetermined voltage or less, the nonvolatile memory unit is caused by a change to the predetermined voltage or less. When the occurrence of the interrupt factor is notified from the data processing unit, the state designation code corresponding to the value of the execution address register and the factor is acquired from the first lookup table. Then, the control data is acquired from the second look-up table using the acquired state designation code and output to the interface unit.

電源電圧の所定電圧以下への変化に応答して所定の外部端子の状態を所望に設定することができる。   The state of the predetermined external terminal can be set as desired in response to the change of the power supply voltage to a predetermined voltage or less.

〔11〕<所定の割り込み要因又は例外要因に応じた端子状態の設定>
項7の半導体装置において、前記所定の事象の発生要因が所定の割り込み要因又は例外要因であるとき、前記不揮発性記憶部は、前記所定の割り込み要因又は例外要因の発生が前記データ処理部から通知されると、そのときの実行アドレスレジスタの値と前記要因とに対応する前記状態指定コードを第1ルックアップテーブルから取得する。そして、取得した状態指定コードを用いて前記第2のルックアップテーブルから制御データを読み出して前記インタフェース部に出力する。
[11] <Pin state setting according to predetermined interrupt factor or exception factor>
In the semiconductor device according to Item 7, when the occurrence factor of the predetermined event is a predetermined interrupt factor or an exception factor, the nonvolatile memory unit notifies the data processing unit of the occurrence of the predetermined interrupt factor or the exception factor. Then, the state designation code corresponding to the value of the execution address register and the factor at that time is acquired from the first lookup table. Then, the control data is read from the second look-up table using the acquired state designation code and output to the interface unit.

所定の割り込み要因又は例外要因の発生に応答して所定の外部端子の状態を所望に設定することができる。   The state of the predetermined external terminal can be set as desired in response to occurrence of a predetermined interrupt factor or exception factor.

〔12〕<所定事象発生時の内部状態に応じた外部端子の設定、ソフト依存>
本発明の更に別の形態に係る半導体装置(300)は、複数個の外部端子と、前記外部端子に接続されたインタフェース部と、前記インタフェース部を制御するインタフェース制御部と、前記インタフェース制御部から入力した入力信号の処理、前記インタフェース部から出力する出力信号の生成、及びその他のデータ処理を行うデータ処理部(101A)と、前記データ処理部に接続された不揮発性記憶部(140A)と、を有する。前記インタフェース部は、所定の前記外部端子に出力端子が接続されたトライステート出力バッファ回路と、所定の前記外部端子に入力端子が接続された入力バッファ回路と、所定の前記外部端子に接続され当該外部端子を選択的にプルアップ、プルダウン、オープン又は前値保持の状態に設定する端子状態設定回路とを有する。前記不揮発性記憶部は前記外部端子の状態を指定するための状態指定コードを検索キーとする制御データのルックアップテーブルを格納する領域を有する。前記データ処理部は、データ処理に従って予め前記状態指定コードを不揮発性記憶部に格納し、所定の事象の発生が通知されたとき、前記不揮発性記憶部に予め格納されている前記状態指定コードを用いて前記ルックアップテーブルから制御データを読み出す。前記インタフェース制御部は前記読み出された前記制御データに従って前記トライステート出力バッファ回路及び前記端子状態設定回路を制御して前記所定の外部端子の状態を決定する。
[12] <External terminal setting according to internal state when a predetermined event occurs, software dependent>
A semiconductor device (300) according to still another embodiment of the present invention includes a plurality of external terminals, an interface unit connected to the external terminals, an interface control unit that controls the interface unit, and the interface control unit. A data processing unit (101A) that performs processing of input signals, generation of output signals output from the interface unit, and other data processing; a non-volatile storage unit (140A) connected to the data processing unit; Have The interface unit includes a tristate output buffer circuit having an output terminal connected to the predetermined external terminal, an input buffer circuit having an input terminal connected to the predetermined external terminal, and a predetermined external terminal connected to the interface unit. And a terminal state setting circuit for selectively setting the external terminal to a pull-up, pull-down, open, or previous value holding state. The nonvolatile storage unit has an area for storing a control data look-up table using a state designation code for designating the state of the external terminal as a search key. The data processing unit stores the state designation code in the nonvolatile storage unit in advance according to data processing, and when the occurrence of a predetermined event is notified, the state designation code stored in the nonvolatile storage unit is stored in advance. To read control data from the lookup table. The interface control unit controls the tristate output buffer circuit and the terminal state setting circuit according to the read control data to determine the state of the predetermined external terminal.

項12の半導体装置は項1の半導体装置に比べて状態指定コードによるルックアップテーブルの検索をデータ処理部で行う点が相違される。したがって、不揮発性記憶部は状態指定コードによるルックアップテーブルの検索機能を備えることを要せず、データ処理部を流用してソフトウェア処理で対処する事ができる。よって、所定事象発生時でもデータ処理部の健全性が担保されていることが前提となり、所定事象発生によってデータ処理部のデータ処理が還元に不能になるような事象の発生には対応することができない。その他の点ついては項1と同様の作用効果を奏する。   The semiconductor device according to item 12 is different from the semiconductor device according to item 1 in that the data processing unit searches the lookup table using the state designation code. Therefore, the nonvolatile storage unit does not need to have a lookup table search function based on the state designation code, and can deal with software processing by using the data processing unit. Therefore, it is premised that the soundness of the data processing unit is ensured even when a predetermined event occurs, and it is possible to cope with the occurrence of an event where the data processing of the data processing unit becomes impossible to return due to the occurrence of the predetermined event. Can not. About the other point, there exists an effect similar to item 1.

〔13〕<予め不揮発性レジスタに格納された状態指定コードを異常発生時に用いる>
項12の半導体装置において、前記不揮発性記憶部は前記データ処理部によって前記状態指定コードを書き込み可能な不揮発性の状態指定コードレジスタ(143)を有する。前記データ処理部は所定事象の発生を検出したとき前記状態指定コードレジスタの状態指定コードを用いて前記ルックアップテーブルから検索した前記制御データを前記インタフェース部に出力する。
[13] <Use state designation code stored in advance in nonvolatile register when abnormality occurs>
In the semiconductor device according to item 12, the nonvolatile storage unit includes a nonvolatile state designation code register (143) into which the state designation code can be written by the data processing unit. When the occurrence of a predetermined event is detected, the data processing unit outputs the control data retrieved from the lookup table using the state designation code of the state designation code register to the interface unit.

これによれば、データ処理の種別ごとにそれに対応する所定事象発生時の状態指定コードを不揮発性の状態指定コードレジスタにあらかじめ書き込めばよいから、予め設定された状態指定コードが所定事象の発生時によって失われたり変化されたりする事態の発生を未然に防止することができる。   According to this, since the state designation code corresponding to the occurrence of the predetermined event corresponding to each type of data processing has only to be written in the nonvolatile state designation code register in advance, the preset state designation code is used when the predetermined event occurs. It is possible to prevent the occurrence of a situation that is lost or changed by this.

〔14〕<データ処理部がデータ処理の一環として不揮発性のレジスタに制御コードをセット>
項13の半導体装置において、前記データ処理部はデータ処理の一環として、当該データ処理の先頭で所要の状態指定コードを予め前記状態指定コードレジスタに書き込む。
[14] <Data processing unit sets control code in nonvolatile register as part of data processing>
In the semiconductor device according to Item 13, the data processing unit writes a required state designation code in the state designation code register in advance at the beginning of the data processing as part of the data processing.

これによれば、データ処理部はデータ処理の種別ごとにそれに対応する所定事象発生時の状態指定コードを不揮発性記憶部に書き込む操作を負担すればよい。   According to this, the data processing part should just bear operation which writes the state designation | designated code at the time of the predetermined event corresponding to each classification of data processing in a non-volatile memory | storage part.

〔15〕<トライステート出力バッファをHiZにして端子状態を設定>
項14の半導体装置において、前記インタフェース制御部は、前記制御データに従って前記トライステート出力バッファをハイインピーダンスにして前記端子状態設定回路をプルアップ、プルダウン、オープン又は前値保持の状態とすることにより前記所定の外部端子の状態を決定する。
[15] <Set the terminal state by setting the tristate output buffer to HiZ>
14. The semiconductor device according to item 14, wherein the interface control unit sets the terminal state setting circuit in a pull-up, pull-down, open, or previous value holding state by setting the tri-state output buffer to high impedance according to the control data. The state of a predetermined external terminal is determined.

所定の事象が発生したときトライステート出力バッファがどの状態にあっても、制御データが指示する状態に外部入出力端子を安定化させることが容易になる。   Regardless of the state of the tristate output buffer when a predetermined event occurs, it becomes easy to stabilize the external input / output terminal to the state indicated by the control data.

〔16〕<電源電圧低下に応じた端子状態の設定>
項14の半導体装置において、前記所定の事象が電源検出器によって検出される電源電圧の所定電圧以下への変化であるとき、前記データ処理部は電源検出器の出力により前記電源電圧の所定電圧以下への変化を判別することにより、前記状態指定コードレジスタが保有する状態指定コードを用いてルックアップテーブルから検索した前記制御データを前記インタフェース部に出力する。
[16] <Setting of terminal state according to power supply voltage drop>
14. In the semiconductor device according to Item 14, when the predetermined event is a change of a power supply voltage detected by a power supply detector to a predetermined voltage or less, the data processing unit outputs the power supply detector below a predetermined voltage of the power supply voltage or less. The control data retrieved from the look-up table using the state designation code stored in the state designation code register is output to the interface unit.

電源電圧の所定電圧以下への変化に応答して所定の外部端子の状態を所望に設定することができる。   The state of the predetermined external terminal can be set as desired in response to the change of the power supply voltage to a predetermined voltage or less.

〔17〕<所定の割り込み要因又は例外要因に応じた端子状態の設定>
項14の半導体装置において、前記所定の事象が所定の割り込み要因又は例外要因であるとき、前記データ処理部は前記所定の割り込み要因による割り込み処理又は所定の例外要因による例外処理によって、前記状態指定コードレジスタが保有する状態指定コードを用いてルックアップテーブルから検索した前記制御データを前記インタフェース部に出力する。
[17] <Pin state setting according to predetermined interrupt factor or exception factor>
14. In the semiconductor device according to Item 14, when the predetermined event is a predetermined interrupt factor or an exception factor, the data processing unit performs the state designation code by an interrupt process using the predetermined interrupt factor or an exception process using a predetermined exception factor. The control data retrieved from the lookup table using the state designation code held by the register is output to the interface unit.

所定の割り込み要因又は例外要因の発生に応答して所定の外部端子の状態を所望に設定することができる。   The state of the predetermined external terminal can be set as desired in response to occurrence of a predetermined interrupt factor or exception factor.

〔18〕<所定事象発生時の命令実行アドレスと当該事象発生要因に基づく外部端子の設定、ソフト依存>
本発明の更に別の形態に係る半導体装置(400)は、複数個の外部端子と、前記外部端子に接続されたインタフェース部と、前記インタフェース部を制御するインタフェース制御部と、を有する。更に前記半導体装置は、前記インタフェース制御部から入力した入力信号の処理、前記インタフェース部から出力する出力信号の生成、命令を実行するプログラム処理及びその他のデータ処理を行うデータ処理部(201A)と、前記データ処理部に接続された不揮発性記憶部(240A)と、を有する。前記インタフェース部は、所定の前記外部端子に出力端子が接続されたトライステート出力バッファ回路と、所定の前記外部端子に入力端子が接続された入力バッファ回路と、所定の前記外部端子に接続され当該外部端子を選択的にプルアップ、プルダウン、オープン又は前値保持の状態に設定する端子状態設定回路とを有する。前記不揮発性記憶部は、前記データ処理部による現在の実行命令アドレスを捕捉するための命令アドレス情報を逐次保持する不揮発性の実行アドレスレジスタ(243)を格納する領域を有する。更に前記不揮発性記憶部は、前記データ処理部が実行するプログラムアドレス範囲毎に、その範囲のプログラムの実行中に想定される所定事象の発生要因に外部端子の状態指定コードを対応付けた第1ルックアップテーブル(244)と、前記状態指定コードを検索キーとする制御データの第2ルックアップテーブル(241)と、を格納する領域を有する。前記データ処理部は、所定の事象が発生したとき前記実行アドレスレジスタの命令アドレス情報及び当該所定事象の発生要因に基づいて前記第1ルックアップテーブルから状態指定コードを取得すると共に取得した状態指定コードを用いて前記第2のルックアップテーブルから制御データを読み出す。前記インタフェース制御部は、読み出された制御データに従って前記トライステート出力バッファ回路及び前記端子状態設定回路を制御して前記所定の外部端子の状態を決定する。
[18] <Execution execution address when a predetermined event occurs and external terminal setting based on the event occurrence factor, software dependency>
A semiconductor device (400) according to still another embodiment of the present invention includes a plurality of external terminals, an interface unit connected to the external terminals, and an interface control unit that controls the interface unit. Further, the semiconductor device includes a data processing unit (201A) that performs processing of an input signal input from the interface control unit, generation of an output signal output from the interface unit, program processing for executing an instruction, and other data processing, A nonvolatile storage unit (240A) connected to the data processing unit. The interface unit includes a tristate output buffer circuit having an output terminal connected to the predetermined external terminal, an input buffer circuit having an input terminal connected to the predetermined external terminal, and a predetermined external terminal connected to the interface unit. And a terminal state setting circuit for selectively setting the external terminal to a pull-up, pull-down, open, or previous value holding state. The non-volatile storage unit has an area for storing a non-volatile execution address register (243) that sequentially holds instruction address information for capturing a current execution instruction address by the data processing unit. Further, the nonvolatile storage unit is configured to associate a state designation code of an external terminal with a cause of occurrence of a predetermined event assumed during execution of a program in the range for each program address range executed by the data processing unit. It has an area for storing a lookup table (244) and a second lookup table (241) of control data using the state designation code as a search key. The data processing unit acquires a state designation code from the first lookup table based on instruction address information of the execution address register and a cause of occurrence of the predetermined event when a predetermined event occurs, and the obtained state designation code Is used to read control data from the second look-up table. The interface control unit controls the tri-state output buffer circuit and the terminal state setting circuit according to the read control data to determine the state of the predetermined external terminal.

項18の半導体装置は項7の半導体装置に比べて命令アドレスに基づく第1及び第2ルックアップテーブルの検索をデータ処理部で行う点が相違される。したがって、不揮発性記憶部は命令アドレスによる第1ルックアップテーブルの検索機能及び状態指定コードによる第2ルックアップテーブルの検索機能を備えることを要せず、データ処理部を流用してソフトウェア処理で対処する事ができる。よって、所定事象発生時でもデータ処理部の健全性が担保されていることが前提となり、所定事象発生によってデータ処理部のデータ処理が完全不能になるような事象の発生には対応することができない。その他の点については項7と同様の作用効果を奏する。   The semiconductor device according to item 18 is different from the semiconductor device according to item 7 in that the data processing unit searches the first and second lookup tables based on the instruction address. Therefore, the nonvolatile storage unit does not need to have a search function of the first lookup table by the instruction address and a search function of the second lookup table by the state designation code, and can deal with the software processing by diverting the data processing unit. I can do it. Therefore, it is assumed that the soundness of the data processing unit is ensured even when a predetermined event occurs, and it is not possible to deal with the occurrence of an event that makes the data processing of the data processing unit completely impossible due to the occurrence of the predetermined event. . About the other point, there exists an effect similar to item 7.

〔19〕<MRAMで構成された実行アドレスレジスタ>
項18の半導体装置において前記実行アドレスレジスタはMRAMである。
[19] <Execution address register configured with MRAM>
In the semiconductor device of item 18, the execution address register is MRAM.

命令実行サイクルに同期した命令アドレスの高速な書き換えが可能である。   The instruction address can be rewritten at high speed in synchronization with the instruction execution cycle.

〔20〕<トライステート出力バッファをHiZにして端子状態を設定>
項18の半導体装置において、前記インタフェース制御部は、前記制御データに従って前記トライステート出力バッファをハイインピーダンスにして前記端子状態設定回路をプルアップ、プルダウン、オープン又は前値保持の状態とすることにより前記所定の外部端子の状態を決定する。
[20] <Set the terminal state by setting the tristate output buffer to HiZ>
In the semiconductor device according to Item 18, the interface control unit sets the terminal state setting circuit in a pull-up, pull-down, open, or previous value holding state by setting the tristate output buffer to high impedance according to the control data. The state of a predetermined external terminal is determined.

所定の事象が発生したときトライステート出力バッファがどの状態にあっても、制御データが指示する状態に外部入出力端子を用意に安定化させることが可能になる。   In any state of the tri-state output buffer when a predetermined event occurs, the external input / output terminal can be readily stabilized to the state indicated by the control data.

〔21〕<電源電圧低下に応じた端子状態の設定>
項18の半導体装置において、前記所定の事象の発生要因が電源検出器によって検出される電源電圧の所定電圧以下への変化であるとき、前記データ処理部は前記所定電圧以下への変化を要因とする割り込み処理によって、そのときの実行アドレスレジスタの値と前記要因とに対応する前記状態指定コードを第1ルックアップテーブルから取得する。そして、取得した状態指定コードを用いて前記第2のルックアップテーブルから制御データを読み出して前記インタフェース部に出力する。
[21] <Setting of terminal state according to power supply voltage drop>
In the semiconductor device according to Item 18, when the generation factor of the predetermined event is a change of a power supply voltage detected by a power supply detector to a predetermined voltage or less, the data processing unit causes the change to the predetermined voltage or less. The state designation code corresponding to the value of the execution address register and the factor at that time is acquired from the first look-up table. Then, the control data is read from the second look-up table using the acquired state designation code and output to the interface unit.

電源電圧の所定電圧以下への変化に応答して所定の外部端子の状態を所望に設定することができる。   The state of the predetermined external terminal can be set as desired in response to the change of the power supply voltage to a predetermined voltage or less.

〔22〕<所定の割り込み要因又は例外要因に応じた端子状態の設定>
項18の半導体装置において、前記所定の事象の発生要因が所定の割り込み要因又は例外要因であるとき、前記データ処理部は前記所定の割り込み要因による割り込み処理又は所定の例外要因による例外処理によって、そのときの実行アドレスレジスタの値と前記要因とに対応する前記状態指定コードを第1ルックアップテーブルから取得する。そして、取得した状態指定コードを用いて前記第2のルックアップテーブルから制御データを取得して前記インタフェース部に出力する。
[22] <Pin state setting according to predetermined interrupt factor or exception factor>
In the semiconductor device according to Item 18, when the generation factor of the predetermined event is a predetermined interrupt factor or an exception factor, the data processing unit performs the interrupt processing by the predetermined interrupt factor or the exception processing by the predetermined exception factor. The state designation code corresponding to the execution address register value and the factor is obtained from the first lookup table. Then, the control data is acquired from the second look-up table using the acquired state designation code and output to the interface unit.

所定の割り込み要因又は例外要因の発生に応答して所定の外部端子の状態を所望に設定することができる。   The state of the predetermined external terminal can be set as desired in response to occurrence of a predetermined interrupt factor or exception factor.

〔23〕<異常発生時のデータ処理状態に応じて外部端子を設定するシステム>
本発明の更に別の実施の形態に係るデータ処理システムは、データ処理を行う第1半導体装置(100,300)と、前記第1半導体装置に接続されてその制御を受ける第2半導体装置(500〜502)とを有する。前記第1半導体装置は、異常が発生したときに所定の入出力端子の端子状態を前記データ処理の処理毎の状態に応じて制御するための制御データを予め不揮発性メモリ部に保存し、データ処理の処理毎に不揮発性メモリ部に前記制御データを特定する検索キーを逐次設定する。前記第1半導体装置は、前記異常が発生したときは、当該検索キーに基づいて参照した制御データに従って、所定の入出力端子の状態をプルアップ、プルダウン、ハイインピーダンス又は前値保持の状態に設定する。前記第2半導体装置は、前記所定の入出力端子の内の所要端子の状態を入力回路で受けて内部状態を決定し、前記第1半導体装置は、前記所定の入出力端子の内の所要端子の状態を入力回路で受けて内部状態を決定する。
[23] <System for setting external terminals according to data processing state at the time of occurrence of abnormality>
A data processing system according to still another embodiment of the present invention includes a first semiconductor device (100, 300) that performs data processing, and a second semiconductor device (500) that is connected to the first semiconductor device and receives control thereof. To 502). The first semiconductor device stores in advance a control data for controlling a terminal state of a predetermined input / output terminal in accordance with a state for each processing of the data processing when an abnormality occurs in the nonvolatile memory unit, A search key for specifying the control data is sequentially set in the nonvolatile memory unit for each processing. When the abnormality occurs, the first semiconductor device sets a state of a predetermined input / output terminal to a pull-up, pull-down, high impedance, or previous value holding state according to control data referred to based on the search key. To do. The second semiconductor device receives a state of a required terminal among the predetermined input / output terminals by an input circuit to determine an internal state, and the first semiconductor device includes a required terminal among the predetermined input / output terminals. Is received by the input circuit to determine the internal state.

これにより、第1半導体装置は実行するデータ処理状況に合わせて外部端子の状態をプログラマブルに固定することができる。したがって、第1半導体装置が認識した異常やそのとき当該半導体装置が実行中のプログラムに応じて、当該第1半導体装置の外部端子に接続された第2半導体装置の状態、更には第1半導体装置自らの状態を所要の状態に制御することができ、異常発生時におけるデータ処理システムの状態をプログラマブルに決定することが可能になる。   Thereby, the first semiconductor device can fix the state of the external terminal in a programmable manner in accordance with the data processing status to be executed. Therefore, the state of the second semiconductor device connected to the external terminal of the first semiconductor device, and further, the first semiconductor device according to the abnormality recognized by the first semiconductor device and the program being executed by the semiconductor device at that time It is possible to control its own state to a required state, and it is possible to programmably determine the state of the data processing system when an abnormality occurs.

〔24〕<異常発生時の発生要因と実行プログラムアドレスに応じて外部端子を設定するシステム>
本発明の更に別の実施の形態に係るデータ処理システムは、データ処理を行う第1半導体装置(200,400)と、前記第1半導体装置に接続されてその制御を受ける第2半導体装置(600〜606)とを有する。前記第1半導体装置は、異常が発生したときに所定の入出力端子の端子状態を前記データ処理のプログラム範囲及びその範囲のプログラムの実行中に想定される所定事象の発生要因に応じて制御するための制御データを予め不揮発性メモリ部に保存し、データ処理の進行に伴って不揮発性メモリ部に前記制御データを特定する検索キーを逐次設定する。前記異常が発生したときは、当該検索キーに基づいて参照した制御データに従って、所定の入出力端子の状態をプルアップ、プルダウン、ハイインピーダンス又は前値保持の状態に設定する。前記第2半導体装置は前記所定の入出力端子の内の所要端子の状態を入力回路で受けて内部状態を決定し、前記第1半導体装置は前記所定の入出力端子の内の所要端子の状態を入力回路で受けて内部状態を決定する。
[24] <System for setting external terminals according to the cause of occurrence of an abnormality and the execution program address>
A data processing system according to still another embodiment of the present invention includes a first semiconductor device (200, 400) that performs data processing, and a second semiconductor device (600) that is connected to the first semiconductor device and receives control thereof. 606). When an abnormality occurs, the first semiconductor device controls a terminal state of a predetermined input / output terminal according to a program range of the data processing and a generation factor of a predetermined event assumed during execution of the program in the range. The control data for storing the control data is stored in advance in the nonvolatile memory unit, and a search key for specifying the control data is sequentially set in the nonvolatile memory unit as data processing proceeds. When the abnormality occurs, the state of a predetermined input / output terminal is set to a pull-up, pull-down, high impedance, or previous value holding state according to control data referred to based on the search key. The second semiconductor device receives a state of a required terminal among the predetermined input / output terminals by an input circuit to determine an internal state, and the first semiconductor device is a state of the required terminal among the predetermined input / output terminals. Is received by the input circuit to determine the internal state.

項23のデータ処理システムに対して第1半導体装置は異常が発生したときに所定の入出力端子の端子状態を前記データ処理の処理状態だけでなく異常の種別にも応じて制御するための制御データを不揮発性メモリ部に保存する点が相違され、その相違点故に、項23よりもきめ細かく外部端子の状態をプログラマブルに設定することが可能である。   Control for controlling the terminal state of a predetermined input / output terminal according to not only the processing state of the data processing but also the type of abnormality when the abnormality occurs in the first semiconductor device with respect to the data processing system according to Item 23. The difference is that the data is stored in the non-volatile memory section. Because of the difference, the state of the external terminal can be set more finely than the item 23.

2.実施の形態の詳細
実施の形態について更に詳述する。
2. Details of Embodiments Embodiments will be further described in detail.

《実施の形態1》
図1には本発明の一実施の形態に係る半導体装置が例示される。同図に示される半導体装置100は特に制限されないが公知のCMOS集積回路製造技術によって単結晶シリコンのような1個の半導体基板に形成される。半導体装置は外部電源電圧Vextとグランド電圧Vssを受けて動作電源とする。
Embodiment 1
FIG. 1 illustrates a semiconductor device according to an embodiment of the present invention. The semiconductor device 100 shown in the figure is not particularly limited, but is formed on a single semiconductor substrate such as single crystal silicon by a known CMOS integrated circuit manufacturing technique. The semiconductor device receives the external power supply voltage Vext and the ground voltage Vss as an operating power supply.

半導体装置100はシステムオンチップのシステムLSI又はマイクロコンピュータのようなプログラム処理機能を備えたデータ処理デバイスとして構成される。半導体装置100のデータ処理部としてのコアロジック(CRLGC)101は、特に制限されないが、命令を実行するCPU(中央処理装置)、CPUで処理可能なデータ処理機能の一部を負担するアクセラレータ、CPU等のワーク領域として利用されるRAM、及びタイマやDMAC(ダイレクトメモリアクセスコントローラ)などのCPUの周辺回路を備える。コアロジック101のCPUはメモリバス103を介して接続されたプログラムメモリ102から命令をフェッチして実行する。   The semiconductor device 100 is configured as a data processing device having a program processing function such as a system-on-chip system LSI or a microcomputer. The core logic (CRLGC) 101 as a data processing unit of the semiconductor device 100 is not particularly limited, but a CPU (central processing unit) that executes instructions, an accelerator that bears a part of data processing functions that can be processed by the CPU, and a CPU RAM used as a work area, and peripheral circuits of a CPU such as a timer and a DMAC (direct memory access controller). The CPU of the core logic 101 fetches and executes an instruction from the program memory 102 connected via the memory bus 103.

図1には代表的に一つの外部インタフェース部(EXIF)105が例示される。外部インタフェース部105には対応する外部端子106が接続される。外部インタフェース部105は、対応する外部端子106に出力端子が接続されたトライステート出力バッファ回路110、前記外部端子106に入力端子が接続された入力バッファ回路111、端子状態設定回路112、及びトライステート出力バッファ回路110のイネーブル信号生成回路113を備える。   FIG. 1 typically illustrates one external interface unit (EXIF) 105. A corresponding external terminal 106 is connected to the external interface unit 105. The external interface unit 105 includes a tristate output buffer circuit 110 having an output terminal connected to a corresponding external terminal 106, an input buffer circuit 111 having an input terminal connected to the external terminal 106, a terminal state setting circuit 112, and a tristate. An enable signal generation circuit 113 of the output buffer circuit 110 is provided.

端子状態設定回路112は、前記外部端子106に接続され選択スイッチ120を介して当該外部端子106を選択的にプルアップ、プルダウン、オープン又は前値保持の状態に設定する。プルアップの状態は選択スイッチ120で外部端子106を電源電圧Vextに接続して達成される。プルダウンの状態は選択スイッチ120で外部端子106をグランド電圧Vssに接続して達成される。オープンの状態は選択スイッチ120で外部端子106をフローティングノードNCに接続して達成される。前置保持の状態は選択スイッチ120で外部端子106をスタティックラッチSLATに接続して達成される。トライステート出力バッファ回路110が出力動作可能にされるときは選択スイッチ120はオープン状態を選択する。端子状態設定回路112によって外部端子106をプルアップ、プルダウン、オープン又は前値保持の状態に設定するときトライステート出力バッファ回路110はハイインピーダンス状態にされる。   The terminal state setting circuit 112 is connected to the external terminal 106 and selectively sets the external terminal 106 in a pull-up, pull-down, open, or previous value holding state via the selection switch 120. The pull-up state is achieved by connecting the external terminal 106 to the power supply voltage Vext with the selection switch 120. The pull-down state is achieved by connecting the external terminal 106 to the ground voltage Vss with the selection switch 120. The open state is achieved by connecting the external terminal 106 to the floating node NC with the selection switch 120. The pre-holding state is achieved by connecting the external terminal 106 to the static latch SLAT with the selection switch 120. When the tri-state output buffer circuit 110 is enabled for output, the selection switch 120 selects the open state. When the external terminal 106 is set to a pull-up, pull-down, open, or previous value holding state by the terminal state setting circuit 112, the tri-state output buffer circuit 110 is set to a high impedance state.

イネーブル信号生成回路113はトライステート出力バッファ回路110を出力動作可能にするとき選択スイッチ121を介して出力イネーブル信号122をハイレベルに、出力動作不可能にするとき選択スイッチ121を介して出力イネーブル信号122をローレベルにする。   The enable signal generation circuit 113 sets the output enable signal 122 to the high level via the selection switch 121 when enabling the output operation of the tristate output buffer circuit 110, and outputs the enable signal via the selection switch 121 when disabling the output operation. 122 is set to the low level.

インタフェース制御部(IFCNT)132は選択スイッチ120のスイッチ制御信号130、選択スイッチ121のスイッチ制御信号131を生成する。インタフェース制御部132に対するスイッチ制御の指示はコアロジック101又は不揮発性記憶部140が与える。コアロジック101は、パワーオンリセット若しくはシステムリセットが解除されると、スイッチ制御信号131によって端子状態設定回路112にはフローティングノードNCを選択させる。プログラムメモリ102に格納されているプログラムにしたがったデータ処理動作によって外部端子106から出力動作を行うときはスイッチ制御信号130によりイネーブル信号生成回路113にトライステート出力バッファ回路110による出力動作可能な状態を選択させる。入力動作を行うときはスイッチ制御信号130によりイネーブル信号生成回路113にトライステート出力バッファ回路110のハイインピーダンス状態を選択させる。尚、外部インタフェース部105、外部端子106及びインタフェース制御部132は、特に図示はしないが、半導体装置100に必要な分だけ多数配置されているものと理解されたい。   The interface control unit (IFCNT) 132 generates a switch control signal 130 for the selection switch 120 and a switch control signal 131 for the selection switch 121. The switch logic instruction to the interface control unit 132 is given by the core logic 101 or the nonvolatile storage unit 140. When the power-on reset or the system reset is canceled, the core logic 101 causes the terminal state setting circuit 112 to select the floating node NC by the switch control signal 131. When an output operation is performed from the external terminal 106 by a data processing operation according to a program stored in the program memory 102, a state in which an output operation by the tristate output buffer circuit 110 can be performed in the enable signal generation circuit 113 by a switch control signal 130. Let them choose. When performing the input operation, the enable signal generation circuit 113 is made to select the high impedance state of the tristate output buffer circuit 110 by the switch control signal 130. It should be understood that the external interface unit 105, the external terminal 106, and the interface control unit 132 are arranged as many as necessary for the semiconductor device 100, although not specifically illustrated.

不揮発性記憶部140は半導体装置において所定事象の発生が検出されたとき外部端子106の状態を所定の状態に規制するための制御データの記憶と読み出し制御とを行う。以下その構成について詳述する。   The nonvolatile storage unit 140 stores and reads out control data for regulating the state of the external terminal 106 to a predetermined state when occurrence of a predetermined event is detected in the semiconductor device. The configuration will be described in detail below.

不揮発性記憶部140は、電気的に書き換え可能な不揮発性メモリを主体に構成され、不揮発性メモリ領域にはルックアップテーブル141と状態指定コードレジスタ(ICREG)143が格納され、それらに対する消去及び書き込み制御及び記憶情報の読み出し制御を行うためのタイミングコントローラ(TMGCNT)142を備える。   The nonvolatile storage unit 140 is mainly configured by an electrically rewritable nonvolatile memory, and a lookup table 141 and a state designation code register (ICREG) 143 are stored in the nonvolatile memory area, and erasing and writing are performed on them. A timing controller (TMGCNT) 142 for performing control and reading control of stored information is provided.

ルックアップテーブル141は、106に代表される外部端子の状態を指定するための状態指定コードを検索キーとして複数の制御データを格納する。状態指定コードはコアロジック101の内部状態、更には半導体装置100のその他の状態を想定して予め決定しておく。ここで、そのような想定すべき状態とは、コアロジック101によるデータ処理によって引き起こされた割り込みや例外などの状態だけでなく、外部入力端子150を介して外部から入力される特定の信号151によって通知されることによってコアロジック101の内部に発生する状態(例えば外部割込み要求による割り込み発生状態)である。電源検出器(LVD)152による外部電源電圧Vextの不所望なレベル低下の検出信号153で通知されることによってコアロジック101の内部に発生する状態なども考慮する。個々の内部状態毎に前記状態指定コードが割り当てられる。図1では状態1,状態2,…が状態指定コードを意味し、状態指定コード毎に端子1,端子2,…に対応する制御データD11,D12,…が格納される。例えば外部端子106の制御データは状態1のときD11、状態2のときD21となる。ルックアップテーブル141の書き込みは、リセット解除に応答してCPUが外部からダウンロードしてメモリバス103経由で不揮発性メモリ部140に書き込んでも良いし、半導体装置の製造段階で予め書き込んでおき、必要に応じて書き換えるようにしてもよい。   The lookup table 141 stores a plurality of control data using a state designation code for designating the state of an external terminal represented by 106 as a search key. The state designation code is determined in advance assuming the internal state of the core logic 101 and further the other state of the semiconductor device 100. Here, such a state to be assumed is not only a state such as an interrupt or an exception caused by data processing by the core logic 101 but also a specific signal 151 input from the outside via the external input terminal 150. This is a state (for example, an interrupt generation state caused by an external interrupt request) that occurs inside the core logic 101 when notified. The state generated inside the core logic 101 by being notified by the detection signal 153 of the undesired level drop of the external power supply voltage Vext by the power supply detector (LVD) 152 is also considered. The state designation code is assigned to each internal state. In FIG. 1, state 1, state 2,... Mean a state designation code, and control data D11, D12,... Corresponding to terminal 1, terminal 2,. For example, the control data of the external terminal 106 is D11 when in state 1 and D21 when in state 2. The look-up table 141 may be written by the CPU in response to reset release from the outside and written to the nonvolatile memory unit 140 via the memory bus 103, or written in advance at the semiconductor device manufacturing stage. You may make it rewrite according to it.

状態指定コードレジスタ(ICREG)143にはCPUが実行するプログラムに従ってメモリバス103経由で状態指定コードが書き込まれる。例えばイベントドリブン方式でプログラムを実行するような場合を想定すると、イベントに応じた個々のプログラムの実行開始毎に、夫々のプログラム実行で発生が想定される異常に対応するための状態指定コードを状態指定コードレジスタ143に書き込んでおく。コアロジック101はプログラムの実行、外部からの通知、電源電圧低下の通知などによって所定の内部状態の発生を検出すると、この検出信号155がタイミングコントローラ142に与えられる。これに応答してタイミングコントローラ142はそのとき状態指定コードレジスタ143にセットされている状態指定コードに一致する状態の制御データをルックアップテーブル141から検索し、検索した制御データをそれぞれ対応するインタフェース制御部132に与える。これによってインタフェース制御回路132は与えられた制御データにしたがって、トライステート出力バッファ回路110をハイインピーダンスにしてから、端子状態設定回路112によって対応する外部端子106をプルアップ、プルダウン、ハイインピーダンス又は前値保持の状態に設定する。   A status designation code is written in the status designation code register (ICREG) 143 via the memory bus 103 in accordance with a program executed by the CPU. For example, assuming a case where a program is executed in an event-driven manner, each time the execution of each program corresponding to an event starts, a status designation code for dealing with an abnormality that is expected to occur in each program execution Write to the specified code register 143. When the core logic 101 detects the occurrence of a predetermined internal state by executing a program, notification from the outside, notification of power supply voltage drop, etc., the detection signal 155 is given to the timing controller 142. In response to this, the timing controller 142 searches the look-up table 141 for control data in a state matching the state specification code set in the state specification code register 143 at that time, and searches the control data corresponding to the corresponding interface control. To part 132. Thus, the interface control circuit 132 sets the tristate output buffer circuit 110 to high impedance according to the given control data, and then pulls up, pulls down, high impedance, or the previous value of the corresponding external terminal 106 by the terminal state setting circuit 112. Set the hold status.

図2には半導体装置100のデータ処理動作に伴う不揮発性記憶部140の動作タイミングが例示される。   FIG. 2 illustrates the operation timing of the nonvolatile memory unit 140 accompanying the data processing operation of the semiconductor device 100.

ここではコアロジック101のCPUがプログラムA、B、Cの順に実行する場合を想定する。プログラムAを実行するときその先頭でCPUは状態指定コードレジスタ(ICREG)143に状態1に応ずる状態指定コードをメモリバス103経由で書き込む(S1)。ここで、状態1はプログラムAの実行中に発生が想定される所定事象(所定の異常の発生)に対応される状態指定コードである。これに続いてCPUはプログラムAの実行を継続し、例えば割り込み(INT1)が発生することによってCPUは退避動作を行ってプログラムBの実行に遷移する。   Here, it is assumed that the CPU of the core logic 101 executes the programs A, B, and C in this order. When executing the program A, the CPU writes a state designation code corresponding to the state 1 to the state designation code register (ICREG) 143 via the memory bus 103 at the head (S1). Here, the state 1 is a state designation code corresponding to a predetermined event (occurrence of a predetermined abnormality) assumed to occur during the execution of the program A. Following this, the CPU continues to execute the program A. For example, when an interrupt (INT1) is generated, the CPU performs a save operation and transitions to the execution of the program B.

プログラムBを実行するときその先頭でCPUは状態指定コードレジスタ(ICREG)143に状態2に応ずる状態指定コードをメモリバス103経由で転送して書き換える(S2)。ここで、状態2はプログラムBの実行中に発生が想定される所定事象(所定の異常の発生)に対応される状態指定コードである。これに続いてCPUはプログラムBの実行を継続し、実行完了によってもとのプログラムAの実行状態に復帰する。   When executing the program B, the CPU transfers the state designation code corresponding to the state 2 to the state designation code register (ICREG) 143 via the memory bus 103 and rewrites it (S2). Here, state 2 is a state designation code corresponding to a predetermined event (occurrence of a predetermined abnormality) assumed to occur during execution of program B. Following this, the CPU continues to execute the program B, and returns to the original execution state of the program A when the execution is completed.

プログラムAの実行状態に復帰するときCPUは状態指定コードレジスタ(ICREG)143に状態1に応ずる状態指定コードをメモリバス103経由で転送して書き換える(S3)。CPUはプログラムAの実行を完了すると、次のプログラムCの実行に移る。   When returning to the execution state of the program A, the CPU transfers the state designation code corresponding to the state 1 to the state designation code register (ICREG) 143 via the memory bus 103 and rewrites it (S3). When the CPU completes execution of the program A, the CPU proceeds to execution of the next program C.

プログラムCを実行するときその先頭でCPUは状態指定コードレジスタ(ICREG)143に状態3に応ずる状態指定コードをメモリバス103経由で転送して書き換える(S4)。ここで、状態3はプログラムCの実行中に発生が想定される所定事象(所定の異常の発生)に対応される状態指定コードである。これに続いてCPUはプログラムCの実行を継続する。その途上で状態3に応ずる異常が発生すると(S5)、不揮発性記憶部140が状態3に応ずる各端子の制御データを対応するインタフェース制御部132に与え、インタフェース制御部132はその制御データに従って対応する外部端子106の状態をインタフェース回路105経由でプルアップ、プルダウン、ハイインピーダンス又は前値保持の状態に固定する(S6)。   When the program C is executed, the CPU transfers the state designation code corresponding to the state 3 to the state designation code register (ICREG) 143 via the memory bus 103 and rewrites the program C (S4). Here, the state 3 is a state designation code corresponding to a predetermined event (occurrence of a predetermined abnormality) assumed to occur during the execution of the program C. Following this, the CPU continues to execute program C. If an abnormality corresponding to the state 3 occurs on the way (S5), the nonvolatile storage unit 140 gives control data of each terminal corresponding to the state 3 to the corresponding interface control unit 132, and the interface control unit 132 responds according to the control data. The state of the external terminal 106 to be fixed is fixed to a state of pull-up, pull-down, high impedance, or previous value holding via the interface circuit 105 (S6).

図3には半導体装置100を用いたデータ処理システムが例示される。半導体装置(LSI)100にはその外部端子を介して別の半導体装置(IC1、IC2,IC3)500,501,502が接続される。図においてIO0〜IO7のそれぞれは半導体装置100の外部端子と対応するインタフェース回路を意味する。半導体装置(LSI)100は別の半導体装置500,501,502と信号の入出力を行ってそれらを制御する。特に半導体装置(IC2)501はリセットICとされる。   FIG. 3 illustrates a data processing system using the semiconductor device 100. Another semiconductor device (IC1, IC2, IC3) 500, 501, 502 is connected to the semiconductor device (LSI) 100 via its external terminal. In the figure, each of IO0 to IO7 means an interface circuit corresponding to an external terminal of the semiconductor device 100. A semiconductor device (LSI) 100 inputs and outputs signals to and controls other semiconductor devices 500, 501, and 502. In particular, the semiconductor device (IC2) 501 is a reset IC.

図4には図3のデータ処理システムの動作タイミングが例示される。ここでは、所定事象の発生によって状態が固定される外部端子の状態を他の半導体装置が入力してその動作モードを決定する場合を例示する。   FIG. 4 illustrates the operation timing of the data processing system of FIG. Here, a case where another semiconductor device inputs a state of an external terminal whose state is fixed by occurrence of a predetermined event and determines its operation mode is illustrated.

時刻t0でCPUは状態指定コードレジスタ(ICREG)143に状態xに応ずる状態指定コードを書き込んでプログラム、例えば演算量の多いプログラムを実行する。そのプログラムの実行途上において時刻t1でCPUに状態xに応ずるエラーが発生され、CPUの状態が不安定になる。時刻t1までのCPUの安定状態では半導体装置(IC1)500と半導体装置(IC3)502は所定のオペレーションを行い、半導体装置(IC2)501はリセット信号をリセット解除状態で出力しているものとする。時刻1でエラーが発生すると、半導体装置100はIO1、IO2、IO3の外部端子をそれぞれL(ローレベル)、H(ハイレベル)、H(ハイレベル)に固定する。この状態を受ける半導体装置(IC1)500は自己診断モードに遷移する。例えばその診断結果を半導体装置(IC2)501が受け取ることによって時刻t2にリセットを発行し、これによって半導体装置100,500,502のシステムリセットが行われ、時刻t3でシステムリセットが解除されることによってそれ以降、半導体装置100、500、502は所定のオペレーションが可能にされる。尚、図4の例では半導体装置(IC3)502に対してエラー発生による外部端子固定機能は非活性にされているものとした。   At time t0, the CPU writes a state designation code corresponding to the state x in the state designation code register (ICREG) 143 and executes a program, for example, a program with a large amount of calculation. During execution of the program, an error corresponding to the state x is generated in the CPU at time t1, and the state of the CPU becomes unstable. In the stable state of the CPU up to time t1, the semiconductor device (IC1) 500 and the semiconductor device (IC3) 502 perform predetermined operations, and the semiconductor device (IC2) 501 outputs a reset signal in a reset release state. . When an error occurs at time 1, the semiconductor device 100 fixes the external terminals of IO1, IO2, and IO3 to L (low level), H (high level), and H (high level), respectively. The semiconductor device (IC1) 500 that receives this state shifts to the self-diagnosis mode. For example, when the semiconductor device (IC2) 501 receives the diagnosis result, a reset is issued at time t2, whereby the system reset of the semiconductor devices 100, 500, 502 is performed, and the system reset is released at time t3. Thereafter, the semiconductor devices 100, 500 and 502 are allowed to perform predetermined operations. In the example of FIG. 4, it is assumed that the external terminal fixing function due to the occurrence of an error is inactivated for the semiconductor device (IC3) 502.

図5には半導体装置100を用いたデータ処理システムが例示される。基本的な構成は図3と同様であるが、ここでは、所定事象の発生によって状態が固定される外部端子の状態を半導体装置100自らが入力して自らの状態を規定する場合を例示する。ここの趣旨にしたがって半導体装置100の内部には外部端子IO5,IO6については入力バッファ回路111と端子状態設定回路112の一部を図示してある。   FIG. 5 illustrates a data processing system using the semiconductor device 100. The basic configuration is the same as that in FIG. 3, but here, a case where the semiconductor device 100 itself inputs the state of the external terminal whose state is fixed by the occurrence of a predetermined event and defines its state is illustrated. In accordance with this point, the semiconductor device 100 includes a part of the input buffer circuit 111 and the terminal state setting circuit 112 for the external terminals IO5 and IO6.

図6には図5のデータ処理システムの動作タイミングが例示される。ここでは、所定事象の発生によって状態が固定される外部端子IO5,IO6の状態を半導体装置100自らが入力バッファ回路111から入力して自らの状態を規定する場合を例示する。   FIG. 6 illustrates the operation timing of the data processing system of FIG. Here, the case where the semiconductor device 100 itself inputs the state of the external terminals IO5 and IO6 whose state is fixed by the occurrence of a predetermined event from the input buffer circuit 111 and defines its state is illustrated.

時刻t0でCPUは状態指定コードレジスタ(ICREG)143に状態xに応ずる状態指定コードを書き込んでプログラム、例えば演算量の多いプログラムを実行する。そのプログラムの実行途上において時刻t1でCPUに状態xに応ずるエラーが発生され、CPUの状態が不安定になる。時刻t1までのCPUの安定状態では半導体装置(IC1)500と半導体装置(IC3)502は所定のオペレーションを行い、半導体装置(IC2)501はリセット信号をリセット解除状態で出力しているものとする。時刻1でエラーが発生すると、半導体装置100はIO1、IO2、IO3の外部端子をそれぞれL(ローレベル)、H(ハイレベル)、H(ハイレベル)に固定し、且つ、IO5の外部端子をプリアップとし、IO6の外部端子をプルダウンに固定する。この状態を受ける半導体装置(IC1)500は自己診断モードに遷移する。半導体装置(IC3)502はIO5,IO6に対応する外部端子をそれぞれハイインピーダンスにするが、半導体装置(LSI)100は、IO5,IO6に対する外部端子から入力バッファ回路111への入力がフローティングにされることによって不定になるのを自ら抑制しながら内部状態を維持する。この間に半導体装置(IC1)500による診断結果を半導体装置(IC2)501が受け取ることによって時刻t2にリセットを発行し、これによって半導体装置100,500,502のシステムリセットが行われ、時刻t3でシステムリセットが解除されることによってそれ以降、半導体装置100、500、502は所定のオペレーションが可能にされる。   At time t0, the CPU writes a state designation code corresponding to the state x in the state designation code register (ICREG) 143 and executes a program, for example, a program with a large amount of calculation. During execution of the program, an error corresponding to the state x is generated in the CPU at time t1, and the state of the CPU becomes unstable. In the stable state of the CPU up to time t1, the semiconductor device (IC1) 500 and the semiconductor device (IC3) 502 perform predetermined operations, and the semiconductor device (IC2) 501 outputs a reset signal in a reset release state. . When an error occurs at time 1, the semiconductor device 100 fixes the external terminals of IO1, IO2, and IO3 to L (low level), H (high level), and H (high level), respectively, and the external terminal of IO5. Pre-up is performed and the external terminal of IO6 is fixed to pull-down. The semiconductor device (IC1) 500 that receives this state shifts to the self-diagnosis mode. The semiconductor device (IC3) 502 sets the external terminals corresponding to IO5 and IO6 to high impedance, while the semiconductor device (LSI) 100 causes the input from the external terminals corresponding to IO5 and IO6 to the input buffer circuit 111 to be floating. The internal state is maintained while suppressing indefiniteness by itself. During this time, when the semiconductor device (IC2) 501 receives a diagnosis result from the semiconductor device (IC1) 500, a reset is issued at time t2, thereby system resetting of the semiconductor devices 100, 500, 502 is performed, and at time t3, the system is reset. After the reset is released, the semiconductor devices 100, 500, and 502 are allowed to perform predetermined operations thereafter.

実施の形態1によれば以下の作用効果を得る。   According to the first embodiment, the following operational effects are obtained.

(1)ルックアップテーブル141を用意し、コアロジック101によるデータ処理に従って予め状態指定コードを状態指定コードレジスタ143に格納し、異常発生時などには当該状態指定コードを用いてルックアップテーブル141を参照するから、実行するデータ処理状況に合わせて外部端子の状態をプログラマブルに設定することができる。特に、ルックアップテーブル141の検索と検索した制御データの入出力制御回路132への供給を不揮発性記憶部140が自立的に行うから、その処理には所定事象発生時にコアロジック101の健全性を担保しておくことを要しない。したがって、半導体装置100が認識した異常やそのとき当該半導体装置100が実行中のプログラムに応じて、当該半導体装置100の外部端子106に接続された回路500,501,502の状態、更には当該半導体装置100自らの状態を所要の状態に制御することができる。   (1) A lookup table 141 is prepared, and a state designation code is stored in advance in the state designation code register 143 according to data processing by the core logic 101. When an abnormality occurs, the lookup table 141 is stored using the state designation code. Since it refers, the state of the external terminal can be set in a programmable manner in accordance with the data processing status to be executed. In particular, since the non-volatile storage unit 140 autonomously searches the lookup table 141 and supplies the searched control data to the input / output control circuit 132, the processing is performed in accordance with the soundness of the core logic 101 when a predetermined event occurs. There is no need to secure it. Therefore, depending on the abnormality recognized by the semiconductor device 100 and the program currently being executed by the semiconductor device 100, the states of the circuits 500, 501, and 502 connected to the external terminal 106 of the semiconductor device 100, and further the semiconductor The state of the apparatus 100 itself can be controlled to a required state.

(2)実行するプログラムもしくは処理毎にそれに対応する所定事象発生時の状態指定コードを最初に不揮発性の状態指定コードレジスタ143に書き込めばよいから、予め設定された状態指定コードが所定事象の発生時によって失われたり変化されたりする事態の発生を未然に防止することができる。   (2) Since the state designation code corresponding to the occurrence of a predetermined event corresponding to each program to be executed or processing only needs to be first written in the nonvolatile state designation code register 143, a preset state designation code is used to generate a predetermined event. It is possible to prevent the occurrence of a situation that is lost or changed depending on the time.

(3)コアロジック101は実行するプログラム若しくは処理毎にそれに対応する所定事象発生時の状態指定コードを状態指定コードレジスタ143に書き込む操作を負担すればよい。   (3) The core logic 101 only has to bear the operation of writing the state designation code at the time of occurrence of a predetermined event corresponding to each program or process to be executed in the state designation code register 143.

(4)制御データに従ってトライステート出力バッファ110をハイインピーダンスにして前記端子状態設定回路112をプルアップ、プルダウン、オープン又は前値保持の状態とすることにより前記所定の外部端子の状態を決定するから、所定の事象が発生したときトライステート出力バッファ110がどの状態にあっても、制御データが指示する状態に外部入出力端子106を安定化させることが容易になる。   (4) The state of the predetermined external terminal is determined by setting the tristate output buffer 110 to high impedance according to the control data and setting the terminal state setting circuit 112 to a pull-up, pull-down, open, or previous value holding state. When the predetermined event occurs, it becomes easy to stabilize the external input / output terminal 106 to the state indicated by the control data, regardless of the state of the tri-state output buffer 110.

(5)電源検出器152によって検出される電源電圧の所定電圧以下への変化、所定の割り込み要因又は例外要因の発生だけでなく、電源上昇検出、PLL回路のロックはずれ、水晶発振の発振停止検出などの異常の種類に応じて、外部端子の状態をプログラマブルに設定することができる。   (5) Not only the change of the power supply voltage detected by the power supply detector 152 to a predetermined voltage or less, the occurrence of a predetermined interrupt factor or exception factor, but also the power supply rise detection, the PLL circuit is unlocked, and the oscillation stop detection of crystal oscillation The state of the external terminal can be set programmably according to the type of abnormality such as.

(6)不揮発性記憶部にMRAMのような高速に書き換え可能な記憶形式を採用することにより、処理プログラムが変わる毎に状態指定コードを書き換えるために、フラッシュメモリに必要とされるような数100マイクロ秒というような時間を費やすことを要しない。従って、リアルタイム性を要するシステムにも好適である。   (6) By adopting a high-speed rewritable storage format such as MRAM in the non-volatile storage unit, the number 100 required for the flash memory to rewrite the state designation code every time the processing program changes. There is no need to spend time such as microseconds. Therefore, it is also suitable for a system that requires real-time characteristics.

《実施の形態2》
図7には本発明の第2の実施の形態に係る半導体装置が例示される。同図に示される半導体装置200は図1に比べて不揮発性記憶部の構成とその制御手法が相違される。
<< Embodiment 2 >>
FIG. 7 illustrates a semiconductor device according to the second embodiment of the present invention. The semiconductor device 200 shown in the figure is different from that shown in FIG. 1 in the configuration of the nonvolatile memory unit and the control method.

半導体装置200はシステムオンチップのシステムLSI又はマイクロコンピュータのようなプログラム処理機能を備えたデータ処理デバイスとして構成される。半導体装置200のデータ処理部としてのコアロジック(CRLGC)201は、特に制限されないが、命令を実行するCPU(中央処理装置)、CPUで処理可能なデータ処理機能の一部を負担するアクセラレータ、CPU等のワーク領域として利用されるRAM、及びタイマやDMAC(ダイレクトメモリアクセスコントローラ)などのCPUの周辺回路を備える。コアロジック201のCPUはメモリバス103を介して接続されたプログラムメモリ102から命令をフェッチして実行する。   The semiconductor device 200 is configured as a data processing device having a program processing function such as a system-on-chip system LSI or a microcomputer. The core logic (CRLGC) 201 as a data processing unit of the semiconductor device 200 is not particularly limited, but a CPU (central processing unit) that executes instructions, an accelerator that bears a part of data processing functions that can be processed by the CPU, and a CPU RAM used as a work area, and peripheral circuits of a CPU such as a timer and a DMAC (direct memory access controller). The CPU of the core logic 201 fetches and executes an instruction from the program memory 102 connected via the memory bus 103.

図7には代表的に一つの外部インタフェース部(EXIF)105が例示される。外部インタフェース部105には対応する外部端子106が接続される。外部インタフェース部105の構成は図1と同様である。外部インタフェース部105を制御するインタフェース制御部(IFCNT)132についても図1と同様に構成される。インタフェース制御部132に対するスイッチ制御の指示はコアロジック201又は不揮発性記憶部240が与える。コアロジック201は、パワーオンリセット若しくはシステムリセットが解除されると、スイッチ制御信号131によって端子状態設定回路112にはフローティングノードNCを選択させる。プログラムメモリ102に格納されているプログラムにしたがったデータ処理動作によって外部端子106から出力動作を行うときはスイッチ制御信号130によりイネーブル信号生成回路113にトライステート出力バッファ回路110による出力動作可能な状態を選択させる。入力動作を行うときはスイッチ制御信号130によりイネーブル信号生成回路113にトライステート出力バッファ回路110のハイインピーダンス状態を選択させる。尚、外部インタフェース部105、外部端子106及びインタフェース制御部132は、特に図示はしないが、半導体装置100に必要な分だけ多数配置されているものと理解されたい。   FIG. 7 typically illustrates one external interface unit (EXIF) 105. A corresponding external terminal 106 is connected to the external interface unit 105. The configuration of the external interface unit 105 is the same as that shown in FIG. The interface control unit (IFCNT) 132 that controls the external interface unit 105 is also configured in the same manner as in FIG. The switch logic instruction to the interface control unit 132 is given by the core logic 201 or the nonvolatile storage unit 240. When the power-on reset or the system reset is canceled, the core logic 201 causes the terminal state setting circuit 112 to select the floating node NC by the switch control signal 131. When an output operation is performed from the external terminal 106 by a data processing operation according to a program stored in the program memory 102, a state in which an output operation by the tristate output buffer circuit 110 can be performed in the enable signal generation circuit 113 by a switch control signal 130. Let them choose. When performing the input operation, the enable signal generation circuit 113 is made to select the high impedance state of the tristate output buffer circuit 110 by the switch control signal 130. It should be understood that the external interface unit 105, the external terminal 106, and the interface control unit 132 are arranged as many as necessary for the semiconductor device 100, although not specifically illustrated.

不揮発性記憶部240は半導体装置において所定事象の発生が検出されたとき外部端子106の状態を所定の状態に規制するための制御データの記憶と読み出し制御とを行う。以下その構成について詳述する。   The nonvolatile storage unit 240 stores and reads out control data for restricting the state of the external terminal 106 to a predetermined state when occurrence of a predetermined event is detected in the semiconductor device. The configuration will be described in detail below.

不揮発性記憶部240は、電気的に書き換え可能な不揮発性メモリを主体に構成され、不揮発性メモリ領域には第1ルックアップテーブ244、第2ルックアップテーブル241、実行アドレスレジスタ(EAREG)243が格納され、それらに対する消去及び書き込み制御及び記憶情報の読み出し制御を行うためのタイミングコントローラ(TMGCNT)242を備える。   The nonvolatile storage unit 240 is mainly configured by an electrically rewritable nonvolatile memory. The nonvolatile memory area includes a first lookup table 244, a second lookup table 241, and an execution address register (EAREG) 243. A timing controller (TMGCNT) 242 for storing, erasing and writing control for them, and reading control of stored information is provided.

第1ルックアップテーブル244は、データ処理部としてのコアロジック201が実行するプログラムアドレス範囲毎に、その範囲のプログラムの実行中に想定される所定事象の発生要因に外部端子の状態指定コードを対応付けたテーブルである。プログラムの実行中に想定される所定事象とは、コアロジック201の内部状態、更には半導体装置200のその他の状態を想定して決定される。ここで、そのような想定すべき状態とは、コアロジック201によるデータ処理によって引き起こされた割り込みや例外などの状態だけでなく、外部入力端子150を介して外部から入力される特定の信号151によって通知されることによってコアロジック201の内部に発生する状態(例えば外部割込み要求による割り込み発生状態)である。また、電源検出器(LVD)152による外部電源電圧Vextの不所望なレベル低下の検出信号153で通知されることによってコアロジック201の内部に発生する状態なども考慮する。ここでは、所定事象の発生要因として、割り込みや例外などの要因を想定する。実行するプログラムアドレス範囲は例えば開始アドレスと終了アドレスによって、或いは開始アドレスとプログラムサイズなどによって特定することができる。図7において第1ルックアップテーブル244は、プログラムの開始アドレス(SA)と終了アドレス(E)で特定されるプログラム毎にその実行途上で発生することが想定される割り込みや例外などの異常要因に対応する内部状態に則して状態指定コードを保持する。図では状態指定コードを状態1、状態8、状態3のように例示してある。   For each program address range executed by the core logic 201 as the data processing unit, the first look-up table 244 corresponds to an external terminal state designation code corresponding to a predetermined event occurrence factor assumed during execution of a program in the range. It is a table attached. The predetermined event assumed during the execution of the program is determined by assuming the internal state of the core logic 201 and further the other state of the semiconductor device 200. Here, such a state to be assumed is not only a state such as an interrupt or an exception caused by data processing by the core logic 201 but also a specific signal 151 input from the outside via the external input terminal 150. This is a state that occurs inside the core logic 201 by being notified (for example, an interrupt generation state due to an external interrupt request). In addition, a state generated in the core logic 201 by being notified by an undesired level decrease detection signal 153 of the external power supply voltage Vext by the power supply detector (LVD) 152 is also considered. Here, factors such as interrupts and exceptions are assumed as the occurrence factors of the predetermined event. The program address range to be executed can be specified by, for example, a start address and an end address, or by a start address and a program size. In FIG. 7, the first look-up table 244 shows abnormal factors such as interrupts and exceptions that are expected to occur during the execution of each program specified by the start address (SA) and end address (E) of the program. Holds the state specification code according to the corresponding internal state. In the figure, state designation codes are illustrated as state 1, state 8, and state 3.

第2ルックアップテーブル241はルックアップテーブル141と同様に構成され、外部端子の状態を指定するための状態指定コードを検索キーとして複数の制御データを格納する。図では状態1,状態2,…が状態指定コードを意味し、状態指定コード毎に端子1,端子2,…に対応する制御データD11,D12,…が格納される。例えば外部端子106の制御データは状態1のときD11、状態2のときD21となる。   The second lookup table 241 is configured in the same manner as the lookup table 141, and stores a plurality of control data using a state designation code for designating the state of the external terminal as a search key. In the figure, state 1, state 2,... Mean a state designation code, and control data D11, D12,... Corresponding to terminal 1, terminal 2,. For example, the control data of the external terminal 106 is D11 when in state 1 and D21 when in state 2.

ルックアップテーブル241、244の書き込みは、リセット解除に応答してCPUが外部からダウンロードしてメモリバス103経由で不揮発性メモリ部240に書き込んでも良いし、半導体装置の製造段階で予め書き込んでおき、必要に応じて書き換えるようにしてもよい。   The look-up tables 241 and 244 may be written by the CPU in response to reset release from the outside and written to the nonvolatile memory unit 240 via the memory bus 103, or written in advance during the manufacturing stage of the semiconductor device. You may make it rewrite as needed.

実行アドレスレジスタ(EAREG)243はコアロジック201のCPUによる現在の実行命令アドレスを捕捉するための命令アドレス情報を逐次保持する不揮発性のレジスタである。例えば、実行アドレスレジスタ243にはCPUが実行する命令のアドレス、例えばCPUのプログラムカウンタの値が専用信号線257から実行アドレスレジスタ243に直接与えられて書き込まれる。メモリバス103経由で書き込むようにすることも可能である。したがって、CPUの命令実行サイクルに対して実行アドレスレジスタ243への実行アドレスの書き込みは高速に行うことが必要になるから、不揮発性メモリ部240はフラッシュメモリよりもMRAMのように書き込みアクセス速度の速いメモリを用いることが得策である。また、実行アドレスレジスタ243に格納する実行アドレスは、プログラムの境界アドレスを特定できる上位側のアドレス情報に限定することも可能である。   The execution address register (EAREG) 243 is a non-volatile register that sequentially holds instruction address information for capturing the current execution instruction address by the CPU of the core logic 201. For example, the address of an instruction executed by the CPU, for example, the value of the program counter of the CPU is directly given to the execution address register 243 from the dedicated signal line 257 and written in the execution address register 243. It is also possible to write via the memory bus 103. Therefore, since it is necessary to write the execution address to the execution address register 243 at a high speed with respect to the instruction execution cycle of the CPU, the nonvolatile memory unit 240 has a higher write access speed like the MRAM than the flash memory. It is a good idea to use memory. The execution address stored in the execution address register 243 can be limited to upper address information that can identify the boundary address of the program.

コアロジック201はプログラムの実行、外部からの通知、電源電圧低下の通知などによって所定の内部状態の発生を検出すると、その検出信号255とその内部状態の発生要因256とをタイミングコントローラ242に与える。これに応答してタイミングコントローラ242は、そのとき実行アドレスレジスタ243にセットされている命令アドレスを含むプログラムアドレス範囲の状態エントリを第1ルックアップテーブル244から参照し、当該状態エントリの中から、そのときの異常発生要因に応ずる状態指定コードを抽出する。更にタイミングコントローラ242は抽出した状態指定コードに一致する状態の制御データを第2ルックアップテーブル241から検索し、検索した制御データをそれぞれ対応するインタフェース制御部132に与える。これによってインタフェース制御回路132は与えられた制御データにしたがって、トライステート出力バッファ回路110をハイインピーダンスにしてから、端子状態設定回路112によって対応する外部端子106をプルアップ、プルダウン、ハイインピーダンス又は前値保持の状態に設定する。   When the core logic 201 detects the occurrence of a predetermined internal state by executing a program, notification from the outside, notification of power supply voltage drop, etc., the core logic 201 gives the detection signal 255 and the cause of occurrence of the internal state 256 to the timing controller 242. In response to this, the timing controller 242 refers to the state entry in the program address range including the instruction address set in the execution address register 243 at that time from the first lookup table 244, and from among the state entries, Extract the status specification code corresponding to the cause of the error. Further, the timing controller 242 searches the second look-up table 241 for control data in a state that matches the extracted state designation code, and provides the searched control data to the corresponding interface control unit 132. Thus, the interface control circuit 132 sets the tristate output buffer circuit 110 to high impedance according to the given control data, and then pulls up, pulls down, high impedance, or the previous value of the corresponding external terminal 106 by the terminal state setting circuit 112. Set the hold status.

図8には半導体装置200のデータ処理動作に伴う不揮発性記憶部140を用いた動作タイミングが例示される。   FIG. 8 illustrates an operation timing using the nonvolatile storage unit 140 accompanying the data processing operation of the semiconductor device 200.

ここではコアロジック201のCPUがプログラムA、プログラムB、Cの順に実行する場合を想定する。不揮発性メモリ部240の実行アドレスレジスタ243はCPUが現在実行する命令のアドレスを逐次受け取って保持する。従って実施の形態1で説明したようにプログラムの先頭でCPUが状態指定コードレジスタ143に対応する状態指定コードを書き込む処理は必要とされない。プログラムCの実行途上で異常、例えば電源異常が発生すると、それに応ずる割り込み要因と異常発生がタイミングコントローラ242に通知されることにより、そのとき実行アドレスレジスタ243が保有するアドレス情報によって第1ルックアップテーブル244が参照されて状態指定コードが取得され、これによって第2ルックアップテーブル241からインタフェース制御部132に制御データが供給される。これによってインタフェース制御部132はその制御データに従って対応する外部端子106の状態をインタフェース回路105経由でプルアップ、プルダウン、ハイインピーダンス又は前値保持の状態に固定する。   Here, it is assumed that the CPU of the core logic 201 executes the programs A, B, and C in this order. The execution address register 243 of the nonvolatile memory unit 240 sequentially receives and holds the address of the instruction currently executed by the CPU. Therefore, as described in the first embodiment, the CPU does not need to write the status designation code corresponding to the status designation code register 143 at the beginning of the program. When an abnormality occurs during the execution of the program C, for example, a power supply abnormality, the interrupt factor corresponding to the abnormality and the occurrence of the abnormality are notified to the timing controller 242, so that the first lookup table is determined by the address information held by the execution address register 243 at that time. The state designation code is acquired by referring to 244, and thereby, control data is supplied from the second lookup table 241 to the interface control unit 132. As a result, the interface control unit 132 fixes the state of the corresponding external terminal 106 to a state of pull-up, pull-down, high impedance, or previous value holding via the interface circuit 105 according to the control data.

図9には半導体装置200を用いたデータ処理システムが例示される。半導体装置200はマスタマイコンとされ、その外部端子を介して別の半導体装置として、リセットIC600、通信先マイコン601、センサ602、センサ603、周辺IC604、サブマイコン605、及び電源IC606が接続される。   FIG. 9 illustrates a data processing system using the semiconductor device 200. The semiconductor device 200 is a master microcomputer, and a reset IC 600, a communication destination microcomputer 601, a sensor 602, a sensor 603, a peripheral IC 604, a sub-microcomputer 605, and a power supply IC 606 are connected as other semiconductor devices through its external terminals.

例えばこのデータデータ処理システムでマスタマイコンが暴走したとき、これに接続されている回路に対して、動作中のプログラムや動作状態に応じてマスタマイコン200の外部端子の状態をプログラマブルに固定する場合を一例にその動作を説明する。例えば、ある動作状態においてマスタマイコン200が暴走したとき、リセットIC600に対してリセット発行フラグを供給し(I1)、電源IC606には自己診断及び電源復帰命令を発行し(I2)、周辺IC604には現状保持を指示する(I3)、場合について想定する。このとき第1ルックアップテーブル244は図10の記憶情報を有し、第2ルックアップテーブル241は図11の記憶情報を有する。図10においてA2〜A3のアドレス範囲においてリセット例外を異常発生の要因とするとき状態指定コードには状態2が設定されている。図11では状態2における外部端子PA0〜Pxxの制御データには、Hiz,Pull−up,Pull−Down,…,Pull−Downが設定されている。外部端子PA1はリセット発行フラグの出力端子、外部端子PA2は自己診断及び電源復帰命令の出力端子、Pxxは周辺IC604に対する現状保持の指示端子に割りあてられる。マスタマイコン200がA2〜A3のアドレス範囲のプログラムを実行しているとき、リセット例外が発生すると、図10の第1ルックアップテーブル244と図11の第2ルックアップテーブル241の記憶情報に従ってたとえばリセットIC600に対してリセット発行フラグを供給し(I1)、電源IC606には自己診断及び電源復帰命令を発行(I2)する。これにより、周辺IC604には現状保持を指示する(I3)ために必要な外部端子PA1,PA2,PAxxの状態が生成される。   For example, when the master microcomputer runs out of control in this data data processing system, the state of the external terminals of the master microcomputer 200 is fixed programmably to the circuit connected thereto depending on the program being operated and the operating state. The operation will be described as an example. For example, when the master microcomputer 200 goes out of control in a certain operating state, a reset issue flag is supplied to the reset IC 600 (I1), a self-diagnosis and power return command is issued to the power supply IC 606 (I2), and the peripheral IC 604 is given. A case is assumed where the current status is instructed (I3). At this time, the first lookup table 244 has the storage information of FIG. 10, and the second lookup table 241 has the storage information of FIG. In FIG. 10, state 2 is set in the state designation code when a reset exception is caused as an abnormality in the address range A2 to A3. In FIG. 11, Hiz, Pull-up, Pull-Down,..., Pull-Down are set in the control data of the external terminals PA0 to Pxx in the state 2. The external terminal PA1 is assigned as an output terminal for a reset issuance flag, the external terminal PA2 is assigned as an output terminal for a self-diagnosis and power recovery instruction, and Pxx is assigned as an instruction terminal for maintaining the current status for the peripheral IC 604. When the master microcomputer 200 is executing a program in the address range of A2 to A3, if a reset exception occurs, for example, reset is performed according to the stored information in the first lookup table 244 in FIG. 10 and the second lookup table 241 in FIG. A reset issuance flag is supplied to the IC 600 (I1), and a self-diagnosis and power restoration command is issued to the power supply IC 606 (I2). As a result, the states of the external terminals PA1, PA2, and PAxx necessary for instructing the peripheral IC 604 to maintain the current state (I3) are generated.

実施の形態2によれば以下の作用効果を得る。   According to the second embodiment, the following operational effects are obtained.

第1及び第2ルックアップテーブル244,241を予め不揮発性メモリ部240に用意し、データ処理の進行とともに実行アドレスレジスタ240の情報を実行アドレスのアドレス情報に書き換えてゆき、異常発生時などにはその実行アドレス情報に基づいて第1及び第2ルックアップテーブル244,241を参照するから、実行するデータ処理状況に合わせて外部端子106の状態をプログラムブルに設定することができる。特にプログラムアドレスに基づいて制御データを指定することができ、更に2個のルックアップテーブル244,241を用いて制御データの参照を行うから、外部端子に対して更に柔軟に状態設定を行うことができる。特に、第1及び第2ルックアップテーブル244,241を用いた制御データの検索と検索した制御データの入出力制御回路132への供給を不揮発性記憶部240が自立的に行うから、実施の形態1と同様に、その処理には所定事象発生時にデータ処理部の健全性を担保しておくことを要しない。したがって、半導体装置200が認識した異常やそのとき当該半導体装置100が実行中のプログラムに応じて、当該半導体装置100の外部端子106に接続された周辺回路600〜606の状態、更には当該半導体装置100自らの状態を所要の状態に制御することができる。   First and second look-up tables 244 and 241 are prepared in the nonvolatile memory unit 240 in advance, and the information in the execution address register 240 is rewritten to the address information of the execution address as data processing progresses. Since the first and second lookup tables 244 and 241 are referred to based on the execution address information, the state of the external terminal 106 can be set to be programmable according to the data processing status to be executed. In particular, the control data can be specified based on the program address, and the control data is referred to using the two look-up tables 244 and 241. Therefore, it is possible to more flexibly set the state of the external terminal. it can. In particular, since the nonvolatile storage unit 240 autonomously performs the search of the control data using the first and second look-up tables 244 and 241 and the supply of the searched control data to the input / output control circuit 132. Similar to 1, the process does not require ensuring the soundness of the data processing unit when a predetermined event occurs. Therefore, depending on the abnormality recognized by the semiconductor device 200 and the program being executed by the semiconductor device 100 at that time, the state of the peripheral circuits 600 to 606 connected to the external terminal 106 of the semiconductor device 100 and further the semiconductor device 100 It is possible to control its own state to a required state.

その他、実施の形態1と同様の作用効果を奏する。   In addition, the same effects as those of the first embodiment are obtained.

《実施の形態3》
図12には本発明の第3の実施の形態に係る半導体装置300が例示される。実施の形態1との相違点は、所定事象が発生したとき状態指定コードレジスタ143のアドレス情報を用いたルックアップテーブル141の参照主体がコアロジック101Aであるという点である。そのような参照を不揮発性記憶部140Aが自立的におこなうことを要しないから実施の形態1における所定事象の検出信号155を不揮発性メモリ部140Aに与える必要はない。不揮発性記憶部140Aの内部タイミング制御はタイミングコントローラ142Aが行う。例えば、割り込みや例外などの所定の事象が発生したとき、コアロジック101Aはメモリバス103を介して状態指定コードレジスタ143のアドレス情報をリードし、リードしたアドレス情報を用いてルックアップテーブル141から対応する制御データを読み出し制御する。図においてリードデータはルックアップテーブル141から直接インタフェース制御部132に供給されているが、これに限定されず、コアロジックが制御データを読み込んで、インタフェース制御部132に供給してもよい。その他の構成は実施の形態1と同様であるからその詳細な説明は省略する。
<< Embodiment 3 >>
FIG. 12 illustrates a semiconductor device 300 according to the third embodiment of the invention. The difference from the first embodiment is that, when a predetermined event occurs, the reference subject of the lookup table 141 using the address information of the state designation code register 143 is the core logic 101A. Since it is not necessary for the nonvolatile storage unit 140A to make such a reference autonomously, it is not necessary to provide the nonvolatile memory unit 140A with the predetermined event detection signal 155 in the first embodiment. The internal timing control of the nonvolatile storage unit 140A is performed by the timing controller 142A. For example, when a predetermined event such as an interrupt or an exception occurs, the core logic 101A reads the address information of the state designation code register 143 via the memory bus 103, and responds from the lookup table 141 using the read address information. Control data to be read out. In the figure, the read data is directly supplied from the lookup table 141 to the interface control unit 132. However, the present invention is not limited to this, and the core logic may read the control data and supply it to the interface control unit 132. Since other configurations are the same as those of the first embodiment, detailed description thereof is omitted.

半導体装置300は状態指定コードによるルックアップテーブル141の検索をコアロジック101Aで行うから、不揮発性記憶部140Aは状態指定コードによるルックアップテーブル141の検索機能を備えることを要せず、コアロジック101Aを流用してソフトウェア処理で対処する事ができる。よって、所定事象発生時でもコアロジック101Aの健全性が担保されていることが前提となり、所定事象発生によってコアロジック101Aのデータ処理が完全に不能になるような事象の発生には対応することができない。その他の点ついては実施の形態1と同様の作用効果を奏する。   Since the semiconductor device 300 uses the core logic 101A to search the lookup table 141 based on the state designation code, the nonvolatile storage unit 140A does not need to have a lookup function for the lookup table 141 based on the state designation code. Can be handled by software processing. Therefore, it is assumed that the soundness of the core logic 101A is ensured even when a predetermined event occurs, and it is possible to cope with the occurrence of an event in which the data processing of the core logic 101A is completely disabled by the occurrence of the predetermined event. Can not. About the other point, there exists an effect similar to Embodiment 1. FIG.

《実施の形態4》
図13には本発明の第4の実施の形態に係る半導体装置400が例示される。実施の形態2との相違点は、所定事象が発生したとき実行アドレスレジスタ243のアドレス情報を用いたルックアップテーブル244,241の参照主体がコアロジック201Aであるという点である。そのような参照を不揮発性記憶部240Aが自立的におこなうことを要しないから実施の形態2における所定事象の検出信号255及びその発生要因256を不揮発性記憶部240Aに与える必要はない。不揮発性記憶部240Aの内部タイミング制御はタイミングコントローラ242Aが行う。例えば、割り込みや例外などの所定の事象が発生したとき、コアロジック201Aはメモリバス103を介して実行アドレスレジスタ243のアドレス情報をリードし、リードしたアドレス情報を用いて第1ルックアップテーブル244から対応する状態指定コードをリードし、更にリードした状態指定コードを用いて第2ルックアップテーブル241から制御データを読み出し制御する。図においてリードされた制御データは第2ルックアップテーブル241から直接インタフェース制御部132に供給されているが、これに限定されず、コアロジック201Aが制御データを読み込んで、インタフェース制御部132に供給してもよい。その他の構成は実施の形態1と同様であるからその詳細な説明は省略する。
<< Embodiment 4 >>
FIG. 13 illustrates a semiconductor device 400 according to the fourth embodiment of the present invention. The difference from the second embodiment is that the core logic 201A is the reference entity of the lookup tables 244 and 241 using the address information of the execution address register 243 when a predetermined event occurs. Since it is not necessary for the nonvolatile storage unit 240A to make such a reference autonomously, it is not necessary to provide the nonvolatile storage unit 240A with the predetermined event detection signal 255 and its generation factor 256 in the second embodiment. The timing controller 242A performs internal timing control of the nonvolatile storage unit 240A. For example, when a predetermined event such as an interrupt or an exception occurs, the core logic 201A reads the address information of the execution address register 243 via the memory bus 103, and uses the read address information from the first lookup table 244. The corresponding state designation code is read, and the control data is read from the second lookup table 241 and controlled using the read state designation code. In the figure, the read control data is directly supplied from the second lookup table 241 to the interface control unit 132. However, the present invention is not limited to this, and the core logic 201A reads the control data and supplies it to the interface control unit 132. May be. Since other configurations are the same as those of the first embodiment, detailed description thereof is omitted.

半導体装置400は実施の形態2の半導体装置200に比べて命令アドレスに基づく第1及び第2ルックアップテーブル244,241の検索をコアロジック201Aで行うから、不揮発性記憶部240Aは命令アドレスによる第1ルックアップテーブル244の検索機能及び状態指定コードによる第2ルックアップテーブル241の検索機能を備えることを要せず、コアロジック201Aを流用してソフトウェア処理で対処する事ができる。よって、所定事象発生時でもコアロジック201Aの健全性が担保されていることが前提となり、所定事象発生によってコアロジック201Aのデータ処理が完全に不能になるような事象の発生には対応することができない。その他の点ついては実施の形態2と同様の作用効果を奏する。   Compared to the semiconductor device 200 of the second embodiment, the semiconductor device 400 searches the first and second lookup tables 244 and 241 based on the instruction address by the core logic 201A. It is not necessary to provide the search function of the first lookup table 244 and the search function of the second lookup table 241 based on the state designation code, and the core logic 201A can be used to cope with the software process. Therefore, it is assumed that the soundness of the core logic 201A is ensured even when a predetermined event occurs, and it is possible to cope with the occurrence of an event in which the data processing of the core logic 201A is completely disabled by the occurrence of the predetermined event. Can not. About the other point, there exists an effect similar to Embodiment 2. FIG.

以上本発明者によってなされた発明を実施形態に基づいて具体的に説明したが、本発明はそれに限定されるものではなく、その要旨を逸脱しない範囲において種々変更可能であることは言うまでもない。   Although the invention made by the present inventor has been specifically described based on the embodiments, it is needless to say that the present invention is not limited thereto and can be variously modified without departing from the gist thereof.

例えば、外部端子の状態を設定するトリガとなる所定事象の発生は、上述した電源低下検出、電源上昇検出、PLLのロックはずれ、水晶発振の発振停止検出などに限定されず適宜変更可能である。   For example, the occurrence of a predetermined event serving as a trigger for setting the state of the external terminal is not limited to the above-described power-down detection, power-up detection, PLL lock-off, crystal oscillation stop detection, etc., and can be changed as appropriate.

外部端子の状態を設定する設定態様はレベル固定に限定されず、一定の周波数でH→L→H→…のように周期的に若しくは所定の信号波形を形成するように外部端子の電圧レベルを変更するようにしてもよい。   The setting mode for setting the state of the external terminal is not limited to the fixed level, but the voltage level of the external terminal is set so as to form a predetermined signal waveform periodically, such as H → L → H →... It may be changed.

不揮発性メモリ部はCMOSプロセスで形成されるオンチップSRAMと同程度のアクセス速度を実現することができるMRAMに限定されず、電気的に書き換え可能な不揮発性メモリであるフラッシュメモリ又はEEPROMなどを主体として構成することも可能である。   The nonvolatile memory portion is not limited to an MRAM that can achieve an access speed comparable to that of an on-chip SRAM formed by a CMOS process, but is mainly an electrically rewritable nonvolatile memory such as flash memory or EEPROM. It is also possible to configure as.

実施の形態2,4において実行アドレスレジスタ243に書き込まれる実行命令のアドレス情報は直接コアロジックから当該レジスタ243に供給される場合に限定されず、タイミングコントローラ242を経由して行ってもよい。   In the second and fourth embodiments, the address information of the execution instruction written in the execution address register 243 is not limited to the case where the address information is directly supplied from the core logic to the register 243, and may be performed via the timing controller 242.

100 半導体装置
Vext 外部電源電圧
Vss グランド電圧
101 コアロジック(CRLGC)
103 メモリバス
102 プログラムメモリ
105 外部インタフェース部(EXIF)
106 外部端子
110 トライステート出力バッファ回路
111 入力バッファ回路
113 イネーブル信号生成回路
122 出力イネーブル信号
122をハイレベルに、出力動作不可能にするとき選択スイッチ121を介して出力イネーブル信号122をローレベルにする。
100 Semiconductor device Vext External power supply voltage Vss Ground voltage 101 Core logic (CRLGC)
103 Memory Bus 102 Program Memory 105 External Interface Unit (EXIF)
106 External terminal 110 Tri-state output buffer circuit 111 Input buffer circuit 113 Enable signal generation circuit 122 Output enable signal 122 is set to high level, and when output operation is disabled, output enable signal 122 is set to low level via selection switch 121 .

132 インタフェース制御部(IFCNT)
130,131 スイッチ制御信号
140 不揮発性記憶部
102 プログラムメモリ
141 ルックアップテーブル
143 状態指定コードレジスタ(ICREG)
142 タイミングコントローラ(TMGCNT)
155 検出信号
200 半導体装置
201 コアロジック(CRLGC)
240 不揮発性記憶部
244 第1ルックアップテーブ
241 第2ルックアップテーブル
243 実行アドレスレジスタ(EAREG)
242 タイミングコントローラ(TMGCNT)
255 検出信号
256 内部状態の発生要因
300 半導体装置
101A コアロジック
140A 不揮発性記憶部
142A タイミングコントローラ
400 半導体装置
201A コアロジック
240A 不揮発性記憶部
242A タイミングコントローラ
132 Interface control unit (IFCNT)
130, 131 Switch control signal 140 Non-volatile storage unit 102 Program memory 141 Look-up table 143 State designation code register (ICREG)
142 Timing Controller (TMGCNT)
155 Detection signal 200 Semiconductor device 201 Core logic (CRLGC)
240 Non-volatile storage unit 244 First lookup table 241 Second lookup table 243 Execution address register (EAREG)
242 Timing controller (TMGCNT)
255 Detection Signal 256 Internal State Occurrence Factor 300 Semiconductor Device 101A Core Logic 140A Nonvolatile Storage Unit 142A Timing Controller 400 Semiconductor Device 201A Core Logic 240A Nonvolatile Storage Unit 242A Timing Controller

Claims (24)

複数個の外部端子と、
前記外部端子に接続されたインタフェース部と、
前記インタフェース部を制御するインタフェース制御部と、
前記インタフェース制御部から入力した入力信号の処理、前記インタフェース部から出力する出力信号の生成、及びその他のデータ処理を行うデータ処理部と、
前記データ処理部に接続された不揮発性記憶部と、を有し、
前記インタフェース部は、所定の前記外部端子に出力端子が接続されたトライステート出力バッファ回路と、所定の前記外部端子に入力端子が接続された入力バッファ回路と、所定の前記外部端子に接続され当該外部端子を選択的にプルアップ、プルダウン、オープン又は前値保持の状態に設定する端子状態設定回路とを有し、
前記不揮発性記憶部は、前記外部端子の状態を指定するための状態指定コードを検索キーとする制御データのルックアップテーブルを格納する領域を有し、前記データ処理部によるデータ処理に従って予め前記状態指定コードが格納され、前記データ処理部から所定事象の発生が通知されたとき予め格納されている前記状態指定コードを用いて前記ルックアップテーブルから制御データを読み出し、
前記インタフェース制御部は前記読み出された前記制御データに従って前記トライステート出力バッファ回路及び前記端子状態設定回路を制御して前記所定の外部端子の状態を決定する、半導体装置。
A plurality of external terminals;
An interface unit connected to the external terminal;
An interface control unit for controlling the interface unit;
A data processing unit that performs processing of an input signal input from the interface control unit, generation of an output signal output from the interface unit, and other data processing;
A non-volatile storage unit connected to the data processing unit,
The interface unit includes a tristate output buffer circuit having an output terminal connected to the predetermined external terminal, an input buffer circuit having an input terminal connected to the predetermined external terminal, and a predetermined external terminal connected to the interface unit. A terminal state setting circuit for selectively setting an external terminal to a pull-up, pull-down, open, or previous value holding state;
The non-volatile storage unit has an area for storing a control data look-up table using a state designation code for designating the state of the external terminal as a search key, and the state is stored in advance according to data processing by the data processing unit. When the designation code is stored and the occurrence of a predetermined event is notified from the data processing unit, the control data is read from the lookup table using the state designation code stored in advance,
The interface control unit controls the tristate output buffer circuit and the terminal state setting circuit according to the read control data to determine the state of the predetermined external terminal.
前記不揮発性記憶部は、前記データ処理部によって前記状態指定コードを書き込み可能な不揮発性の状態指定コードレジスタを有し、前記データ処理部から所定事象の発生が通知されたとき前記状態指定コードレジスタの状態指定コードを用いて前記ルックアップテーブルから検索した前記制御データを前記インタフェース部に出力する、請求項1記載の半導体装置。   The nonvolatile storage unit has a nonvolatile state designation code register in which the state designation code can be written by the data processing unit, and when the occurrence of a predetermined event is notified from the data processing unit, the state designation code register The semiconductor device according to claim 1, wherein the control data retrieved from the lookup table using the state designation code is output to the interface unit. 前記データ処理部はデータ処理の一環として、当該データ処理の先頭で所要の状態指定コードを予め前記状態指定コードレジスタに書き込む、請求項2記載の半導体装置。   3. The semiconductor device according to claim 2, wherein the data processing unit writes a required state designation code in the state designation code register in advance at the beginning of the data processing as part of the data processing. 前記インタフェース制御部は、前記制御データに従って前記トライステート出力バッファをハイインピーダンスにして前記端子状態設定回路をプルアップ、プルダウン、オープン又は前値保持の状態とすることにより前記所定の外部端子の状態を決定する、請求項3記載の半導体装置。   The interface control unit sets the state of the predetermined external terminal by setting the terminal state setting circuit in a state of pulling up, pulling down, opening, or holding a previous value by setting the tristate output buffer to high impedance according to the control data. The semiconductor device according to claim 3, which is determined. 前記所定の事象は電源検出器によって検出される電源電圧の所定電圧以下への変化であり、
前記不揮発性記憶部は、前記データ処理部から前記電源電圧の所定電圧以下への変化が通知されたとき、前記状態指定コードレジスタが保有する状態指定コードを用いてルックアップテーブルから検索した前記制御データを前記インタフェース部に出力する、請求項3記載の半導体装置。
The predetermined event is a change of the power supply voltage detected by the power supply detector to a predetermined voltage or lower,
The non-volatile storage unit, when notified from the data processing unit that the power supply voltage is changed to a predetermined voltage or less, uses the state designation code stored in the state designation code register to retrieve the control The semiconductor device according to claim 3, wherein data is output to the interface unit.
前記所定の事象は所定の割り込み要因又は例外要因であり、
前記不揮発性記憶部は、前記データ処理部から前記所定の割り込み要因又は例外要因の発生が通知されたとき、前記状態指定コードレジスタが保有する状態指定コードを用いてルックアップテーブルから検索した前記制御データを前記インタフェース部に出力する、請求項3記載の半導体装置。
The predetermined event is a predetermined interrupt factor or exception factor,
The non-volatile storage unit, when notified of occurrence of the predetermined interrupt factor or exception factor from the data processing unit, the control retrieved from a lookup table using a state designation code held by the state designation code register The semiconductor device according to claim 3, wherein data is output to the interface unit.
複数個の外部端子と、
前記外部端子に接続されたインタフェース部と、
前記インタフェース部を制御するインタフェース制御部と、
前記インタフェース制御部から入力した入力信号の処理、前記インタフェース部から出力する出力信号の生成、命令を実行するプログラム処理及びその他のデータ処理を行うデータ処理部と、
前記データ処理部に接続された不揮発性記憶部と、を有し、
前記インタフェース部は、所定の前記外部端子に出力端子が接続されたトライステート出力バッファ回路と、所定の前記外部端子に入力端子が接続された入力バッファ回路と、所定の前記外部端子に接続され当該外部端子を選択的にプルアップ、プルダウン、オープン又は前値保持の状態に設定する端子状態設定回路とを有し、
前記不揮発性記憶部は、前記データ処理部による現在の実行命令アドレスを捕捉するための命令アドレス情報を逐次保持する不揮発性の実行アドレスレジスタと、前記データ処理部が実行するプログラムアドレス範囲毎に、その範囲のプログラムの実行中に想定される所定事象の発生要因に外部端子の状態指定コードを対応付けた第1ルックアップテーブルと、前記状態指定コードを検索キーとする制御データの第2ルックアップテーブルと、を格納する領域を有し、前記データ処理部から所定事象の発生が通知されたとき前記実行アドレスレジスタの命令アドレス情報及び当該所定事象の発生要因に基づいて前記第1ルックアップテーブルから状態指定コードを取得すると共に取得した状態指定コードを用いて前記第2のルックアップテーブルから制御データを読み出してインタフェース制御部に与え、
前記インタフェース制御部は、与えられた制御データに従って前記トライステート出力バッファ回路及び前記端子状態設定回路を制御して前記所定の外部端子の状態を決定する、半導体装置。
A plurality of external terminals;
An interface unit connected to the external terminal;
An interface control unit for controlling the interface unit;
A data processing unit that performs processing of an input signal input from the interface control unit, generation of an output signal output from the interface unit, program processing for executing an instruction, and other data processing;
A non-volatile storage unit connected to the data processing unit,
The interface unit includes a tristate output buffer circuit having an output terminal connected to the predetermined external terminal, an input buffer circuit having an input terminal connected to the predetermined external terminal, and a predetermined external terminal connected to the interface unit. A terminal state setting circuit for selectively setting an external terminal to a pull-up, pull-down, open, or previous value holding state;
The nonvolatile storage unit sequentially stores instruction address information for capturing the current execution instruction address by the data processing unit, and for each program address range executed by the data processing unit, A first lookup table in which a state designation code of an external terminal is associated with an occurrence factor of a predetermined event assumed during execution of a program in the range, and a second lookup of control data using the state designation code as a search key A table, and when the occurrence of a predetermined event is notified from the data processing unit, from the first lookup table based on the instruction address information of the execution address register and the occurrence factor of the predetermined event Obtaining the state designation code and using the obtained state designation code, the second lookup table Given to the interface control unit reads the control data from the le,
The interface control unit determines the state of the predetermined external terminal by controlling the tri-state output buffer circuit and the terminal state setting circuit according to given control data.
前記実行アドレスレジスタはMRAMである、請求項7記載の半導体装置。   The semiconductor device according to claim 7, wherein the execution address register is an MRAM. 前記インタフェース制御部は、前記制御データに従って前記トライステート出力バッファをハイインピーダンスにして前記端子状態設定回路をプルアップ、プルダウン、オープン又は前値保持の状態とすることにより前記所定の外部端子の状態を決定する、請求項7記載の半導体装置。   The interface control unit sets the state of the predetermined external terminal by setting the terminal state setting circuit in a state of pulling up, pulling down, opening, or holding a previous value by setting the tristate output buffer to high impedance according to the control data. The semiconductor device according to claim 7, which is determined. 前記所定の事象の発生要因は電源検出器によって検出される電源電圧の所定電圧以下への変化であり、
前記不揮発性メモリ部は、前記所定電圧以下への変化による割り込み要因の発生が前記データ処理部から通知されたとき、前記実行アドレスレジスタの値と前記要因とに対応する前記状態指定コードを第1ルックアップテーブルから取得すると共に、取得した状態指定コードを用いて前記第2のルックアップテーブルから制御データを取得して前記インタフェース部に出力する、請求項7記載の半導体装置。
The occurrence factor of the predetermined event is a change of the power supply voltage detected by the power supply detector to a predetermined voltage or lower,
When the occurrence of an interrupt factor due to a change below the predetermined voltage is notified from the data processing unit, the nonvolatile memory unit receives the value of the execution address register and the state designation code corresponding to the factor. 8. The semiconductor device according to claim 7, wherein the semiconductor device is obtained from a lookup table, and control data is obtained from the second look-up table using the obtained state designation code and output to the interface unit.
前記所定の事象の発生要因は所定の割り込み要因又は例外要因であり、
前記不揮発性記憶部は、前記所定の割り込み要因又は例外要因の発生が前記データ処理部から通知されると、そのときの実行アドレスレジスタの値と前記要因とに対応する前記状態指定コードを第1ルックアップテーブルから取得すると共に、取得した状態指定コードを用いて前記第2のルックアップテーブルから制御データを読み出して前記インタフェース部に出力する、請求項7記載の半導体装置。
The occurrence factor of the predetermined event is a predetermined interrupt factor or an exception factor,
When the occurrence of the predetermined interrupt factor or exception factor is notified from the data processing unit, the nonvolatile storage unit first sets the state designation code corresponding to the value of the execution address register and the factor at that time The semiconductor device according to claim 7, wherein the semiconductor device is obtained from a look-up table, and control data is read from the second look-up table using the obtained state designation code and output to the interface unit.
複数個の外部端子と、
前記外部端子に接続されたインタフェース部と、
前記インタフェース部を制御するインタフェース制御部と、
前記インタフェース制御部から入力した入力信号の処理、前記インタフェース部から出力する出力信号の生成、及びその他のデータ処理を行うデータ処理部と、
前記データ処理部に接続された不揮発性記憶部と、を有し、
前記インタフェース部は、所定の前記外部端子に出力端子が接続されたトライステート出力バッファ回路と、所定の前記外部端子に入力端子が接続された入力バッファ回路と、所定の前記外部端子に接続され当該外部端子を選択的にプルアップ、プルダウン、オープン又は前値保持の状態に設定する端子状態設定回路とを有し、
前記不揮発性記憶部は前記外部端子の状態を指定するための状態指定コードを検索キーとする制御データのルックアップテーブルを格納する領域を有し、
前記データ処理部は、データ処理に従って予め前記状態指定コードを不揮発性記憶部に格納し、所定の事象の発生が通知されたとき、前記不揮発性記憶部に予め格納されている前記状態指定コードを用いて前記ルックアップテーブルから制御データを読み出し、
前記インタフェース制御部は前記読み出された前記制御データに従って前記トライステート出力バッファ回路及び前記端子状態設定回路を制御して前記所定の外部端子の状態を決定する、半導体装置。
A plurality of external terminals;
An interface unit connected to the external terminal;
An interface control unit for controlling the interface unit;
A data processing unit that performs processing of an input signal input from the interface control unit, generation of an output signal output from the interface unit, and other data processing;
A non-volatile storage unit connected to the data processing unit,
The interface unit includes a tristate output buffer circuit having an output terminal connected to the predetermined external terminal, an input buffer circuit having an input terminal connected to the predetermined external terminal, and a predetermined external terminal connected to the interface unit. A terminal state setting circuit for selectively setting an external terminal to a pull-up, pull-down, open, or previous value holding state;
The non-volatile storage unit has an area for storing a lookup table of control data using a state designation code for designating a state of the external terminal as a search key,
The data processing unit stores the state designation code in the nonvolatile storage unit in advance according to data processing, and when the occurrence of a predetermined event is notified, the state designation code stored in the nonvolatile storage unit is stored in advance. Read out the control data from the lookup table,
The interface control unit controls the tristate output buffer circuit and the terminal state setting circuit according to the read control data to determine the state of the predetermined external terminal.
前記不揮発性記憶部は前記データ処理部によって前記状態指定コードを書き込み可能な不揮発性の状態指定コードレジスタを有し、
前記データ処理部は所定事象の発生を検出したとき前記状態指定コードレジスタの状態指定コードを用いて前記ルックアップテーブルから検索した前記制御データを前記インタフェース部に出力する、請求項12記載の半導体装置。
The nonvolatile storage unit has a nonvolatile state designation code register in which the state designation code can be written by the data processing unit,
13. The semiconductor device according to claim 12, wherein when the occurrence of a predetermined event is detected, the data processing unit outputs the control data retrieved from the lookup table using the state designation code of the state designation code register to the interface unit. .
前記データ処理部はデータ処理の一環として、当該データ処理の先頭で所要の状態指定コードを予め前記状態指定コードレジスタに書き込む、請求項13記載の半導体装置。   14. The semiconductor device according to claim 13, wherein the data processing unit writes a required state designation code in the state designation code register in advance at the beginning of the data processing as part of the data processing. 前記インタフェース制御部は、前記制御データに従って前記トライステート出力バッファをハイインピーダンスにして前記端子状態設定回路をプルアップ、プルダウン、オープン又は前値保持の状態とすることにより前記所定の外部端子の状態を決定する、請求項14記載の半導体装置。   The interface control unit sets the state of the predetermined external terminal by setting the terminal state setting circuit in a state of pulling up, pulling down, opening, or holding a previous value by setting the tristate output buffer to high impedance according to the control data. The semiconductor device according to claim 14, which is determined. 前記所定の事象は電源検出器によって検出される電源電圧の所定電圧以下への変化であり、
前記データ処理部は電源検出器の出力により前記電源電圧の所定電圧以下への変化を判別したとき、前記状態指定コードレジスタが保有する状態指定コードを用いてルックアップテーブルから検索した前記制御データを前記インタフェース部に出力する、請求項14記載の半導体装置。
The predetermined event is a change of the power supply voltage detected by the power supply detector to a predetermined voltage or lower,
When the data processing unit determines the change of the power supply voltage to a predetermined voltage or less by the output of the power supply detector, the control data retrieved from the lookup table using the state designation code held by the state designation code register is obtained. The semiconductor device according to claim 14, wherein the semiconductor device outputs to the interface unit.
前記所定の事象は所定の割り込み要因又は例外要因であり、
前記データ処理部は前記所定の割り込み要因による割り込み処理又は所定の例外要因による例外処理によって、前記状態指定コードレジスタが保有する状態指定コードを用いてルックアップテーブルから検索した前記制御データを前記インタフェース部に出力する、請求項14記載の半導体装置。
The predetermined event is a predetermined interrupt factor or exception factor,
The data processing unit is configured to retrieve the control data retrieved from a look-up table using a state designation code stored in the state designation code register by an interrupt process by the predetermined interrupt factor or an exception process by a predetermined exception factor. 15. The semiconductor device according to claim 14, wherein
複数個の外部端子と、
前記外部端子に接続されたインタフェース部と、
前記インタフェース部を制御するインタフェース制御部と、
前記インタフェース制御部から入力した入力信号の処理、前記インタフェース部から出力する出力信号の生成、命令を実行するプログラム処理及びその他のデータ処理を行うデータ処理部と、
前記データ処理部に接続された不揮発性記憶部と、を有し、
前記インタフェース部は、所定の前記外部端子に出力端子が接続されたトライステート出力バッファ回路と、所定の前記外部端子に入力端子が接続された入力バッファ回路と、所定の前記外部端子に接続され当該外部端子を選択的にプルアップ、プルダウン、オープン又は前値保持の状態に設定する端子状態設定回路とを有し、
前記不揮発性記憶部は、前記データ処理部による現在の実行命令アドレスを捕捉するための命令アドレス情報を逐次保持する不揮発性の実行アドレスレジスタと、前記データ処理部が実行するプログラムアドレス範囲毎に、その範囲のプログラムの実行中に想定される所定事象の発生要因に外部端子の状態指定コードを対応付けた第1ルックアップテーブルと、前記状態指定コードを検索キーとする制御データの第2ルックアップテーブルと、を格納する領域を有し、
前記データ処理部は、所定の事象が発生したとき前記実行アドレスレジスタの命令アドレス情報及び当該所定事象の発生要因に基づいて前記第1ルックアップテーブルから状態指定コードを取得すると共に取得した状態指定コードを用いて前記第2のルックアップテーブルから制御データを読み出し、
前記インタフェース制御部は、読み出された制御データに従って前記トライステート出力バッファ回路及び前記端子状態設定回路を制御して前記所定の外部端子の状態を決定する、半導体装置。
A plurality of external terminals;
An interface unit connected to the external terminal;
An interface control unit for controlling the interface unit;
A data processing unit that performs processing of an input signal input from the interface control unit, generation of an output signal output from the interface unit, program processing for executing an instruction, and other data processing;
A non-volatile storage unit connected to the data processing unit,
The interface unit includes a tristate output buffer circuit having an output terminal connected to the predetermined external terminal, an input buffer circuit having an input terminal connected to the predetermined external terminal, and a predetermined external terminal connected to the interface unit. A terminal state setting circuit for selectively setting an external terminal to a pull-up, pull-down, open, or previous value holding state;
The nonvolatile storage unit sequentially stores instruction address information for capturing the current execution instruction address by the data processing unit, and for each program address range executed by the data processing unit, A first lookup table in which a state designation code of an external terminal is associated with an occurrence factor of a predetermined event assumed during execution of a program in the range, and a second lookup of control data using the state designation code as a search key A table and an area for storing
The data processing unit acquires a state designation code from the first lookup table based on instruction address information of the execution address register and a cause of occurrence of the predetermined event when a predetermined event occurs, and the obtained state designation code Read control data from the second look-up table using
The interface control unit determines the state of the predetermined external terminal by controlling the tristate output buffer circuit and the terminal state setting circuit according to the read control data.
前記実行アドレスレジスタはMRAMである、請求項18記載の半導体装置。   The semiconductor device according to claim 18, wherein the execution address register is an MRAM. 前記インタフェース制御部は、前記制御データに従って前記トライステート出力バッファをハイインピーダンスにして前記端子状態設定回路をプルアップ、プルダウン、オープン又は前値保持の状態とすることにより前記所定の外部端子の状態を決定する、請求項18記載の半導体装置。   The interface control unit sets the state of the predetermined external terminal by setting the terminal state setting circuit in a state of pulling up, pulling down, opening, or holding a previous value by setting the tristate output buffer to high impedance according to the control data. The semiconductor device according to claim 18, which is determined. 前記所定の事象の発生要因は電源検出器によって検出される電源電圧の所定電圧以下への変化であり、
前記データ処理部は前記所定電圧以下への変化を要因とする割り込み処理によって、そのときの実行アドレスレジスタの値と前記要因とに対応する前記状態指定コードを第1ルックアップテーブルから取得すると共に、取得した状態指定コードを用いて前記第2のルックアップテーブルから制御データを読み出して前記インタフェース部に出力する、請求項18記載の半導体装置。
The occurrence factor of the predetermined event is a change of the power supply voltage detected by the power supply detector to a predetermined voltage or lower,
The data processing unit obtains the value of the execution address register at that time and the state designation code corresponding to the factor from the first look-up table by an interrupt process caused by a change to the predetermined voltage or less, The semiconductor device according to claim 18, wherein control data is read from the second look-up table using the acquired state designation code and output to the interface unit.
前記所定の事象の発生要因は所定の割り込み要因又は例外要因であり、
前記データ処理部は前記所定の割り込み要因による割り込み処理又は所定の例外要因による例外処理によって、そのときの実行アドレスレジスタの値と前記要因とに対応する前記状態指定コードを第1ルックアップテーブルから取得すると共に、取得した状態指定コードを用いて前記第2のルックアップテーブルから制御データを取得して前記インタフェース部に出力する、請求項18記載の半導体装置。
The occurrence factor of the predetermined event is a predetermined interrupt factor or an exception factor,
The data processing unit acquires the value of the execution address register at that time and the state designation code corresponding to the factor from the first look-up table by the interrupt processing by the predetermined interrupt factor or the exception processing by the predetermined exception factor. The semiconductor device according to claim 18, wherein control data is acquired from the second look-up table using the acquired state designation code and output to the interface unit.
データ処理を行う第1半導体装置と、前記第1半導体装置に接続されてその制御を受ける第2半導体装置とを有するデータ処理システムであって、
前記第1半導体装置は、異常が発生したときに所定の入出力端子の端子状態を前記データ処理の処理毎の状態に応じて制御するための制御データを予め不揮発性メモリ部に保存し、データ処理の処理毎に不揮発性メモリ部に前記制御データを特定する検索キーを逐次設定し、前記異常が発生したときは、当該検索キーに基づいて参照した制御データに従って、所定の入出力端子の状態をプルアップ、プルダウン、ハイインピーダンス又は前値保持の状態に設定し、
前記第2半導体装置は、前記所定の入出力端子の内の所要端子の状態を入力回路で受けて内部状態を決定し、前記第1半導体装置は、前記所定の入出力端子の内の所要端子の状態を入力回路で受けて内部状態を決定する、データ処理システム。
A data processing system comprising: a first semiconductor device that performs data processing; and a second semiconductor device that is connected to and controlled by the first semiconductor device,
The first semiconductor device stores in advance a control data for controlling a terminal state of a predetermined input / output terminal in accordance with a state for each processing of the data processing when an abnormality occurs in the nonvolatile memory unit, A search key for specifying the control data is sequentially set in the nonvolatile memory unit for each processing, and when the abnormality occurs, the state of a predetermined input / output terminal according to the control data referred to based on the search key Set to pull-up, pull-down, high impedance or hold previous value,
The second semiconductor device receives a state of a required terminal among the predetermined input / output terminals by an input circuit to determine an internal state, and the first semiconductor device includes a required terminal among the predetermined input / output terminals. A data processing system that determines the internal state by receiving the state of the input at the input circuit.
データ処理を行う第1半導体装置と、前記第1半導体装置に接続されてその制御を受ける第2半導体装置とを有するデータ処理システムであって、
前記第1半導体装置は、異常が発生したときに所定の入出力端子の端子状態を前記データ処理のプログラム範囲及びその範囲のプログラムの実行中に想定される所定事象の発生要因に応じて制御するための制御データを予め不揮発性メモリ部に保存し、データ処理の進行に伴って不揮発性メモリ部に前記制御データを特定する検索キーを逐次設定し、前記異常が発生したときは、当該検索キーに基づいて参照した制御データに従って、所定の入出力端子の状態をプルアップ、プルダウン、ハイインピーダンス又は前値保持の状態に設定し、
前記第2半導体装置は前記所定の入出力端子の内の所要端子の状態を入力回路で受けて内部状態を決定し、前記第1半導体装置は前記所定の入出力端子の内の所要端子の状態を入力回路で受けて内部状態を決定する、データ処理システム。
A data processing system comprising: a first semiconductor device that performs data processing; and a second semiconductor device that is connected to and controlled by the first semiconductor device,
When an abnormality occurs, the first semiconductor device controls a terminal state of a predetermined input / output terminal according to a program range of the data processing and a generation factor of a predetermined event assumed during execution of the program in the range. Control data for storing the control data in advance in the nonvolatile memory unit, and sequentially setting a search key for specifying the control data in the nonvolatile memory unit as the data processing proceeds. In accordance with the control data referred to based on, the state of the predetermined input / output terminal is set to a pull-up, pull-down, high impedance or previous value holding state,
The second semiconductor device receives a state of a required terminal among the predetermined input / output terminals by an input circuit to determine an internal state, and the first semiconductor device is a state of the required terminal among the predetermined input / output terminals. A data processing system that receives an input circuit to determine the internal state.
JP2011086470A 2011-04-08 2011-04-08 Semiconductor device Withdrawn JP2012222614A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011086470A JP2012222614A (en) 2011-04-08 2011-04-08 Semiconductor device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011086470A JP2012222614A (en) 2011-04-08 2011-04-08 Semiconductor device

Publications (1)

Publication Number Publication Date
JP2012222614A true JP2012222614A (en) 2012-11-12

Family

ID=47273661

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011086470A Withdrawn JP2012222614A (en) 2011-04-08 2011-04-08 Semiconductor device

Country Status (1)

Country Link
JP (1) JP2012222614A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013085082A (en) * 2011-10-07 2013-05-09 Renesas Electronics Corp Semiconductor device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013085082A (en) * 2011-10-07 2013-05-09 Renesas Electronics Corp Semiconductor device

Similar Documents

Publication Publication Date Title
US7449926B2 (en) Circuit for asynchronously resetting synchronous circuit
US9436598B2 (en) Semiconductor device with nonvolatile memory prevented from malfunctioning caused by momentary power interruption
JP2007066037A (en) Semiconductor integrated circuit
WO2016180093A1 (en) Read/write control circuit and method for flash chip, and amoled application circuit
JP2008009721A (en) Evaluation system and evaluation method thereof
EP3573063B1 (en) Power-down/power-loss memory controller
JP2016197410A (en) System, method, and apparatus for controlling power-on or boot sequence of integrated circuit on the basis of power harvesting condition
US9697065B1 (en) Systems and methods for managing reset
JP2003187593A (en) Semiconductor device and nonvolatile semiconductor memory
JP2014222425A (en) Semiconductor integrated circuit, method of manufacturing semiconductor integrated circuit, computer system, and method of controlling semiconductor integrated circuit
JP2022003604A (en) Semiconductor storage device
US9557787B2 (en) Data processor and data processing system
JP2003044303A (en) Computer system
US20150097607A1 (en) Integrated circuit and operation method thereof
JP2012222614A (en) Semiconductor device
WO2016206263A1 (en) System and method of preventing data corruption during power-on/power-off of spi flash
JP2014164471A (en) LSI and information processing system
US11307636B2 (en) Semiconductor storing apparatus and flash memory operation method
KR20160041358A (en) Semiconductor device and semiconductor system with the same
JP2015142361A (en) Electronic apparatus with programmable logic circuit device, and rewriting method
JP6998981B2 (en) Semiconductor storage device
JP2007034508A (en) Reset circuit and method for operating reset circuit
JP3066063U (en) Flash memory with recovery capability
US10761581B2 (en) Method and module for programmable power management, and system on chip
KR100663902B1 (en) Apparatus for controlling a read only memory code option using program read only memory

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20140701