JP6398449B2 - Electronic information recording medium, processor module operation control method, and processor module operation control program - Google Patents

Electronic information recording medium, processor module operation control method, and processor module operation control program Download PDF

Info

Publication number
JP6398449B2
JP6398449B2 JP2014163414A JP2014163414A JP6398449B2 JP 6398449 B2 JP6398449 B2 JP 6398449B2 JP 2014163414 A JP2014163414 A JP 2014163414A JP 2014163414 A JP2014163414 A JP 2014163414A JP 6398449 B2 JP6398449 B2 JP 6398449B2
Authority
JP
Japan
Prior art keywords
processor module
processor
stopped
cache
program 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.)
Active
Application number
JP2014163414A
Other languages
Japanese (ja)
Other versions
JP2016038829A (en
Inventor
柴田 直人
直人 柴田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dai Nippon Printing Co Ltd
Original Assignee
Dai Nippon Printing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dai Nippon Printing Co Ltd filed Critical Dai Nippon Printing Co Ltd
Priority to JP2014163414A priority Critical patent/JP6398449B2/en
Publication of JP2016038829A publication Critical patent/JP2016038829A/en
Application granted granted Critical
Publication of JP6398449B2 publication Critical patent/JP6398449B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、複数のプロセッサモジュールを備える電子情報記録媒体の技術分野に関する。   The present invention relates to a technical field of an electronic information recording medium including a plurality of processor modules.

従来、ICカードにおいて、レーザー光などを用いた故障利用攻撃などにより内部の機密情報が不正に漏洩してしまうことがあり、異常を検知するなどの対策が検討されている(例えば、特許文献1及び特許文献2参照)。一般に異常を検知するための処理は冗長であり、これを行うことで本来外部より要求されている処理よりも長い処理時間となってしまう。不正を検知するための専用の回路を用意することも可能ではあるが、例えば、実行中のプログラムコードに対しチェックコードを演算する場合、チェックコードの演算方式は固定的もしくは選択的となり、もしこれらの演算方式に致命的な欠陥が見つかった場合では対応が困難である。   Conventionally, in IC cards, internal confidential information may be illegally leaked due to a failure use attack using a laser beam or the like, and countermeasures such as detecting an abnormality have been studied (for example, Patent Document 1). And Patent Document 2). In general, the process for detecting an abnormality is redundant, and if this is performed, the processing time is longer than that originally required from the outside. Although it is possible to prepare a dedicated circuit for detecting fraud, for example, when the check code is calculated for the program code being executed, the check code calculation method is fixed or selective. If a fatal defect is found in this calculation method, it is difficult to cope with it.

ところで、内部にキャッシュメモリを備えるプロセッサモジュールが、スプリット方式のバスに複数接続され、各プロセッサモジュールがメモリを共有しているマルチプロセッサシステムが知られている(例えば、特許文献3参照)。   By the way, there is known a multiprocessor system in which a plurality of processor modules each including a cache memory are connected to a split-type bus and each processor module shares a memory (see, for example, Patent Document 3).

特許第5200664号Japanese Patent No. 5200664 特許第4976854号Japanese Patent No. 4976854 特許第3219422号Japanese Patent No. 3219422

特許文献3に開示されたマルチプロセッサシステムのように、複数のプロセッサモジュールを含み、この中の一部のプロセッサモジュールを外部からの要求のための処理を行なうICカードが想定される。このようなICカードでは、プロセッサモジュールはそれぞれ独立して機能することが可能であるが、プロセッサモジュールに含まれるキャッシュメモリのメモリサイズは数kbyte程度に制限されている。このため、プログラムコードもしくはデータがキャッシュメモリ上に存在しない場合には、キャッシュミスとなり、バスを介してメモリからキャッシュメモリへのデータ転送(メモリ転送)が必要となる。インターロック方式のバスでは、このメモリ転送を行なう間、当該バスが一方のプロセッサモジュールに占有されることとなるが、他方のプロセッサモジュールもキャッシュミスが発生した場合にこのメモリ転送が終了するまで待たなくてはならない。一方、スプリット方式のバスであっても、所定間隔で分割された時間、当該バスが一方のプロセッサモジュールに占有されることとなる。このため、通信などの高速性が求められる処理などでは、これらの待ち時間が致命的な問題となる可能性がある。また異常を検知した場合は、通常処理を進めることで不正な状況が広がる可能性もある。   As in the multiprocessor system disclosed in Patent Document 3, an IC card including a plurality of processor modules and performing processing for a request from the outside of a part of the processor modules is assumed. In such an IC card, each processor module can function independently, but the memory size of the cache memory included in the processor module is limited to about several kilobytes. For this reason, when the program code or data does not exist in the cache memory, a cache miss occurs, and data transfer (memory transfer) from the memory to the cache memory via the bus is required. In the interlock-type bus, the bus is occupied by one processor module during the memory transfer, but the other processor module also waits until the memory transfer is completed when a cache miss occurs. Must-have. On the other hand, even in the case of a split type bus, the bus is occupied by one processor module for a time divided at a predetermined interval. For this reason, these waiting times may become a fatal problem in processing that requires high speed such as communication. In addition, when an abnormality is detected, there is a possibility that an illegal situation spreads by proceeding with normal processing.

そこで、本発明は、上記問題等に鑑みてなされたものであり、複数のプロセッサモジュールのうち、状況に応じて何れかのプロセッサモジュールを優先して動作させることが可能な電子情報記録媒体、プロセッサモジュールの動作制御方法、及びプロセッサモジュールの動作制御プログラムを提供することを目的とする。   Accordingly, the present invention has been made in view of the above problems and the like, and an electronic information recording medium and processor capable of preferentially operating any one of a plurality of processor modules depending on the situation. It is an object to provide a module operation control method and a processor module operation control program.

上記課題を解決するために、請求項1に記載の発明は、プログラムコードまたはデータを記憶する記憶手段と、前記記憶手段からバスを介して取得した前記プログラムコードまたはデータの一部をキャッシュする複数のプロセッサモジュールであって役割に応じた異なる処理を実行する複数のプロセッサモジュールとを備える電子情報記録媒体であって、前記複数のプロセッサモジュールのうち、前記プログラムコードまたはデータのキャッシュミス発生時に停止させる前記プロセッサモジュールを予め設定する設定手段と、前記キャッシュミスが発生したか否かを判定する判定手段と、前記判定手段により、前記設定手段により予め設定された前記プロセッサモジュールを含む複数のプロセッサモジュールにおいて前記キャッシュミスが発生したと判定された場合、前記設定手段により予め設定された前記プロセッサモジュールの動作を停止させ、当該停止される前記プロセッサモジュール以外の前記プロセッサモジュールの動作であって、前記記憶手段から、当該停止される前記プロセッサモジュール以外の前記プロセッサモジュールにおける前記キャッシュミスの対象となった前記プログラムコードまたはデータを取得する動作を行わせる制御手段と、を備えることを特徴とする。 In order to solve the above-described problem, the invention described in claim 1 includes a storage unit for storing program code or data, and a plurality of caches for a part of the program code or data acquired from the storage unit via a bus. An electronic information recording medium comprising a plurality of processor modules that perform different processes according to roles, and is stopped when a cache miss of the program code or data occurs among the plurality of processor modules In a plurality of processor modules including a setting unit that presets the processor module, a determination unit that determines whether or not the cache miss has occurred, and the processor module that is preset by the setting unit by the determination unit the cache miss is issued If it is determined the a, stops the preset operation of the processor module by said setting means, an act of the processor module other than said processor module being the stop, from the storage unit, are the stops Control means for performing an operation of acquiring the program code or data subject to the cache miss in the processor module other than the processor module .

請求項に記載の発明は、プログラムコードまたはデータを記憶する記憶手段と、前記記憶手段からバスを介して取得した前記プログラムコードまたはデータの一部をキャッシュする複数のプロセッサモジュールであって役割に応じた異なる処理を実行する複数のプロセッサモジュールとを備える電子情報記録媒体における前記プロセッサモジュールの動作制御方法であって、前記複数のプロセッサモジュールのうち、前記プログラムコードまたはデータのキャッシュミス発生時に停止させる前記プロセッサモジュールを予め設定する設定ステップと、前記キャッシュミスが発生したか否かを判定する判定ステップと、前記設定ステップで予め設定された前記プロセッサモジュールを含む複数のプロセッサモジュールにおいて前記キャッシュミスが発生したと前記判定ステップで判定された場合、前記設定ステップで予め設定された前記プロセッサモジュールの動作を停止させ、当該停止される前記プロセッサモジュール以外の前記プロセッサモジュールの動作であって、前記記憶手段から、当該停止される前記プロセッサモジュール以外の前記プロセッサモジュールにおける前記キャッシュミスの対象となった前記プログラムコードまたはデータを取得する動作を行わせるステップと、を含むことを特徴とする。 The invention according to claim 2 is a storage means for storing program code or data, and a plurality of processor modules for caching a part of the program code or data acquired from the storage means via a bus. An operation control method for the processor module in an electronic information recording medium comprising a plurality of processor modules that execute different processes depending on the program code or data when a cache miss occurs in the program code or data . a setting step for setting beforehand the processor module, wherein the cache and determining whether or not a cache miss occurs, in a plurality of processor modules including the processor module is set in advance by the setting step If the scan is determined in said determining step to have occurred, the setting stops the preset operation of the processor module in step, an act of the processor module other than said processor modules such suspension, the An operation of acquiring the program code or data subject to the cache miss in the processor module other than the processor module to be stopped is performed from a storage unit .

請求項に記載の発明は、プログラムコードまたはデータを記憶する記憶手段と、前記記憶手段からバスを介して取得した前記プログラムコードまたはデータの一部をキャッシュする複数のプロセッサモジュールであって役割に応じた異なる処理を実行する複数のプロセッサモジュールとを備える電子情報記録媒体におけるコンピュータに、前記複数のプロセッサモジュールのうち、前記プログラムコードまたはデータのキャッシュミス発生時に停止させる前記プロセッサモジュールを予め設定する設定ステップと、前記キャッシュミスが発生したか否かを判定する判定ステップと、前記設定ステップで予め設定された前記プロセッサモジュールを含む複数のプロセッサモジュールにおいて前記キャッシュミスが発生したと前記判定ステップで判定された場合、前記設定ステップで予め設定された前記プロセッサモジュールの動作を停止させ、当該停止される前記プロセッサモジュール以外の前記プロセッサモジュールの動作であって、前記記憶手段から、当該停止される前記プロセッサモジュール以外の前記プロセッサモジュールにおける前記キャッシュミスの対象となった前記プログラムコードまたはデータを取得する動作を行わせるステップと、を実行させることを特徴とする。 The invention according to claim 3 is a storage means for storing program code or data, and a plurality of processor modules for caching a part of the program code or data acquired from the storage means via a bus. A setting for presetting the processor module to be stopped when a cache miss of the program code or data occurs in a computer in an electronic information recording medium including a plurality of processor modules that execute different processes depending on steps and, wherein the determination step and a cache miss and determining whether or not generated, the cache miss in a plurality of processor modules including the processor module is set in advance by the setting step occurs If it is determined, the set is stopped a preset operation of the processor module in step, an act of the processor module other than said processor module being the stop, from the storage means is the stop the Performing an operation of acquiring the program code or data that is the target of the cache miss in the processor module other than the processor module .

本発明によれば、複数のプロセッサモジュールのうち、状況に応じて何れかのプロセッサモジュールを優先して動作させることができる。   According to the present invention, one of the plurality of processor modules can be preferentially operated according to the situation.

ICチップCの概要構成例を示す図である。2 is a diagram showing an example of a schematic configuration of an IC chip C. FIG. 実施例1におけるスペシャルファンクションレジスタの構成例を示す図である。3 is a diagram illustrating a configuration example of a special function register in Embodiment 1. FIG. プロセッサ制御回路7により行われる処理の一例を示すフローチャートである。3 is a flowchart illustrating an example of processing performed by a processor control circuit 7. 実施例2におけるスペシャルファンクションレジスタの構成例を示す図である。10 is a diagram illustrating a configuration example of a special function register in Embodiment 2. FIG. 実施例2におけるプロセッサモジュール2により行われる異常判定処理の一例を示すフローチャートである。10 is a flowchart illustrating an example of an abnormality determination process performed by a processor module 2 according to the second embodiment. 実施例3におけるプロセッサモジュール2により行われる異常判定処理の一例を示すフローチャートである。10 is a flowchart illustrating an example of an abnormality determination process performed by a processor module 2 according to a third embodiment. 実施例4におけるスペシャルファンクションレジスタの構成例を示す図である。FIG. 10 is a diagram illustrating a configuration example of a special function register according to a fourth embodiment. (A)は、プロセッサモジュール1にてキャッシュミスが発生しキャッシュ読込み動作を行なっている際に、優先順位が低く設定されたプロセッサモジュール2でもキャッシュミスが発生した場合の動作を示すタイミングチャートである。(B)は、優先順位が低く設定されたプロセッサモジュール2にてキャッシュミスが発生しキャッシュ読込み動作を行なっている際に、プロセッサモジュール1でもキャッシュミスが発生した場合の動作を示すタイミングチャートである。(A) is a timing chart showing an operation when a cache miss occurs even in the processor module 2 set with a low priority when a cache miss occurs in the processor module 1 and a cache read operation is performed. . (B) is a timing chart showing an operation when a cache miss occurs in the processor module 1 when a cache miss occurs in the processor module 2 set with a low priority and a cache read operation is performed. .

以下、図面を参照して本発明の実施形態について詳細に説明する。以下に説明する実施形態は、ICチップに対して本発明を適用した場合の実施の形態である。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. The embodiment described below is an embodiment when the present invention is applied to an IC chip.

先ず、図1を参照して、本実施形態に係るICチップの概要構成について説明する。図1は、ICチップCの概要構成例を示す図である。ICチップCは、本発明の電子情報記録媒体の一例である。なお、ICチップCは、キャッシュカード、クレジットカード、社員カード等に搭載されて使用される。或いは、ICチップCは、スマートフォンや携帯電話機等の通信機器に組み込まれる。ICチップCは、通信機器の回路基板上に直接組み込んで構成するようにしてもよい。   First, a schematic configuration of the IC chip according to the present embodiment will be described with reference to FIG. FIG. 1 is a diagram illustrating a schematic configuration example of the IC chip C. The IC chip C is an example of the electronic information recording medium of the present invention. The IC chip C is used by being mounted on a cash card, a credit card, an employee card or the like. Alternatively, the IC chip C is incorporated in a communication device such as a smartphone or a mobile phone. The IC chip C may be configured by being directly incorporated on the circuit board of the communication device.

ICチップCは、図1に示すように、プロセッサモジュール1、プロセッサモジュール2、RAM(Random Access Memory)3、ROM(Read Only Memory)4、NVM(Nonvolatile Memory)5、I/O回路6、及びプロセッサ制御回路7を備えて構成され、これらの構成要素は、バス8に接続されている。バス8は、アドレスバスとデータバスを備える。なお、図1に示すICチップCは、2つのプロセッサモジュールを備えるが、3つ以上のプロセッサモジュールを備えてもよい。RAM3、ROM4、及びNVM5は、プログラムコードまたはデータを記憶する記憶手段の一例である。例えば、ROM4、またはNVM5には、OS、アプリケーションプログラム(複数のプログラムコードから構成)、及び本発明の動作制御プログラムが記憶される。NVM5には、フラッシュメモリ、または「Electrically Erasable Programmable Read-Only Memory」が適用される。I/O回路6は、外部機器とのインターフェイスを担う。接触式のICチップCの場合、I/O回路6には、例えば、C1〜C8の8個の端子が備えられている。例えば、C1端子は電源端子、C2端子はリセット端子、C3端子はクロック端子、C5端子はグランド端子、C7端子は外部機器との間で通信を行うための端子である。一方、非接触式のICチップCの場合、I/O回路6には、例えば、アンテナ、及び変復調回路が備えられている。なお、外部機器の例としては、ICカード発行機、ATM、改札機、認証用ゲート等が挙げられる。或いは、ICチップCが通信機器に組み込まれる場合、外部機器には通信機器の機能を担う制御部が該当する。更に、外部機器として、電圧センサー、温度センサー、光センサー等の異常検知センサーが挙げられる。なお、異常検知センサーは、ICチップCに搭載されてもよい。   As shown in FIG. 1, the IC chip C includes a processor module 1, a processor module 2, a RAM (Random Access Memory) 3, a ROM (Read Only Memory) 4, an NVM (Nonvolatile Memory) 5, an I / O circuit 6, and A processor control circuit 7 is provided, and these components are connected to a bus 8. The bus 8 includes an address bus and a data bus. The IC chip C shown in FIG. 1 includes two processor modules, but may include three or more processor modules. The RAM 3, the ROM 4, and the NVM 5 are an example of a storage unit that stores program codes or data. For example, the ROM 4 or the NVM 5 stores an OS, an application program (consisting of a plurality of program codes), and an operation control program of the present invention. A flash memory or “Electrically Erasable Programmable Read-Only Memory” is applied to the NVM 5. The I / O circuit 6 serves as an interface with an external device. In the case of the contact type IC chip C, the I / O circuit 6 includes, for example, eight terminals C1 to C8. For example, the C1 terminal is a power supply terminal, the C2 terminal is a reset terminal, the C3 terminal is a clock terminal, the C5 terminal is a ground terminal, and the C7 terminal is a terminal for communicating with an external device. On the other hand, in the case of the non-contact type IC chip C, the I / O circuit 6 includes, for example, an antenna and a modulation / demodulation circuit. Examples of external devices include IC card issuers, ATMs, ticket gates, and authentication gates. Alternatively, when the IC chip C is incorporated in a communication device, the external device corresponds to a control unit that functions as a communication device. Furthermore, examples of external devices include abnormality detection sensors such as voltage sensors, temperature sensors, and optical sensors. The abnormality detection sensor may be mounted on the IC chip C.

プロセッサモジュール1,2は、それぞれ、CPUコア11,21、及びキャッシュ12,22等を備える。プロセッサモジュール1とプロセッサモジュール2とは同一の構成を有するが、役割に応じた異なる処理を実行する。例えば、プロセッサモジュール1は、外部機器からI/O回路6を介して入力されたコマンドに応じて処理(以下、「メイン処理」という)を行う。一方、プロセッサモジュール2は、例えば、メイン処理とは異なる冗長的なサブ処理(例えば、異常検知処理、及び異常判定処理)を行う。CPUコア11,21は、それぞれ、図示しないが、演算器、プログラムカウンタ、及びレジスタ等により構成される。CPUコア11は、メイン処理において、プログラムコードをキャッシュ12からレジスタにフェッチ(取得)して解釈(デコード)、及び実行する。一方、CPUコア21は、サブ処理において、プログラムコードをキャッシュ22からレジスタにフェッチ(取得)して解釈(デコード)、及び実行する。キャッシュ12,22は、それぞれ、図示しないが、キャッシュメモリ、及びキャッシュメモリ制御部等により構成される。キャッシュメモリ制御部は、CPUコア11,21の制御の下、RAM3、ROM4、またはNVM5からバス8を介して取得したプログラムコードまたはデータの一部をキャッシュメモリにキャッシュ(一時的に保持)する。また、キャッシュメモリ制御部は、例えばCPUコア11から要求されたプログラムコードもしくはデータがキャッシュメモリ上に存在しない場合(つまり、キャッシュミスが発生した場合)、バス8を介して、RAM3、ROM4、またはNVM5からキャッシュメモリへのデータ転送(メモリ転送)を行う。なお、キャッシュ12,22は、プログラムコードに利用されるものと、データに利用されるものが物理的に分離されていてもよい。また、キャッシュ12,22の一部を複数のプロセッサモジュールにて共有してもよい。   The processor modules 1 and 2 include CPU cores 11 and 21, caches 12 and 22, respectively. The processor module 1 and the processor module 2 have the same configuration, but execute different processes according to their roles. For example, the processor module 1 performs processing (hereinafter referred to as “main processing”) according to a command input from an external device via the I / O circuit 6. On the other hand, the processor module 2 performs, for example, a redundant sub-process (for example, an abnormality detection process and an abnormality determination process) different from the main process. Although not shown, each of the CPU cores 11 and 21 includes an arithmetic unit, a program counter, a register, and the like. In the main process, the CPU core 11 fetches (acquires) the program code from the cache 12 into a register, interprets (decodes), and executes it. On the other hand, in the sub-process, the CPU core 21 fetches (acquires) the program code from the cache 22 to the register, interprets (decodes), and executes it. Each of the caches 12 and 22 includes a cache memory, a cache memory control unit, and the like (not shown). The cache memory control unit caches (temporarily holds) a part of the program code or data acquired from the RAM 3, the ROM 4, or the NVM 5 via the bus 8 under the control of the CPU cores 11 and 21. In addition, the cache memory control unit, for example, when the program code or data requested from the CPU core 11 does not exist in the cache memory (that is, when a cache miss occurs), the RAM 3, ROM 4, or Data transfer (memory transfer) from the NVM 5 to the cache memory is performed. The caches 12 and 22 may be physically separated from those used for program code and those used for data. A part of the caches 12 and 22 may be shared by a plurality of processor modules.

プロセッサ制御回路7は、本発明の設定手段、判定手段、及び制御手段を備え、プロセッサモジュール12,22のうち、所定の状況発生時に停止させるプロセッサモジュール(12または22)を予め設定し、当該所定の状況が発生したと判定された場合、上記設定されたプロセッサモジュールの動作を停止させ、当該停止されるプロセッサモジュール以外のプロセッサモジュールの動作を行わせる。これにより、複数のプロセッサモジュールのうち、状況に応じて何れかのプロセッサモジュールを優先して動作させることができる。なお、プロセッサ制御回路7は、例えば、ハードウェアにより構成されるが、プロセッサ制御回路7による処理は、ソフトウェアで構成されてもよく、この場合、プロセッサ制御回路7は、コンピュータとして本発明の動作制御プログラムに従って、本発明の設定手段、判定手段、及び制御手段として機能する。   The processor control circuit 7 includes the setting means, the determination means, and the control means of the present invention. Among the processor modules 12 and 22, a processor module (12 or 22) to be stopped when a predetermined situation occurs is set in advance, and the predetermined When it is determined that the above situation has occurred, the operation of the set processor module is stopped, and the operation of the processor modules other than the stopped processor module is performed. Thereby, it is possible to preferentially operate one of the plurality of processor modules depending on the situation. The processor control circuit 7 is configured by, for example, hardware, but the processing by the processor control circuit 7 may be configured by software. In this case, the processor control circuit 7 is a computer that performs the operation control of the present invention. According to the program, it functions as setting means, determination means, and control means of the present invention.

次に、本発明のICチップCの動作例について、実施例1〜実施例4に分けて説明する。   Next, an operation example of the IC chip C according to the present invention will be described separately in the first to fourth embodiments.

(実施例1)
先ず、図2及び図3を参照して、実施例1の動作について説明する。なお、実施例1において、所定の状況は、割込みイベントである。また、実施例1では、プロセッサ制御回路7は、スペシャルファンクションレジスタを備える。図2は、実施例1におけるスペシャルファンクションレジスタの構成例を示す図である。図2の例では、スペシャルファンクションレジスタとして、モジュール動作表示レジスタ71、発生イベント設定レジスタ72、停止イベント設定レジスタ73、及びモジュール動作設定レジスタ74a〜74hを示している。なお、図2の例では、それぞれのレジスタは、b(ビット)1〜b8の8ビットで構成されているが、これに限定されない。
Example 1
First, the operation of the first embodiment will be described with reference to FIGS. In the first embodiment, the predetermined situation is an interrupt event. In the first embodiment, the processor control circuit 7 includes a special function register. FIG. 2 is a diagram illustrating a configuration example of the special function register according to the first embodiment. In the example of FIG. 2, a module operation display register 71, a generated event setting register 72, a stop event setting register 73, and module operation setting registers 74a to 74h are shown as special function registers. In the example of FIG. 2, each register is configured with 8 bits b (bits) 1 to b8, but is not limited thereto.

モジュール動作表示レジスタ71は、プロセッサモジュール1(PM1)とプロセッサモジュール2(PM2)の現在の動作状態(0:停止、1:動作)を示すレジスタである。図2の例では、このレジスタ71のb1がプロセッサモジュール1の動作状態を示し、このレジスタ71のb2がプロセッサモジュール2の動作状態を示す。また、モジュール動作表示レジスタ71のb1及びb2(“0”または“1”)は、それぞれ、プロセッサ制御回路7、またはプロセッサモジュール1,2によりスイッチ可能(言い換えれば、ソフト的に切替設定可能)になっている。これにより、プロセッサモジュール1,2は、それぞれ、動作状態が切り換えられる。   The module operation display register 71 is a register indicating the current operation state (0: stop, 1: operation) of the processor module 1 (PM1) and the processor module 2 (PM2). In the example of FIG. 2, b <b> 1 of the register 71 indicates the operation state of the processor module 1, and b <b> 2 of the register 71 indicates the operation state of the processor module 2. Also, b1 and b2 (“0” or “1”) of the module operation display register 71 can be switched by the processor control circuit 7 or the processor modules 1 and 2 (in other words, can be switched and set by software). It has become. As a result, the operating states of the processor modules 1 and 2 are switched.

発生イベント設定レジスタ72は、発生した割込みイベントが設定(ハード的に設定)されるレジスタである。割込みイベントには、例えば、データ受信(I/O回路6を介したデータ(コマンド含む)受信)、データ送信(I/O回路6を介したデータ送信)、NVM更新、異常検知、ソフト割込み等、複数種類ある。なお、異常検知には、ハードウェア(例えば、異常検知センサー)による異常検知と、ソフトウェアによる異常検知とがある。図2の例では、発生した割込みイベントが、データ受信である場合、レジスタ72のb1が“0”から“1”に変更設定される。また、例えば発生した割込みイベントが、データ送信である場合、レジスタ72のb2が“0”から“1”に変更設定される。また、例えば発生した割込みイベントが、異常検知である場合、レジスタ72のb7が“0”から“1”に変更設定される。   The generated event setting register 72 is a register in which the generated interrupt event is set (set in hardware). Interrupt events include, for example, data reception (data (including command) reception via the I / O circuit 6), data transmission (data transmission via the I / O circuit 6), NVM update, abnormality detection, software interrupt, etc. There are multiple types. The abnormality detection includes abnormality detection by hardware (for example, an abnormality detection sensor) and abnormality detection by software. In the example of FIG. 2, when the interrupt event that has occurred is data reception, b1 of the register 72 is changed from “0” to “1”. For example, when the generated interrupt event is data transmission, b2 of the register 72 is changed from “0” to “1”. For example, when the generated interrupt event is an abnormality detection, b7 of the register 72 is changed from “0” to “1”.

停止イベント設定レジスタ73は、プロセッサモジュール1またはプロセッサモジュール2を停止させる割込みイベントが設定(ソフト的に設定)されるレジスタである。この設定は、例えばICカードの利用者からI/O回路6を介して入力される指示に従ってプロセッサ制御回路7により行われる。例えば、図2に示すように、レジスタ73のb1が“1”に設定されている場合、データ受信が発生したときにプロセッサモジュール1またはプロセッサモジュール2が停止されることになる。プロセッサモジュール1とプロセッサモジュール2のどちらが停止されるかは、モジュール動作設定レジスタ74a〜74hにて設定される。例えば、モジュール動作設定レジスタ74aは、データ受信に対応するレジスタであり、図2の例では、このレジスタ74aのb1は、“1”(プロセッサモジュール1が動作)に設定され、このレジスタ74aのb2は、“0”(プロセッサモジュール2が停止)に設定されている。この設定により、データ受信時に一定期間処理ができないことによる通信エラーの発生を防ぐことができる。このように、プロセッサ制御回路7は、互いに異なる複数の割込みイベントごとに、当該割込みイベントの発生時に停止させるプロセッサモジュールを設定することができる。   The stop event setting register 73 is a register in which an interrupt event for stopping the processor module 1 or the processor module 2 is set (software setting). This setting is performed by the processor control circuit 7 in accordance with an instruction input via the I / O circuit 6 from a user of the IC card, for example. For example, as shown in FIG. 2, when b1 of the register 73 is set to “1”, the processor module 1 or the processor module 2 is stopped when data reception occurs. Which of the processor module 1 and the processor module 2 is to be stopped is set in the module operation setting registers 74a to 74h. For example, the module operation setting register 74a is a register corresponding to data reception. In the example of FIG. 2, b1 of this register 74a is set to “1” (processor module 1 is operating), and b2 of this register 74a. Is set to “0” (the processor module 2 is stopped). With this setting, it is possible to prevent the occurrence of a communication error due to the fact that processing cannot be performed for a certain period when data is received. Thus, the processor control circuit 7 can set a processor module to be stopped when the interrupt event occurs for each of a plurality of different interrupt events.

図3は、プロセッサ制御回路7により行われる処理の一例を示すフローチャートである。図3に示す処理は、所定周期で繰り返し実行される。図3に示す処理では、先ず、プロセッサ制御回路7は、割込みイベントが発生したか否かを判定する(ステップS1)。発生イベント設定レジスタ72における何れかのビットに“1”が設定されている場合、割込みイベントが発生したと判定される。例えば、発生イベント設定レジスタ72におけるb1に“1”が設定されている場合、割込みイベント“データ受信”が発生したと判定される。割込みイベントが発生したと判定された場合(ステップS1:YES)、ステップS2へ進む。一方、割込みイベントが発生していないと判定された場合(ステップS1:NO)、当該処理が終了する。   FIG. 3 is a flowchart illustrating an example of processing performed by the processor control circuit 7. The process shown in FIG. 3 is repeatedly executed at a predetermined cycle. In the process shown in FIG. 3, first, the processor control circuit 7 determines whether or not an interrupt event has occurred (step S1). When “1” is set in any bit in the occurrence event setting register 72, it is determined that an interrupt event has occurred. For example, when “1” is set to b1 in the occurrence event setting register 72, it is determined that an interrupt event “data reception” has occurred. If it is determined that an interrupt event has occurred (step S1: YES), the process proceeds to step S2. On the other hand, when it is determined that no interrupt event has occurred (step S1: NO), the process ends.

ステップS2では、プロセッサ制御回路7は、発生した割込みイベントが、プロセッサモジュールを停止させる割込みイベントであるか否かを判定する。停止イベント設定レジスタ73において、発生した割込みイベントに対応するビットに“1”が設定されている場合、発生した割込みイベントが、プロセッサモジュールを停止させる割込みイベントであると判定される。例えば、停止イベント設定レジスタ73におけるb1に“1”が設定されている場合、発生した割込みイベント“データ受信”が、プロセッサモジュールを停止させる割込みイベントであると判定される。発生した割込みイベントが、プロセッサモジュールを停止させる割込みイベントであると判定された場合(ステップS2:YES)、ステップS3へ進む。一方、プロセッサモジュールを停止させる割込みイベントでないと判定された場合(ステップS2:NO)、当該処理が終了する。   In step S2, the processor control circuit 7 determines whether or not the generated interrupt event is an interrupt event that stops the processor module. When “1” is set in the bit corresponding to the generated interrupt event in the stop event setting register 73, it is determined that the generated interrupt event is an interrupt event that stops the processor module. For example, when “1” is set to b1 in the stop event setting register 73, it is determined that the interrupt event “data reception” that has occurred is an interrupt event that stops the processor module. When it is determined that the generated interrupt event is an interrupt event for stopping the processor module (step S2: YES), the process proceeds to step S3. On the other hand, when it is determined that the event is not an interrupt event that stops the processor module (step S2: NO), the processing ends.

ステップS3では、プロセッサ制御回路7は、停止させるプロセッサモジュールを特定する。例えば、停止させる割込みイベントが“データ受信”である場合、データ受信に対応するモジュール動作設定レジスタ74aにおいて“1”が設定されているビットに対応するプロセッサモジュールを、停止させるプロセッサモジュールとして特定(図2の例では、プロセッサモジュール2が特定)する。   In step S3, the processor control circuit 7 specifies a processor module to be stopped. For example, when the interrupt event to be stopped is “data reception”, the processor module corresponding to the bit set to “1” in the module operation setting register 74a corresponding to data reception is specified as the processor module to be stopped (see FIG. In the example of 2, the processor module 2 specifies).

次いで、プロセッサ制御回路7は、ステップS3で特定されたプロセッサモジュールが動作中であるか否かを判定する(ステップS4)。モジュール動作表示レジスタ71において、上記特定されたプロセッサモジュールに対応するビットに“1”が設定されている場合、当該プロセッサモジュールが、動作中であると判定される。特定されたプロセッサモジュールが動作中であると判定された場合(ステップS4:YES)、ステップS5へ進む。一方、特定されたプロセッサモジュールが動作中でないと判定された場合(ステップS4:NO)、当該処理が終了する。   Next, the processor control circuit 7 determines whether or not the processor module specified in step S3 is operating (step S4). When “1” is set in the bit corresponding to the specified processor module in the module operation display register 71, it is determined that the processor module is operating. If it is determined that the identified processor module is operating (step S4: YES), the process proceeds to step S5. On the other hand, when it is determined that the identified processor module is not in operation (step S4: NO), the processing ends.

ステップS5では、プロセッサ制御回路7は、ステップS3で特定されたプロセッサモジュールの動作を停止させる。例えば、モジュール動作表示レジスタ71において、上記特定されたプロセッサモジュール(例えば、プロセッサモジュール2)に対応するビットを“1”から“0”に切り替えることでプロセッサモジュールが動作(例えば、サブ処理)を停止させる。   In step S5, the processor control circuit 7 stops the operation of the processor module specified in step S3. For example, in the module operation display register 71, the processor module stops operation (for example, sub-processing) by switching the bit corresponding to the specified processor module (for example, processor module 2) from “1” to “0”. Let

その後、プロセッサ制御回路7は、プロセッサモジュールの復帰処理を行う。この復帰処理では、プロセッサ制御回路7は、発生した割込みイベントに応じた処理(例えば、プロセッサモジュール1によるデータ受信に応じた処理(例えば、メイン処理))の終了を検知した場合、上記ステップS5で停止させたプロセッサモジュールの動作を復帰させる。例えば、モジュール動作表示レジスタ71において、上記停止されたプロセッサモジュール(例えば、プロセッサモジュール2)に対応するビットを“0”から“1”に切り替えることでプロセッサモジュールの動作を復帰させる。なお、発生した割込みイベントに応じた処理が終了すると、発生イベント設定レジスタ72における当該割込みイベントに対応するビットに“0”が設定されることになる。   Thereafter, the processor control circuit 7 performs a return process of the processor module. In this return process, when the processor control circuit 7 detects the end of the process corresponding to the interrupt event that has occurred (for example, the process corresponding to the data reception by the processor module 1 (for example, the main process)), in step S5 described above. The operation of the stopped processor module is restored. For example, in the module operation display register 71, the operation of the processor module is restored by switching the bit corresponding to the stopped processor module (for example, processor module 2) from “0” to “1”. When the process corresponding to the generated interrupt event is completed, “0” is set in the bit corresponding to the interrupt event in the generated event setting register 72.

以上説明したように、実施例1によれば、複数のプロセッサモジュール1,2のうち、割込みイベント発生(例えば、データ受信)に応じて何れかのプロセッサモジュールを優先して動作させることができる。従って、例えば外部機器との通信などの高速性が求められる処理において、迅速に応答を返すことができる。   As described above, according to the first embodiment, one of the plurality of processor modules 1 and 2 can be preferentially operated in response to the occurrence of an interrupt event (for example, data reception). Therefore, for example, in a process that requires high speed such as communication with an external device, a response can be returned quickly.

(実施例2)
次に、図4及び図5を参照して、実施例2の動作について説明する。なお、実施例2において、所定の状況は、ハードウェアによる異常検知である。また、実施例2でも、プロセッサ制御回路7は、実施例1と同一のスペシャルファンクションレジスタを備える。図4は、実施例2におけるスペシャルファンクションレジスタの構成例を示す図である。なお、図4に示すように、実施例2は、実施例1と比べて、停止イベント設定レジスタ及びモジュール動作設定レジスタの設定内容が異なるが、その他の構成は実施例1と同様である。図4の例では、停止イベント設定レジスタ73のb7が“1”に設定されており、異常検知に対応するモジュール動作設定レジスタ74gのb1は、“0”(プロセッサモジュール1が停止)に設定され、このレジスタ74gのb2は、“1”(プロセッサモジュール2が動作)に設定されている。このような設定では、割込みイベントとして“異常検知”( ハードウェアによる異常検知)が発生すると、図3に示すステップS2で、発生した割込みイベントが、プロセッサモジュールを停止させる割込みイベントであると判定される。そして、図3に示すステップS3で、停止させるプロセッサモジュールとして、プロセッサモジュール1が特定され、このプロセッサモジュール1の動作が停止(つまり、異常停止)され、プロセッサモジュール2の動作が行われる。この動作において、プロセッサモジュール2は、異常判定処理を実行する。
(Example 2)
Next, the operation of the second embodiment will be described with reference to FIGS. In the second embodiment, the predetermined situation is hardware abnormality detection. Also in the second embodiment, the processor control circuit 7 includes the same special function register as that of the first embodiment. FIG. 4 is a diagram illustrating a configuration example of the special function register according to the second embodiment. As shown in FIG. 4, the second embodiment is different from the first embodiment in the setting contents of the stop event setting register and the module operation setting register, but the other configurations are the same as those of the first embodiment. In the example of FIG. 4, b7 of the stop event setting register 73 is set to “1”, and b1 of the module operation setting register 74g corresponding to the abnormality detection is set to “0” (the processor module 1 is stopped). B2 of the register 74g is set to "1" (the processor module 2 operates). In such a setting, when “abnormality detection” (abnormality detection by hardware) occurs as an interrupt event, it is determined in step S2 shown in FIG. 3 that the generated interrupt event is an interrupt event that stops the processor module. The Then, in step S3 shown in FIG. 3, the processor module 1 is specified as the processor module to be stopped, the operation of the processor module 1 is stopped (that is, abnormally stopped), and the operation of the processor module 2 is performed. In this operation, the processor module 2 executes an abnormality determination process.

図5は、実施例2におけるプロセッサモジュール2により行われる異常判定処理の一例を示すフローチャートである。図5に示す処理が開始されると、プロセッサモジュール2は、異常検知された異常の原因を確認し(ステップS11)、異常検知された異常が、問題となる異常(予め設定)であるか否かを判定する(ステップS12)。ここで、問題となる異常は、通常の運用時に発生し得ない異常であり、ICチップCを停止する必要がある異常である。例えば、問題となる異常として、高電圧検知異常、高温検知異常、低温検知異常、光検知異常などが挙げられる。高電圧検知異常は、電圧センサーにより閾値(所定電圧)以上の高電圧が検知された異常をいう。高温検知異常は、温度センサーにより閾値(所定温度)以上の高温度が検知された異常をいう。低温検知異常は、温度センサーにより閾値以下の低温度が検知された異常をいう。光検知異常は、光センサーにより閾値(所定ルクス)以上の光が検知された異常(例えば、レーザ攻撃による)をいう。一方、問題とならない異常は、電気的なノイズや接触部分の問題など、通常の運用時に発生し得る異常である。例えば、問題とならない異常として、電源に対するグリッジ異常、低電圧検知異常、高周波数検知異常などが挙げられる。   FIG. 5 is a flowchart illustrating an example of an abnormality determination process performed by the processor module 2 according to the second embodiment. When the processing shown in FIG. 5 is started, the processor module 2 confirms the cause of the detected abnormality (step S11), and whether the detected abnormality is a problem abnormality (preset). Is determined (step S12). Here, the abnormality that is a problem is an abnormality that cannot occur during normal operation, and is an abnormality that requires the IC chip C to be stopped. For example, examples of abnormalities that cause problems include high voltage detection abnormalities, high temperature detection abnormalities, low temperature detection abnormalities, and light detection abnormalities. The high voltage detection abnormality refers to an abnormality in which a high voltage equal to or higher than a threshold value (predetermined voltage) is detected by the voltage sensor. The high temperature detection abnormality is an abnormality in which a high temperature equal to or higher than a threshold (predetermined temperature) is detected by the temperature sensor. The low temperature detection abnormality is an abnormality in which a low temperature below a threshold is detected by a temperature sensor. The light detection abnormality refers to an abnormality (for example, due to a laser attack) in which light of a threshold value (predetermined lux) or more is detected by the optical sensor. On the other hand, an abnormality that does not cause a problem is an abnormality that may occur during normal operation, such as an electrical noise or a problem of a contact portion. For example, abnormalities that do not cause problems include glitch abnormalities for power supplies, low voltage detection abnormalities, high frequency detection abnormalities, and the like.

プロセッサモジュール2は、異常検知された異常が、問題となる異常であると判定した場合(ステップS12:YES)、全ての処理を停止する(ステップS13)。一方、プロセッサモジュール2は、異常検知された異常が、問題となる異常でないと判定した場合(ステップS12:NO)、異常検知カウンタを確認する(ステップS14)。ここで、異常検知カウンタは、問題とならない異常の検知回数をカウントするカウンタであり、例えばNVM5に設けられる。次いで、プロセッサモジュール2は、異常検知カウンタの値が、予め設定された上限値であるか否かを判定する(ステップS15)。そして、異常検知カウンタの値が上限値である場合(ステップS15:YES)、プロセッサモジュール2は、全ての処理を停止する(ステップS13)。一方、異常検知カウンタの値が上限値でない場合(ステップS15:NO)、プロセッサモジュール2は、異常検知カウンタを更新(つまり、異常検知カウンタの値を1インクリメント)する(ステップS16)。次いで、プロセッサモジュール2(つまり、停止されたプロセッサモジュール1以外のプロセッサモジュール2)は、停止されたプロセッサモジュール1の動作を復帰させる(ステップS17)。例えば、プロセッサモジュール2は、プロセッサ制御回路7に指令を与え、モジュール動作表示レジスタ71においてプロセッサモジュール1に対応するビットを“0”から“1”に切り替えることでプロセッサモジュール1の動作を復帰させる。   When the processor module 2 determines that the detected abnormality is a problem abnormality (step S12: YES), the processor module 2 stops all processing (step S13). On the other hand, if the processor module 2 determines that the detected abnormality is not a problem abnormality (step S12: NO), the processor module 2 checks the abnormality detection counter (step S14). Here, the abnormality detection counter is a counter that counts the number of abnormal detections that do not cause a problem. For example, the abnormality detection counter is provided in the NVM 5. Next, the processor module 2 determines whether or not the value of the abnormality detection counter is a preset upper limit value (step S15). If the value of the abnormality detection counter is the upper limit value (step S15: YES), the processor module 2 stops all processing (step S13). On the other hand, when the value of the abnormality detection counter is not the upper limit value (step S15: NO), the processor module 2 updates the abnormality detection counter (that is, increments the value of the abnormality detection counter by 1) (step S16). Next, the processor module 2 (that is, the processor module 2 other than the stopped processor module 1) restores the operation of the stopped processor module 1 (step S17). For example, the processor module 2 gives a command to the processor control circuit 7 and switches the bit corresponding to the processor module 1 from “0” to “1” in the module operation display register 71 to restore the operation of the processor module 1.

以上説明したように、実施例2によれば、複数のプロセッサモジュール1,2のうち、異常検知の割込みイベント発生に応じて何れかのプロセッサモジュールを優先して動作させることができる。従って、異常検知時にメイン処理を進めることで不正な状況が広がることを防止することができる。   As described above, according to the second embodiment, one of the plurality of processor modules 1 and 2 can be preferentially operated in response to the occurrence of an abnormality detection interrupt event. Therefore, it is possible to prevent an unauthorized situation from spreading by proceeding with the main process when an abnormality is detected.

(実施例3)
次に、図6を参照して、実施例3の動作について説明する。なお、実施例3において、所定の状況は、ソフトウェアによる異常検知である。また、実施例3でも、プロセッサ制御回路7は、実施例2と同一のスペシャルファンクションレジスタを備えてもよいが、発生イベント設定レジスタ72、停止イベント設定レジスタ73、及びモジュール動作設定レジスタ74a〜74hは使用されない。図6は、実施例3におけるプロセッサモジュール2により行われる異常判定処理の一例を示すフローチャートである。図6に示す異常検知処理は、例えばプロセッサモジュール2が異常検知プログラムにしたがって異常を検知(つまり、ソフトウェアによる異常検知が発生)した場合に開始される。なお、ソフトウェアによる異常検知方法として、CRC(Cyclic Redundancy Check)チェック、RAMの値チェック、NVMの値チェック、プログラム処理値チェックなどが挙げられる。CRCチェックでは、予め保持された値と、CRC演算により算出された値とが異なる場合に異常検知される。RAMの値チェックでは、RAM3に記憶された値と期待値とが異なる場合に異常検知される。NVMの値チェックでは、NVM5に記憶された値と期待値とが異なる場合に異常検知される。プログラム処理値チェックでは、プログラムの処理の流れから得られる値と期待値とが異なる場合に異常検知される。
(Example 3)
Next, the operation of the third embodiment will be described with reference to FIG. In the third embodiment, the predetermined situation is abnormality detection by software. In the third embodiment, the processor control circuit 7 may include the same special function registers as those in the second embodiment. However, the generation event setting register 72, the stop event setting register 73, and the module operation setting registers 74a to 74h Not used. FIG. 6 is a flowchart illustrating an example of the abnormality determination process performed by the processor module 2 according to the third embodiment. The abnormality detection process shown in FIG. 6 is started when, for example, the processor module 2 detects an abnormality according to the abnormality detection program (that is, abnormality detection by software occurs). As an abnormality detection method by software, CRC (Cyclic Redundancy Check) check, RAM value check, NVM value check, program processing value check, and the like can be cited. In the CRC check, an abnormality is detected when a value held in advance is different from a value calculated by CRC calculation. In the RAM value check, when the value stored in the RAM 3 is different from the expected value, an abnormality is detected. In the NVM value check, an abnormality is detected when the value stored in the NVM 5 is different from the expected value. In the program processing value check, an abnormality is detected when a value obtained from the program processing flow is different from an expected value.

図6に示す処理が開始されると、プロセッサモジュール2は、プロセッサモジュール1の動作を停止させる(ステップS21)。例えば、プロセッサモジュール2は、プロセッサ制御回路7に指令を与え、モジュール動作表示レジスタ71においてプロセッサモジュール1に対応するビットを“1”から“0”に切り替えることでプロセッサモジュール1の動作を停止させる。次いで、プロセッサモジュール2は、異常検知された異常の原因を確認し(ステップS22)、異常検知された異常が、問題となる異常(予め設定)であるか否かを判定する(ステップS23)。ここで、問題となる異常(つまり、通常の運用時に発生し得ない異常)として、例えば、RAMの値チェックによる異常、プログラム処理値チェックによる異常などが挙げられる。一方、問題とならない異常(つまり、通常の運用時に発生し得る異常)として、例えば、NVMの値チェックによる異常などが挙げられる。   When the process shown in FIG. 6 is started, the processor module 2 stops the operation of the processor module 1 (step S21). For example, the processor module 2 gives a command to the processor control circuit 7 and stops the operation of the processor module 1 by switching the bit corresponding to the processor module 1 from “1” to “0” in the module operation display register 71. Next, the processor module 2 confirms the cause of the abnormality detected (step S22), and determines whether or not the abnormality detected is a problem abnormality (preset) (step S23). Here, examples of abnormalities that cause problems (that is, abnormalities that cannot occur during normal operation) include abnormalities caused by a RAM value check, abnormalities caused by a program processing value check, and the like. On the other hand, as an abnormality that does not cause a problem (that is, an abnormality that may occur during normal operation), for example, an abnormality caused by an NVM value check may be cited.

プロセッサモジュール2は、異常検知された異常が、問題となる異常であると判定した場合(ステップS23:YES)、全ての処理を停止する(ステップS24)。一方、プロセッサモジュール2は、異常検知された異常が、問題となる異常でないと判定した場合(ステップS23:NO)、異常検知カウンタを確認する(ステップS25)。なお、ステップS26以降の処理は、ステップS15以降の処理と同様である。   If the processor module 2 determines that the detected abnormality is a problem abnormality (step S23: YES), the processor module 2 stops all processing (step S24). On the other hand, if the processor module 2 determines that the detected abnormality is not a problem abnormality (step S23: NO), the processor module 2 checks the abnormality detection counter (step S25). The processing after step S26 is the same as the processing after step S15.

以上説明したように、実施例3によれば、複数のプロセッサモジュール1,2のうち、ソフトウェアによる異常検知に応じて何れかのプロセッサモジュールを優先して動作させることができる。従って、異常検知時にメイン処理を進めることで不正な状況が広がることを防止することができる。   As described above, according to the third embodiment, any one of the plurality of processor modules 1 and 2 can be preferentially operated in accordance with abnormality detection by software. Therefore, it is possible to prevent an unauthorized situation from spreading by proceeding with the main process when an abnormality is detected.

(実施例4)
次に、図7及び図8を参照して、実施例4の動作について説明する。なお、実施例4において、所定の状況は、プログラムコードまたはデータのキャッシュミスである。また、実施例4でも、プロセッサ制御回路7は、スペシャルファンクションレジスタを備える。図7は、実施例4におけるスペシャルファンクションレジスタの構成例を示す図である。図7の例では、スペシャルファンクションレジスタとして、優先イベント設定レジスタ75、及びモジュール優先順位設定レジスタ76,77を示している。なお、実施例4でも、プロセッサ制御回路7は、実施例1と同一のスペシャルファンクションレジスタを備えてもよいが、発生イベント設定レジスタ72、停止イベント設定レジスタ73、及びモジュール動作設定レジスタ74a〜74hは使用されない。
Example 4
Next, the operation of the fourth embodiment will be described with reference to FIGS. In the fourth embodiment, the predetermined situation is a program code or data cache miss. Also in the fourth embodiment, the processor control circuit 7 includes a special function register. FIG. 7 is a diagram illustrating a configuration example of the special function register according to the fourth embodiment. In the example of FIG. 7, a priority event setting register 75 and module priority order setting registers 76 and 77 are shown as special function registers. In the fourth embodiment, the processor control circuit 7 may include the same special function registers as those in the first embodiment, but the occurrence event setting register 72, the stop event setting register 73, and the module operation setting registers 74a to 74h Not used.

優先イベント設定レジスタ75は、プロセッサモジュール1またはプロセッサモジュール2に優先処理させる割込みイベントが設定(ソフト的に設定)されるレジスタである。この設定は、例えばICカードの利用者からI/O回路6を介して入力される指示に従ってプロセッサ制御回路7により行われる。例えば、図7に示すように、レジスタ75のb1が“1”に設定されている場合、優先処理させる割込みイベントはデータ受信となる。   The priority event setting register 75 is a register in which an interrupt event to be preferentially processed by the processor module 1 or the processor module 2 is set (software setting). This setting is performed by the processor control circuit 7 in accordance with an instruction input via the I / O circuit 6 from a user of the IC card, for example. For example, as shown in FIG. 7, when b1 of the register 75 is set to “1”, the interrupt event to be preferentially processed is data reception.

モジュール優先順位設定レジスタ76は、優先イベント設定レジスタ75で設定された割込みイベントの発生時におけるプロセッサモジュール1の優先順位が設定されるレジスタであり、モジュール優先順位設定レジスタ77は、優先イベント設定レジスタ75で設定された割込みイベントの発生時におけるプロセッサモジュール2の優先順位が設定されるレジスタである。例えば、このようなレジスタにおける値の小さい方が優先順位が高い。優先順位の低いプロセッサモジュールは、キャッシュミスの発生時に停止させるプロセッサモジュールである。図7の例では、モジュール優先順位設定レジスタ76に設定された値“00”の方が、モジュール優先順位設定レジスタ77に設定された値“01”よりも小さいため、プロセッサモジュール2がキャッシュミスの発生時に停止される。なお、優先順位を設定する代わりに、キャッシュミスの発生時に停止させるプロセッサモジュールを設定するように構成してもよい。   The module priority setting register 76 is a register for setting the priority of the processor module 1 when an interrupt event set by the priority event setting register 75 occurs. The module priority setting register 77 is a priority event setting register 75. This is a register in which the priority order of the processor module 2 is set when the interrupt event set in (1) occurs. For example, a smaller value in such a register has a higher priority. A processor module with a low priority is a processor module that is stopped when a cache miss occurs. In the example of FIG. 7, since the value “00” set in the module priority setting register 76 is smaller than the value “01” set in the module priority setting register 77, the processor module 2 has a cache miss. Stopped when it occurs. Instead of setting the priority order, a processor module to be stopped when a cache miss occurs may be set.

実施例4におけるプロセッサ制御回路7は、キャッシュミスが発生したと判定した場合、モジュール優先順位設定レジスタ76で優先順位が低く設定された(つまり、キャッシュミスの発生時に停止させるとして設定された)プロセッサモジュールの動作を停止させ、当該停止されるプロセッサモジュール以外のプロセッサモジュールの動作であって、RAM3等からバス8を介してプログラムコードまたはデータを取得させるキャッシュ読込み動作(つまり、データ転送)を行わせる。これにより、バス競合時に優先順位が低く設定された方のプロセッサモジュールの動作を停止させ、他方のプロセッサモジュールの動作を優先させることができる。   When the processor control circuit 7 according to the fourth embodiment determines that a cache miss has occurred, the processor whose priority order is set low in the module priority order setting register 76 (that is, set to be stopped when a cache miss occurs). The operation of the module is stopped and the operation of the processor module other than the processor module to be stopped is performed, and a cache read operation (that is, data transfer) for acquiring the program code or data from the RAM 3 or the like via the bus 8 is performed. . This makes it possible to stop the operation of the processor module with the lower priority set at the time of bus contention and give priority to the operation of the other processor module.

図8(A)は、プロセッサモジュール1にてキャッシュミスが発生しキャッシュ読込み動作を行なっている際に、優先順位が低く設定されたプロセッサモジュール2でもキャッシュミス(データ受信の処理実行中にキャッシュミス)が発生した場合の動作を示すタイミングチャートである。図8(A)の例では、プロセッサモジュール1のCPUコア11と、プロセッサモジュール2のCPUコア21とが共に動作しているときに、まず、プロセッサモジュール1にてキャッシュミスが発生すると、CPUコア11は動作を停止し、キャッシュ12(キャッシュメモリ制御部)は、キャッシュ読込み(つまり、データ転送)動作を開始する。つまり、キャッシュ12によるキャッシュ読込み動作中、CPUコア11は動作を停止しているがキャッシュ12は動作しているので、プロセッサモジュール1としては動作中ということになる。そして、キャッシュ12によるキャッシュ読込み動作中に、プロセッサモジュール2でもキャッシュミスが発生すると、CPUコア21は動作を停止し、キャッシュ22(キャッシュメモリ制御部)はキャッシュ読込み動作を待機する。つまり、キャッシュ12によるキャッシュ読込み動作中、CPUコア21及びキャッシュ22はともに動作を停止するので、プロセッサモジュール2としては動作停止中になる(つまり、プロセッサモジュール2の動作を停止させる)。そして、キャッシュ12によるキャッシュ読込み動作が終了するとCPUコア11は動作を再開する。このとき、キャッシュ22は、キャッシュ読込み動作を開始する(つまり、プロセッサモジュール2の動作を復帰させる)。そして、キャッシュ22によるキャッシュ読込み動作が終了するとCPUコア21は動作を再開する。   FIG. 8A shows that when a cache miss occurs in the processor module 1 and a cache read operation is performed, even in the processor module 2 set with a low priority, a cache miss (a cache miss during data reception processing execution) is performed. It is a timing chart which shows the operation | movement when) occurs. In the example of FIG. 8A, when the CPU core 11 of the processor module 1 and the CPU core 21 of the processor module 2 are operating together, first, when a cache miss occurs in the processor module 1, the CPU core 11 stops the operation, and the cache 12 (cache memory control unit) starts a cache read (that is, data transfer) operation. That is, during the cache read operation by the cache 12, the CPU core 11 is not operating, but the cache 12 is operating, so the processor module 1 is operating. If a cache miss occurs in the processor module 2 during the cache read operation by the cache 12, the CPU core 21 stops operating and the cache 22 (cache memory control unit) waits for the cache read operation. That is, during the cache read operation by the cache 12, both the CPU core 21 and the cache 22 stop operating, so that the processor module 2 is stopped (that is, the operation of the processor module 2 is stopped). Then, when the cache read operation by the cache 12 is completed, the CPU core 11 resumes the operation. At this time, the cache 22 starts a cache read operation (that is, restores the operation of the processor module 2). Then, when the cache read operation by the cache 22 is completed, the CPU core 21 resumes the operation.

一方、図8(B)は、優先順位が低く設定されたプロセッサモジュール2にてキャッシュミスが発生しキャッシュ読込み動作を行なっている際に、プロセッサモジュール1でもキャッシュミス(データ受信の処理実行中にキャッシュミス)が発生した場合の動作を示すタイミングチャートである。図8(B)の例では、プロセッサモジュール1のCPUコア11と、プロセッサモジュール2のCPUコア21とが共に動作しているときに、まず、プロセッサモジュール2にてキャッシュミスが発生すると、CPUコア21は動作を停止し、キャッシュ22(キャッシュメモリ制御部)は、キャッシュ読込み動作を開始する。そして、キャッシュ22によるキャッシュ読込み動作中に、プロセッサモジュール1でもキャッシュミスが発生すると、キャッシュ22はキャッシュ読込み動作を一時停止し(つまり、プロセッサモジュール2の動作を停止させる)、且つ、キャッシュ12はキャッシュ読込み動作を開始する。そして、キャッシュ12によるキャッシュ読込み動作が終了するとCPUコア11は動作を再開する。このとき、キャッシュ22は、キャッシュ読込み動作を再開する(つまり、プロセッサモジュール2の動作を復帰させる)。そして、キャッシュ22によるキャッシュ読込み動作が終了するとCPUコア21は動作を再開する。   On the other hand, FIG. 8B shows that when a cache miss occurs in the processor module 2 set with a low priority and a cache read operation is performed, the processor module 1 also performs a cache miss (during execution of data reception processing). 6 is a timing chart showing an operation when a (cache miss) occurs. In the example of FIG. 8B, when the CPU core 11 of the processor module 1 and the CPU core 21 of the processor module 2 are operating together, first, when a cache miss occurs in the processor module 2, the CPU core 21 stops the operation, and the cache 22 (cache memory control unit) starts a cache read operation. If a cache miss occurs in the processor module 1 during the cache read operation by the cache 22, the cache 22 temporarily stops the cache read operation (that is, stops the operation of the processor module 2), and the cache 12 Start reading operation. Then, when the cache read operation by the cache 12 is completed, the CPU core 11 resumes the operation. At this time, the cache 22 resumes the cache read operation (that is, restores the operation of the processor module 2). Then, when the cache read operation by the cache 22 is completed, the CPU core 21 resumes the operation.

以上説明したように、実施例4によれば、複数のプロセッサモジュール1,2のうち、キャッシュミスの発生に応じて何れかのプロセッサモジュールを優先して動作させることができる。従って、例えば外部機器との通信などの高速性が求められる処理において、迅速に応答を返すことができる。   As described above, according to the fourth embodiment, one of the plurality of processor modules 1 and 2 can be preferentially operated according to the occurrence of a cache miss. Therefore, for example, in a process that requires high speed such as communication with an external device, a response can be returned quickly.

なお、上記実施形態においては、電子情報記録媒体としてICチップCを例にとって説明したが、ICチップC以外の例えば組み込み型のマイクロコンピュータに対して本発明を適用してもよい。   In the above embodiment, the IC chip C has been described as an example of the electronic information recording medium. However, the present invention may be applied to, for example, an embedded microcomputer other than the IC chip C.

1,2 プロセッサモジュール
3 RAM
4 ROM
5 NVM
6 I/O回路
7 プロセッサ制御回路
8 バス
11,21 CPUコア
12,22 キャッシュ
C ICチップ
1, 2 Processor module 3 RAM
4 ROM
5 NVM
6 I / O circuit 7 Processor control circuit 8 Buses 11 and 21 CPU cores 12 and 22 Cache C IC chip

Claims (3)

プログラムコードまたはデータを記憶する記憶手段と、前記記憶手段からバスを介して取得した前記プログラムコードまたはデータの一部をキャッシュする複数のプロセッサモジュールであって役割に応じた異なる処理を実行する複数のプロセッサモジュールとを備える電子情報記録媒体であって、
前記複数のプロセッサモジュールのうち、前記プログラムコードまたはデータのキャッシュミス発生時に停止させる前記プロセッサモジュールを予め設定する設定手段と、
前記キャッシュミスが発生したか否かを判定する判定手段と、
前記判定手段により、前記設定手段により予め設定された前記プロセッサモジュールを含む複数のプロセッサモジュールにおいて前記キャッシュミスが発生したと判定された場合、前記設定手段により予め設定された前記プロセッサモジュールの動作を停止させ、当該停止される前記プロセッサモジュール以外の前記プロセッサモジュールの動作であって、前記記憶手段から、当該停止される前記プロセッサモジュール以外の前記プロセッサモジュールにおける前記キャッシュミスの対象となった前記プログラムコードまたはデータを取得する動作を行わせる制御手段と、
を備えることを特徴とする電子情報記録媒体。
A storage unit that stores program code or data, and a plurality of processor modules that cache a part of the program code or data acquired from the storage unit via a bus, and that perform different processes according to roles An electronic information recording medium comprising a processor module,
Setting means for presetting the processor module to be stopped when a cache miss of the program code or data occurs among the plurality of processor modules;
Determining means for determining whether or not the cache miss has occurred;
When the determination unit determines that the cache miss has occurred in a plurality of processor modules including the processor module preset by the setting unit, the operation of the processor module preset by the setting unit is stopped. An operation of the processor module other than the processor module to be stopped, the program code subject to the cache miss in the processor module other than the processor module to be stopped from the storage unit, or Control means for performing an operation of acquiring data ;
An electronic information recording medium comprising:
プログラムコードまたはデータを記憶する記憶手段と、前記記憶手段からバスを介して取得した前記プログラムコードまたはデータの一部をキャッシュする複数のプロセッサモジュールであって役割に応じた異なる処理を実行する複数のプロセッサモジュールとを備える電子情報記録媒体における前記プロセッサモジュールの動作制御方法であって、
前記複数のプロセッサモジュールのうち、前記プログラムコードまたはデータのキャッシュミス発生時に停止させる前記プロセッサモジュールを予め設定する設定ステップと、
前記キャッシュミスが発生したか否かを判定する判定ステップと、
前記設定ステップで予め設定された前記プロセッサモジュールを含む複数のプロセッサモジュールにおいて前記キャッシュミスが発生したと前記判定ステップで判定された場合、前記設定ステップで予め設定された前記プロセッサモジュールの動作を停止させ、当該停止される前記プロセッサモジュール以外の前記プロセッサモジュールの動作であって、前記記憶手段から、当該停止される前記プロセッサモジュール以外の前記プロセッサモジュールにおける前記キャッシュミスの対象となった前記プログラムコードまたはデータを取得する動作を行わせるステップと、
を含むことを特徴とするプロセッサモジュールの動作制御方法。
A storage unit that stores program code or data, and a plurality of processor modules that cache a part of the program code or data acquired from the storage unit via a bus, and that perform different processes according to roles An operation control method for the processor module in an electronic information recording medium comprising a processor module,
A setting step for presetting the processor module to be stopped when a cache miss of the program code or data occurs among the plurality of processor modules;
A determination step of determining whether or not the cache miss has occurred;
When the determination step determines that the cache miss has occurred in a plurality of processor modules including the processor module preset in the setting step, the operation of the processor module preset in the setting step is stopped. The operation of the processor module other than the processor module to be stopped, and the program code or data subject to the cache miss in the processor module other than the processor module to be stopped from the storage unit A step of performing an operation of acquiring
An operation control method for a processor module, comprising:
プログラムコードまたはデータを記憶する記憶手段と、前記記憶手段からバスを介して取得した前記プログラムコードまたはデータの一部をキャッシュする複数のプロセッサモジュールであって役割に応じた異なる処理を実行する複数のプロセッサモジュールとを備える電子情報記録媒体におけるコンピュータに、
前記複数のプロセッサモジュールのうち、前記プログラムコードまたはデータのキャッシュミス発生時に停止させる前記プロセッサモジュールを予め設定する設定ステップと、
前記キャッシュミスが発生したか否かを判定する判定ステップと、
前記設定ステップで予め設定された前記プロセッサモジュールを含む複数のプロセッサモジュールにおいて前記キャッシュミスが発生したと前記判定ステップで判定された場合、前記設定ステップで予め設定された前記プロセッサモジュールの動作を停止させ、当該停止される前記プロセッサモジュール以外の前記プロセッサモジュールの動作であって、前記記憶手段から、当該停止される前記プロセッサモジュール以外の前記プロセッサモジュールにおける前記キャッシュミスの対象となった前記プログラムコードまたはデータを取得する動作を行わせるステップと、
を実行させることを特徴とするプロセッサモジュールの動作制御プログラム。
A storage unit that stores program code or data, and a plurality of processor modules that cache a part of the program code or data acquired from the storage unit via a bus, and that perform different processes according to roles A computer in an electronic information recording medium comprising a processor module;
A setting step for presetting the processor module to be stopped when a cache miss of the program code or data occurs among the plurality of processor modules;
A determination step of determining whether or not the cache miss has occurred;
When the determination step determines that the cache miss has occurred in a plurality of processor modules including the processor module preset in the setting step, the operation of the processor module preset in the setting step is stopped. The operation of the processor module other than the processor module to be stopped, and the program code or data subject to the cache miss in the processor module other than the processor module to be stopped from the storage unit A step of performing an operation of acquiring
An operation control program for a processor module, characterized in that
JP2014163414A 2014-08-11 2014-08-11 Electronic information recording medium, processor module operation control method, and processor module operation control program Active JP6398449B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014163414A JP6398449B2 (en) 2014-08-11 2014-08-11 Electronic information recording medium, processor module operation control method, and processor module operation control program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014163414A JP6398449B2 (en) 2014-08-11 2014-08-11 Electronic information recording medium, processor module operation control method, and processor module operation control program

Publications (2)

Publication Number Publication Date
JP2016038829A JP2016038829A (en) 2016-03-22
JP6398449B2 true JP6398449B2 (en) 2018-10-03

Family

ID=55529814

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014163414A Active JP6398449B2 (en) 2014-08-11 2014-08-11 Electronic information recording medium, processor module operation control method, and processor module operation control program

Country Status (1)

Country Link
JP (1) JP6398449B2 (en)

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0429733B1 (en) * 1989-11-17 1999-04-28 Texas Instruments Incorporated Multiprocessor with crossbar between processors and memories
JPH0424838A (en) * 1990-05-21 1992-01-28 Fuji Xerox Co Ltd Fault control system for multiprocessor
JP2825983B2 (en) * 1991-03-08 1998-11-18 富士通株式会社 Information processing device
JPH0962500A (en) * 1995-08-29 1997-03-07 Nec Corp Dynamic patching method and dynamic patching system
JPH1079000A (en) * 1996-09-03 1998-03-24 Hitachi Ltd Program writable ic card
JP2001134546A (en) * 1999-11-05 2001-05-18 Nec Corp Fault processing method of multiprocessor system
FR2914459B1 (en) * 2007-03-30 2009-07-03 Oberthur Card Syst Sa MICROPROCESSOR CARD
JP4926009B2 (en) * 2007-11-21 2012-05-09 三菱電機株式会社 Fault processing system for information processing apparatus

Also Published As

Publication number Publication date
JP2016038829A (en) 2016-03-22

Similar Documents

Publication Publication Date Title
US10509568B2 (en) Efficient secure boot carried out in information processing apparatus
US20180101304A1 (en) Configuration control system and configuration control method
US20170289193A1 (en) Secure smart terminal and an information processing method
EP2874091A1 (en) Partition-based apparatus and method for securing bios in a trusted computing system during execution
EP2874092A1 (en) Recurrent BIOS verification with embedded encrypted hash
US10223117B2 (en) Execution flow protection in microcontrollers
JP2009501983A (en) Fault detection due to long perturbations
CN114721493B (en) Chip starting method, computer equipment and readable storage medium
US9779242B2 (en) Programmable secure bios mechanism in a trusted computing system
CN113467981A (en) Exception handling method and device
US9779243B2 (en) Fuse-enabled secure BIOS mechanism in a trusted computing system
JP6398449B2 (en) Electronic information recording medium, processor module operation control method, and processor module operation control program
JP5561791B2 (en) Information processing apparatus, information processing method, and information processing program
JP2004503860A (en) Data processing method and apparatus for execution of protected instructions
CN114760276B (en) Method and device for downloading data and secure element
CN108629185B (en) Server trusted platform measurement control system and operation method thereof
CN115576734A (en) Multi-core heterogeneous log storage method and system
JP5754287B2 (en) IC chip, processing method in IC chip, UIM, portable terminal, and processing program for IC chip
JP7085918B2 (en) Information processing equipment and information processing method
JP6379852B2 (en) Electronic information recording medium, processor module processing method, and processor module processing program
US9767288B2 (en) JTAG-based secure BIOS mechanism in a trusted computing system
JP6424633B2 (en) Electronic information storage medium, abnormality detection method, and program
JP4543505B2 (en) Microcomputer control method and abnormality monitoring device
JP6493672B2 (en) Electronic information storage medium, abnormality detection method, abnormality detection program, and IC card
KR20100113810A (en) Method for detection of the program attack

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170627

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180320

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180501

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180627

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20180807

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180820

R150 Certificate of patent or registration of utility model

Ref document number: 6398449

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150