JP2014147010A - Semiconductor device - Google Patents

Semiconductor device Download PDF

Info

Publication number
JP2014147010A
JP2014147010A JP2013015226A JP2013015226A JP2014147010A JP 2014147010 A JP2014147010 A JP 2014147010A JP 2013015226 A JP2013015226 A JP 2013015226A JP 2013015226 A JP2013015226 A JP 2013015226A JP 2014147010 A JP2014147010 A JP 2014147010A
Authority
JP
Japan
Prior art keywords
coprocessor
control circuit
circuit
memory
arithmetic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2013015226A
Other languages
Japanese (ja)
Inventor
Yusuke Suto
祐介 須藤
Kazuki Watanabe
一希 渡邊
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 JP2013015226A priority Critical patent/JP2014147010A/en
Publication of JP2014147010A publication Critical patent/JP2014147010A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To prevent deterioration in security performance in a semiconductor device including a CPU and a coprocessor even when low power consumption is achieved by causing the CPU and the coprocessor to operate exclusively.SOLUTION: A semiconductor device comprises a CPU, a timer for generating a timer interrupt and a coprocessor. The coprocessor includes a computing unit, an arithmetic control circuit, a security circuit for protecting input/output data of the computing unit against attack from outside and a stop/start control circuit. When the timer interrupt is generated during execution of arithmetic processing by the coprocessor, the stop/start control circuit stops operations of the computing unit and the arithmetic control circuit while continuing an operation of the security circuit.

Description

本発明は、セキュリティ性能の高い半導体装置に関し、特に低消費電力化した場合にもセキュリティ性能を低下させないセキュアマイコンに好適に利用できるものである。   The present invention relates to a semiconductor device having high security performance, and can be suitably used for a secure microcomputer that does not deteriorate security performance even when power consumption is reduced.

非接触通信機能を有するセキュアマイコンは、通信性能向上のため低消費電力モードにより動作させる必要がある。電池を搭載しない非接触型IC(Integrated Circuit)カードでは、通信のための電波の搬送波(キャリア)を検波して動作用の電源を生成しているため、通信用の電力と演算処理用の電力の和が生成した電源の電力を超えることができない。このため、演算処理用の電力の増加が、通信用に使用可能な電力を制限することとなり、通信距離が短縮されるなどの弊害を生じさせるからである。このようなICカードに搭載されるセキュアマイコンには、CPU(Central Processing Unit)に加えてコプロセッサが内蔵される場合が多い。セキュアマイコンで実行される暗号の処理は、特殊な演算を必要とし演算量も多いため、これに適するコプロセッサが内蔵される。セキュアマイコンにおける低消費電力モードとは、例えばCPUとコプロセッサの排他的動作が挙げられる。排他的動作は、消費電力のピーク値を抑えるために有効な手段である。コプロセッサの演算量が多い場合に、CPUをスリープ状態などの動作モードで休止させる。   A secure microcomputer having a non-contact communication function needs to be operated in a low power consumption mode in order to improve communication performance. A non-contact IC (Integrated Circuit) card without a battery detects the carrier wave of the radio wave for communication and generates an operating power supply. The sum of the power of the generated power cannot be exceeded. For this reason, the increase in power for arithmetic processing restricts the power that can be used for communication, which causes adverse effects such as shortening the communication distance. In many cases, a secure microcomputer mounted on such an IC card incorporates a coprocessor in addition to a CPU (Central Processing Unit). The cryptographic process executed by the secure microcomputer requires a special calculation and requires a large amount of calculation, and therefore a coprocessor suitable for this is incorporated. The low power consumption mode in the secure microcomputer is, for example, exclusive operation of the CPU and the coprocessor. The exclusive operation is an effective means for suppressing the peak value of power consumption. When the calculation amount of the coprocessor is large, the CPU is suspended in an operation mode such as a sleep state.

特許文献1には、CPUとコプロセッサを内蔵したICカードにおいて、コプロセッサの演算処理中に、それを中断してCPUの処理を実行する場合に、コプロセッサへのクロックの供給を停止することによって、コプロセッサの動作を停止させる技術が開示されている。   Patent Document 1 discloses that in an IC card incorporating a CPU and a coprocessor, during the coprocessor operation processing, when the CPU processing is interrupted and the CPU processing is stopped, the clock supply to the coprocessor is stopped. Discloses a technique for stopping the operation of the coprocessor.

特許文献2には、CPUなどのデータ処理部に対する機密性が要求される機密データについて、機密データを乱数によって暗号化して保護する技術が開示されている。   Patent Document 2 discloses a technology for protecting confidential data that requires confidentiality with respect to a data processing unit such as a CPU by encrypting the confidential data with a random number.

特開2005−222194号公報JP 2005-222194 A 特開2011−175464号公報JP 2011-175464 A

特許文献1及び2について本発明者が検討した結果、以下のような新たな課題があることがわかった。   As a result of examination of Patent Documents 1 and 2 by the present inventors, it has been found that there are the following new problems.

非接触通信では、リーダライタからのコマンド受信完了から、送信開始までの時間(FWT:Frame Waiting Time)のタイムオーバー計測のため、インターバルタイマ(以下TMRと記す)を常時動作させる必要がある。コプロセッサ動作中にTMR割り込みが発生すると、割り込み処理のためにCPU動作が必要となる為、CPUとコプロセッサが同時に動作する状態へ遷移してしまうおそれがある。CPUとコプロセッサが同時に動作してしまうと、消費電力が大きくなり非接触通信の性能に影響を及ぼしてしまう。例えば、上述のように、通信距離が短縮されてしまうおそれがある他、許容される消費電力の大きさによって演算処理用の動作周波数を変動させる技術が採用されている場合には、動作周波数が低下して暗号演算処理に要する時間が長くなるという問題が生じる恐れもある。   In non-contact communication, an interval timer (hereinafter referred to as TMR) needs to be constantly operated in order to measure the time over from the completion of command reception from the reader / writer to the start of transmission (FWT: Frame Waiting Time). If a TMR interrupt occurs during the coprocessor operation, CPU operation is required for interrupt processing, so there is a possibility that the CPU and the coprocessor may shift to a state in which they operate simultaneously. If the CPU and coprocessor operate at the same time, the power consumption increases and the performance of contactless communication is affected. For example, as described above, there is a possibility that the communication distance may be shortened, and in addition, when the technique for changing the operation frequency for arithmetic processing according to the allowable power consumption is employed, the operation frequency is There is a possibility that the problem that the time required for the cryptographic operation processing becomes longer due to the decrease.

CPUとコプロセッサとを備える半導体装置において、CPUとコプロセッサを排他的に動作させて消費電力を低減するためには、コプロセッサ演算時にタイマ(TMR)割り込みが発生した場合に、コプロセッサの演算を一時中断し、コプロセッサの動作を停止する機能が求められる。特許文献1によれば、コプロセッサへのクロックの供給を停止することにより、コプロセッサの演算を中断することができる。   In a semiconductor device including a CPU and a coprocessor, in order to reduce the power consumption by operating the CPU and the coprocessor exclusively, when the timer (TMR) interrupt occurs during the coprocessor operation, the coprocessor operation Is required to temporarily stop the operation of the coprocessor. According to Patent Document 1, the operation of the coprocessor can be interrupted by stopping the supply of the clock to the coprocessor.

しかしながら、その場合には、以下のような新たな課題があることがわかった。   However, in that case, it was found that there are the following new problems.

コプロセッサの演算を中断することにより、機密性の高いデータが、その中断期間全般に渡って同じ回路要素に保持される。クロック供給を停止することにより、消費電力や輻射される電磁波の大きさが変動するので、コプロセッサの演算が中断されたことは、攻撃者によって探知され得る。このため、機密性の高いデータが攻撃によって外部へ読み出される危険性が高まり、セキュリティ性能(耐タンパー性)を低下させてしまう。   By interrupting the coprocessor operation, highly confidential data is retained in the same circuit element throughout the entire interruption period. By stopping the clock supply, the power consumption and the magnitude of the radiated electromagnetic wave fluctuate, so that the operation of the coprocessor can be detected by an attacker. For this reason, the risk that highly confidential data is read out by an attack increases, and the security performance (tamper resistance) decreases.

セキュリティ性能(耐タンパー性)を低下させないために、コプロセッサには、種々のセキュリティ機能を付加することが考えられる。しかしながら、コプロセッサに対するクロックの供給が停止されると、付加されたセキュリティ機能を実現するセキュリティ回路の動作も停止してしまい、十分にセキュリティ性能の低下を抑えることができないという問題があることがわかった。例えば、特許文献2に開示される技術を組合せて、コプロセッサの演算途中のデータを乱数によって暗号化することが、一つの有力な解決手段となると考えられる。しかしながら、この乱数を発生する乱数発生回路へのクロック供給までもが、コプロセッサの演算器などへのクロック供給と共に停止されると、停止された時点で発生した乱数値が、そのクロック停止期間全般に渡って乱数発生回路の出力に保持されることとなる。この乱数値が攻撃者によって観測されると、暗号が復号されて演算途中のデータの値が知られてしまう恐れがあるからである。この他のセキュリティ回路を採用した場合であっても、コプロセッサに対するクロックの供給とともに、セキュリティ回路へのクロックの供給も停止されると、十分にセキュリティ性能の低下を抑えることができない。   In order not to reduce the security performance (tamper resistance), it is conceivable to add various security functions to the coprocessor. However, when the supply of the clock to the coprocessor is stopped, the operation of the security circuit that realizes the added security function is also stopped, and it is found that there is a problem that the deterioration of the security performance cannot be sufficiently suppressed. It was. For example, combining the techniques disclosed in Patent Document 2 and encrypting data in the middle of a coprocessor operation with a random number is considered to be one effective solution. However, if the clock supply to the random number generation circuit that generates this random number is stopped together with the clock supply to the coprocessor arithmetic unit, etc., the random number value generated at the time of the stop is Is held at the output of the random number generation circuit. This is because if this random number value is observed by an attacker, the cipher is decrypted and the value of the data being calculated may be known. Even when other security circuits are employed, if the supply of the clock to the security circuit is stopped together with the supply of the clock to the coprocessor, the deterioration of the security performance cannot be sufficiently suppressed.

このような課題を解決するための手段を以下に説明するが、その他の課題と新規な特徴は、本明細書の記述及び添付図面から明らかになるであろう。   Means for solving such problems will be described below, but other problems and novel features will become apparent from the description of the present specification and the accompanying drawings.

一実施の形態によれば、下記の通りである。   According to one embodiment, it is as follows.

すなわち、CPUと、タイマ割り込みを発生するタイマと、コプロセッサとを備える半導体装置であって、以下のように構成される。コプロセッサは、演算器と、演算制御回路と、演算器の入出力データを外部からの攻撃から保護するセキュリティ回路と、停止起動制御回路とを含んで構成される。コプロセッサによる演算処理の実行中にタイマ割り込みが発生したとき、停止起動制御回路は、セキュリティ回路の動作を継続させたまま、演算器と演算制御回路の動作を停止させる。   That is, a semiconductor device including a CPU, a timer that generates a timer interrupt, and a coprocessor is configured as follows. The coprocessor includes an arithmetic unit, an arithmetic control circuit, a security circuit that protects input / output data of the arithmetic unit from an attack from the outside, and a stop / start control circuit. When a timer interrupt occurs during the execution of arithmetic processing by the coprocessor, the stop activation control circuit stops the operation of the arithmetic unit and the arithmetic control circuit while continuing the operation of the security circuit.

前記一実施の形態によって得られる効果を簡単に説明すれば下記のとおりである。   The effect obtained by the one embodiment will be briefly described as follows.

すなわち、CPUとコプロセッサとを備える半導体装置において、CPUとコプロセッサを排他的に動作させて低消費電力化した場合にも、セキュリティ性能(耐タンパー性)を低下させない。   That is, in a semiconductor device including a CPU and a coprocessor, even when the CPU and the coprocessor are exclusively operated to reduce power consumption, the security performance (tamper resistance) is not deteriorated.

図1は、代表的な実施形態に係る半導体装置の構成を表すブロック図である。FIG. 1 is a block diagram illustrating a configuration of a semiconductor device according to a representative embodiment. 図2は、実施形態1に係る半導体装置の構成を表すブロック図である。FIG. 2 is a block diagram illustrating the configuration of the semiconductor device according to the first embodiment. 図3は、メモリアクセス(リード)時の中断手順を表すタイミングチャートである。FIG. 3 is a timing chart showing an interruption procedure at the time of memory access (read). 図4は、メモリアクセス(ライト)時の中断手順を表すタイミングチャートである。FIG. 4 is a timing chart showing an interruption procedure at the time of memory access (write). 図5は、メモリアクセス(NOP1回)時の中断手順を表すタイミングチャートである。FIG. 5 is a timing chart showing an interruption procedure at the time of memory access (NOP 1 time). 図6は、演算回路を停止させるために、フィードバック付きF/Fを採用した例である。FIG. 6 shows an example in which an F / F with feedback is employed to stop the arithmetic circuit. 図7は、演算回路を停止させるために、ゲーテッドクロック付きF/Fを採用した例である。FIG. 7 shows an example in which an F / F with a gated clock is used to stop the arithmetic circuit. 図8は、実施形態2に係る半導体装置の構成を表すブロック図である。FIG. 8 is a block diagram illustrating a configuration of a semiconductor device according to the second embodiment. 図9は、実施形態3に係る半導体装置の構成を表すブロック図である。FIG. 9 is a block diagram illustrating a configuration of a semiconductor device according to the third embodiment. 図10は、CLK1=CLK2の場合の動作を表すタイミングチャートである。FIG. 10 is a timing chart showing the operation when CLK1 = CLK2. 図11は、CLK2の周波数を下げる場合の動作を表すタイミングチャートである。FIG. 11 is a timing chart showing the operation when the frequency of CLK2 is lowered.

1.実施の形態の概要
先ず、本願において開示される代表的な実施の形態について概要を説明する。代表的な実施の形態についての概要説明で括弧を付して参照する図面中の参照符号はそれが付された構成要素の概念に含まれるものを例示するに過ぎない。
1. First, an outline of a typical embodiment 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〕<コプロセッサの処理中断時にもセキュリティ回路の動作を継続>
CPU(2)と、タイマ割り込みを発生するタイマ(3)と、コプロセッサ(10)とを備える半導体装置(1)であって、以下のように構成される。
[1] <Continue operation of security circuit even when coprocessor processing is interrupted>
A semiconductor device (1) including a CPU (2), a timer (3) that generates a timer interrupt, and a coprocessor (10), and is configured as follows.

前記コプロセッサは、演算器(11)と、前記演算器を制御する演算制御回路(12)と、前記演算器の入出力データを外部からの攻撃から保護するセキュリティ回路(13)と、停止起動制御回路(14)とを含んで構成される。   The coprocessor includes an arithmetic unit (11), an arithmetic control circuit (12) for controlling the arithmetic unit, a security circuit (13) for protecting input / output data of the arithmetic unit from an external attack, And a control circuit (14).

前記コプロセッサによる演算処理の実行中に前記タイマ割り込みが発生したとき、前記停止起動制御回路は、前記セキュリティ回路の動作を継続させたまま、前記演算器と前記演算制御回路の動作を停止させる。   When the timer interrupt occurs during the execution of the arithmetic processing by the coprocessor, the stop activation control circuit stops the operation of the arithmetic unit and the arithmetic control circuit while continuing the operation of the security circuit.

これにより、CPUとコプロセッサとを備える半導体装置において、CPUとコプロセッサを排他的に動作させて低消費電力化した場合に、セキュリティ性能(耐タンパー性)が低下するのを防止することができる。   Thereby, in a semiconductor device including a CPU and a coprocessor, when the CPU and the coprocessor are exclusively operated to reduce power consumption, it is possible to prevent the security performance (tamper resistance) from being lowered. .

〔2〕<セキュリティ回路は乱数発生回路>
項1において、前記セキュリティ回路は、前記演算器の入出力データをマスクするための乱数を発生する、乱数発生回路(15)を含んで構成される。
[2] <Security circuit is a random number generator>
In item 1, the security circuit includes a random number generation circuit (15) for generating a random number for masking input / output data of the arithmetic unit.

これにより、コプロセッサ(10)を演算の途中で停止させた場合であっても、乱数によってマスクされた、演算の途中経過データについて、セキュリティ性能が低下するのを防止することができる。   As a result, even when the coprocessor (10) is stopped in the middle of the calculation, it is possible to prevent the security performance of the intermediate calculation data masked by the random number from being deteriorated.

〔3〕<セキュリティ回路は乱数発生回路+乱数発生状態監視回路>
項2において、前記セキュリティ回路は、さらに、前記乱数発生回路による乱数発生状態を監視する、乱数発生状態監視回路(16)を含んで構成される。
[3] <Security circuit is random number generation circuit + random number generation state monitoring circuit>
In Item 2, the security circuit further includes a random number generation state monitoring circuit (16) for monitoring a random number generation state by the random number generation circuit.

これにより、コプロセッサ(10)が演算を中断した期間中に、動作を継続すべきマスク用の乱数発生回路(15)がその動作を停止した場合であっても、動作が停止したことを検出して適切な防御措置を執ることができ、演算の途中経過データについて、セキュリティ性能が低下するのを防止することができる。   As a result, even when the mask random number generation circuit (15) to continue the operation stops during the period when the coprocessor (10) interrupts the operation, it detects that the operation has stopped. Therefore, it is possible to take appropriate defensive measures, and it is possible to prevent the security performance of the intermediate progress data from being deteriorated.

〔4〕<メモリアクセスの完了を待って中断>
項1において、前記半導体装置は、前記コプロセッサによってアクセス可能なメモリ(7)をさらに備え、前記停止起動制御回路は、前記コプロセッサによる演算処理の実行中の前記タイマ割り込みが発生したとき、前記コプロセッサによる前記メモリへのアクセスが完了した後に、前記演算器と前記演算制御回路の動作を停止させる。
[4] <Wait for completion of memory access>
In item 1, the semiconductor device further includes a memory (7) accessible by the coprocessor, and the stop / start control circuit is configured to generate the timer interrupt during execution of arithmetic processing by the coprocessor. After the access to the memory by the coprocessor is completed, the operation of the arithmetic unit and the arithmetic control circuit is stopped.

これにより、コプロセッサ(10)を演算の途中で停止させるときに、コプロセッサ(10)がメモリアクセスの途中であった場合にも、メモリアクセスのデータは適切に保持され、コプロセッサ(10)が演算を再開したときに正常な動作を継続することができる。   Thus, when the coprocessor (10) is stopped in the middle of the operation, even if the coprocessor (10) is in the middle of the memory access, the memory access data is appropriately held, and the coprocessor (10) Normal operation can be continued when the computation resumes.

〔5〕<メモリアクセスの完了を待つためのアクセスコマンドの監視>
項4において、前記半導体装置は、前記タイマから発行されるタイマ割り込み信号が入力され、前記CPUに対してCPU割り込み信号を出力する割り込み制御回路(6)をさらに備える。
[5] <Monitoring of access command for waiting for completion of memory access>
In Item 4, the semiconductor device further includes an interrupt control circuit (6) that receives a timer interrupt signal issued from the timer and outputs a CPU interrupt signal to the CPU.

前記演算制御回路は前記メモリに対して、前記コプロセッサによる前記メモリへのアクセスに際して、リードコマンドまたはライトコマンドを発行し、アクセスしないときにNOPコマンドを発行可能に構成される。前記停止起動制御回路は、前記コプロセッサによる演算処理の実行中の前記タイマ割り込みが発生したとき、前記NOPコマンドが連続して発行された後に、前記演算器と前記演算制御回路の動作を停止させる。   The arithmetic control circuit is configured to issue a read command or a write command to the memory when the coprocessor accesses the memory, and issue a NOP command when not accessing the memory. The stop / start control circuit stops the operation of the arithmetic unit and the arithmetic control circuit after the NOP command is continuously issued when the timer interrupt occurs during the execution of arithmetic processing by the coprocessor. .

これにより、メモリアクセスの完了を、簡便かつ的確に判定することができる。   Thereby, completion of memory access can be determined easily and accurately.

〔6〕<メモリアクセスの完了を待つための割り込みのマスク>
項5において、前記半導体装置は、前記タイマ割り込みに際して前記タイマから発行されるタイマ割り込み信号が入力され、前記停止起動制御回路から中断許可信号が入力され、前記CPUに対してCPU割り込み信号を出力する割り込み制御回路(6)をさらに備える。
[6] <Mask of interrupt to wait for completion of memory access>
5. The semiconductor device according to item 5, wherein a timer interrupt signal issued from the timer is input at the time of the timer interrupt, an interrupt permission signal is input from the stop / start control circuit, and a CPU interrupt signal is output to the CPU An interrupt control circuit (6) is further provided.

前記割り込み制御回路は、前記中断許可信号によって前記タイマ割り込み信号をマスクすることにより、前記CPU割り込み信号の出力をマスク可能に構成される。   The interrupt control circuit is configured to mask the output of the CPU interrupt signal by masking the timer interrupt signal with the interruption permission signal.

前記停止起動制御回路は、前記コプロセッサによる演算処理の実行中の前記タイマ割り込みが発生したとき、前記中断許可信号を中断禁止状態にし、前記NOPコマンドが連続して発行された後に、前記中断許可信号を中断許可状態にする。   The stop / start control circuit sets the suspension permission signal to a suspension prohibited state when the timer interrupt during execution of the arithmetic processing by the coprocessor occurs, and after the NOP command is continuously issued, the suspension permission signal Set the signal to permit interruption.

これにより、タイマ割り込みのCPU(2)への入力を、メモリアクセスの完了まで待たせることができる。   Thereby, the input of the timer interrupt to the CPU (2) can be made to wait until the memory access is completed.

〔7〕<セキュリティ回路はメモリデータの監視>
項4において、前記セキュリティ回路は、前記メモリに保持されるデータが改変されたことを監視する、メモリ監視回路(17)を含んで構成される。
[7] <Security circuit monitors memory data>
In item 4, the security circuit includes a memory monitoring circuit (17) for monitoring that data stored in the memory has been altered.

これにより、コプロセッサ(10)の演算が中断されている期間に、メモリ(7)の内容に意図しない変化が発生した場合にも、それを検出することができ、メモリ(7)に保持されるデータについて、セキュリティ性能が低下するのを防止することができる。   As a result, even if an unintended change occurs in the contents of the memory (7) during the period when the calculation of the coprocessor (10) is interrupted, it can be detected and held in the memory (7). It is possible to prevent the security performance of the data to be deteriorated.

〔8〕<メモリ監視回路=メモリ内蔵のパリティまたはEDCの監視>
項7において、前記メモリは、格納するデータにパリティまたは誤り検出符号を付与し、格納されたデータに付与されたパリティまたは誤り検出符号の正当性を検証する機能を備える。前記メモリ監視回路は、前記正当性の検証結果が入力され、正当性が損なわれたときに前記CPUに対して通知可能に構成される。
[8] <Memory monitoring circuit = monitoring parity or EDC built in memory>
In item 7, the memory has a function of adding a parity or error detection code to stored data and verifying the validity of the parity or error detection code added to the stored data. The memory monitoring circuit is configured to be able to notify the CPU when the validity verification result is input and the validity is impaired.

これにより、簡便かつ的確に、メモリに格納された値を監視することができる。   As a result, the value stored in the memory can be monitored simply and accurately.

〔9〕<コプロセッサの回路はフィードバックF/F>
項1から項8のうちの1項において、前記演算器と前記演算制御回路は、出力を入力にフィードバックすることによって保持する値の更新を抑制可能な記憶回路(21)を備える。
[9] <Coprocessor circuit is feedback F / F>
In one of Items 1 to 8, the arithmetic unit and the arithmetic control circuit each include a storage circuit (21) capable of suppressing an update of a value held by feeding back an output to an input.

前記コプロセッサによる演算処理の実行中に前記タイマ割り込みが発生したとき、前記停止起動制御回路は、前記記憶回路に保持される値の更新を抑制することによって、前記演算器と前記演算制御回路の動作を停止させる。   When the timer interrupt occurs during the execution of the arithmetic processing by the coprocessor, the stop / start control circuit suppresses updating of the value held in the storage circuit, whereby the arithmetic unit and the arithmetic control circuit Stop operation.

これにより、簡便かつ的確に、コプロセッサ(10)の演算動作を停止させることができる。また、コプロセッサ(10)が演算を停止してもクロック供給が継続されるので、クロック周波数の電磁輻射を観測するサイドチャネル攻撃に対するセキュリティ性能の低下を抑えることができる。   Thereby, the arithmetic operation of the coprocessor (10) can be stopped simply and accurately. Further, since the clock supply is continued even when the coprocessor (10) stops the operation, it is possible to suppress a decrease in security performance against a side channel attack for observing electromagnetic radiation at the clock frequency.

〔10〕<クロック供給の維持>
項4において、前記演算器と前記演算制御回路と前記セキュリティ回路と前記メモリとには、同一系統のクロック(CLK2)が供給され、前記演算器と前記演算制御回路は、前記クロックが入力され、出力を入力にフィードバックすることによって保持する値の更新を抑制可能な記憶回路(21)を備える。
[10] <Maintaining clock supply>
In item 4, the same system clock (CLK2) is supplied to the arithmetic unit, the arithmetic control circuit, the security circuit, and the memory, and the arithmetic unit and the arithmetic control circuit are supplied with the clock, A storage circuit (21) capable of suppressing the update of the value held by feeding back the output to the input is provided.

前記コプロセッサによる演算処理の実行中の前記タイマ割り込みが発生したとき、前記クロックの供給が継続されることにより、前記セキュリティ回路の動作が継続され、前記コプロセッサによる前記メモリへのアクセスが完了した後に、前記停止起動制御回路は、前記記憶回路に保持される値の更新を抑制することによって、前記演算器と前記演算制御回路の動作を停止させる。   When the timer interrupt during the execution of the arithmetic processing by the coprocessor occurs, the supply of the clock is continued, so that the operation of the security circuit is continued and the access to the memory by the coprocessor is completed. Later, the stop activation control circuit stops the operation of the arithmetic unit and the arithmetic control circuit by suppressing the update of the value held in the memory circuit.

これにより、項9と同様の効果を奏し、さらにコプロセッサ(10)へ供給されるクロック信号(CLK2)をCPU(2)へ供給されるクロック信号(CLK1)と独立に制御することを可能とすることができる。   As a result, the same effect as in item 9 can be obtained, and the clock signal (CLK2) supplied to the coprocessor (10) can be controlled independently of the clock signal (CLK1) supplied to the CPU (2). can do.

〔11〕<中断中のクロック周波数の低減>
項10において、前記コプロセッサによる前記メモリへの前記アクセスが完了した後に、前記クロックの周波数を低下させる。
[11] <Reduction of interrupted clock frequency>
In item 10, after the access to the memory by the coprocessor is completed, the frequency of the clock is decreased.

これにより、セキュリティ回路(13)とメモリ(7)へのクロック供給を継続することによって、CPUとコプロセッサを排他的に動作させた場合の、セキュリティ性能の低下するのを防止しながら、セキュリティ回路(13)とメモリ(7)の消費電力を抑えることができる。   As a result, by continuing the clock supply to the security circuit (13) and the memory (7), the security circuit is prevented from deteriorating when the CPU and the coprocessor are operated exclusively. The power consumption of (13) and the memory (7) can be suppressed.

〔12〕<中断中のクロック周波数の分周による低減>
項11において、前記半導体装置は、前記クロックを供給するクロック発生回路(5)と、前記タイマから発行されるタイマ割り込み信号が入力され、前記停止起動制御回路から中断許可信号が入力され、前記CPUに対してCPU割り込み信号を出力する割り込み制御回路(6)とをさらに備える。
[12] <Reduction by dividing clock frequency during suspension>
Item 11. In the semiconductor device, the semiconductor device receives a clock generation circuit (5) that supplies the clock, a timer interrupt signal issued from the timer, an interruption permission signal from the stop / start control circuit, and the CPU And an interrupt control circuit (6) for outputting a CPU interrupt signal.

前記割り込み制御回路は、前記中断許可信号によって前記タイマ割り込み信号をマスクすることにより、前記CPU割り込み信号の出力をマスク可能に構成される。   The interrupt control circuit is configured to mask the output of the CPU interrupt signal by masking the timer interrupt signal with the interruption permission signal.

前記演算制御回路は前記メモリに対して、前記コプロセッサによる前記メモリへのアクセスに際して、リードコマンドまたはライトコマンドを発行し、アクセスしないときにNOPコマンドを発行可能に構成される。前記停止起動制御回路は、前記コプロセッサによる演算処理の実行中の前記タイマ割り込みが発生したとき、前記中断許可信号を中断禁止状態にし、前記NOPコマンドが所定回数連続して発行された後に、前記中断許可信号を中断許可状態にする。   The arithmetic control circuit is configured to issue a read command or a write command to the memory when the coprocessor accesses the memory, and issue a NOP command when not accessing the memory. The stop / start control circuit sets the suspension permission signal to a suspension prohibited state when the timer interrupt during execution of the arithmetic processing by the coprocessor occurs, and after the NOP command is continuously issued a predetermined number of times, Set the suspension permission signal to the suspension permission state.

前記クロック発生回路は、前記中断許可信号が中断許可状態のときに、入力されているクロックソースを分周することによって前記クロックの周波数を低下させる。   The clock generation circuit reduces the frequency of the clock by dividing the frequency of the input clock source when the interruption permission signal is in the interruption permission state.

これにより、メモリアクセスの完了を、簡便かつ的確に判定し、タイマ割り込みのCPU(2)への入力を、メモリアクセスの完了まで待たせることができ、さらに、簡単な回路で且つ瞬時にクロック周波数を低下させることができる。   As a result, the completion of the memory access can be easily and accurately determined, and the input of the timer interrupt to the CPU (2) can be made to wait until the completion of the memory access. Furthermore, the clock frequency can be instantaneously reduced with a simple circuit. Can be reduced.

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

〔代表的な実施の形態〕
図1は、代表的な実施形態に係る半導体装置1の構成を表すブロック図である。
[Typical embodiment]
FIG. 1 is a block diagram illustrating a configuration of a semiconductor device 1 according to a representative embodiment.

半導体装置1は、例えば、ICカードに搭載されるセキュアマイコンであって、CPU2と、タイマ割り込みを発生するタイマ3と、コプロセッサ10とを備える。コプロセッサ10は、演算器11と、演算器11を制御する演算制御回路12と、セキュリティ回路13と、停止起動制御回路14とを含んで構成される。セキュリティ回路13は、コプロセッサ10による演算の途中経過である、演算器11の入出力データを外部からの攻撃から保護するための回路である。例えば、コプロセッサ10の内部や接続されるバス8上のデータを暗号化するための乱数発生回路、乱数が適切に継続して発生されているかどうかを監視する、乱数発生状態監視回路、データが不正に改竄されていないかどうかを監視する回路などである。CPU2とタイマ3とコプロセッサ10は、互いにバス8を介して接続されているとよい。CPU2によって、制御レジスタの設定、状態レジスタの監視などを行うことができる。半導体装置1は、さらに割り込み制御回路6を備えてもよい。タイマ割り込み信号は割り込み制御回路6に入力され、必要に応じてマスク処理を施され、他の割り込み要求との間で、設定された優先順位に基づいて調停された後、割り込みベクタ信号としてCPU2に入力される。他の割り込み制御方式を採用する回路を備えても良い。これらの回路は、特に制限されないが、例えばCMOS半導体製造技術により、シリコン基板上の単一チップに集積される。   The semiconductor device 1 is, for example, a secure microcomputer mounted on an IC card, and includes a CPU 2, a timer 3 that generates a timer interrupt, and a coprocessor 10. The coprocessor 10 includes an arithmetic unit 11, an arithmetic control circuit 12 that controls the arithmetic unit 11, a security circuit 13, and a stop / start control circuit 14. The security circuit 13 is a circuit for protecting input / output data of the computing unit 11 from an attack from the outside, which is in the middle of computation by the coprocessor 10. For example, a random number generation circuit for encrypting data on the bus 8 connected to the inside of the coprocessor 10, a random number generation state monitoring circuit for monitoring whether or not random numbers are generated properly, and data For example, a circuit for monitoring whether or not tampering has occurred. The CPU 2, the timer 3, and the coprocessor 10 may be connected to each other via the bus 8. The CPU 2 can set a control register, monitor a status register, and the like. The semiconductor device 1 may further include an interrupt control circuit 6. The timer interrupt signal is input to the interrupt control circuit 6, masked as necessary, arbitrated with other interrupt requests based on the set priority, and then sent to the CPU 2 as an interrupt vector signal. Entered. A circuit employing another interrupt control method may be provided. These circuits are not particularly limited, but are integrated on a single chip on a silicon substrate by, for example, CMOS semiconductor manufacturing technology.

コプロセッサ10による演算処理の実行中にタイマ割り込みが発生したとき、停止起動制御回路14は、セキュリティ回路13の動作を継続させたまま、演算器11と演算制御回路12の動作を停止させる。   When a timer interrupt occurs during the execution of arithmetic processing by the coprocessor 10, the stop / start control circuit 14 stops the operations of the arithmetic unit 11 and the arithmetic control circuit 12 while continuing the operation of the security circuit 13.

半導体装置1が、例えば電池を備えない非接触ICカードであって、通信用の電磁波の搬送波(キャリア)を検波して回路の電源を生成しているとき、消費電流のピーク値(瞬時値)を抑えるために、CPU2とコプロセッサ10とを排他的に動作させる。CPU2はコプロセッサ10に対し、例えば公開鍵暗号の演算処理を実行させるなど、演算処理を起動した後、例えばスリープモードなどの低消費電力状態に遷移して、自己のプログラム処理を休止する。通信プロトコルによって規定される定時処理を実行すべき時刻には、タイマ割り込みが発生して、CPU2は通常モードに復帰し、必要な定時処理と応答などを行う。この時、CPU2を動作させる代わりに、コプロセッサ10の動作を一時中断することにより、消費電流のピーク値を抑えることができる。コプロセッサ10は、タイマ割り込みの発生を停止起動制御回路14が検知すると、演算器11と演算制御回路12の動作を停止させるので、CPU2の動作中には、コプロセッサ10の消費電流は大幅に抑えられる。停止起動制御回路14は、演算器11と演算制御回路12の動作を停止させるが、セキュリティ回路13の動作は停止させずに継続する。   When the semiconductor device 1 is, for example, a non-contact IC card that does not include a battery and generates a circuit power source by detecting a carrier wave of a communication electromagnetic wave, a peak value (instantaneous value) of current consumption In order to suppress this, the CPU 2 and the coprocessor 10 are operated exclusively. For example, the CPU 2 causes the coprocessor 10 to execute public key cryptography arithmetic processing, and after starting the arithmetic processing, for example, transitions to a low power consumption state such as a sleep mode and pauses its own program processing. At the time at which the scheduled processing specified by the communication protocol is to be executed, a timer interrupt is generated, and the CPU 2 returns to the normal mode and performs necessary scheduled processing and response. At this time, the peak value of the current consumption can be suppressed by temporarily interrupting the operation of the coprocessor 10 instead of operating the CPU 2. When the stop activation control circuit 14 detects the occurrence of the timer interrupt, the coprocessor 10 stops the operation of the arithmetic unit 11 and the arithmetic control circuit 12, so that the current consumption of the coprocessor 10 is greatly increased during the operation of the CPU 2. It can be suppressed. The stop activation control circuit 14 stops the operation of the arithmetic unit 11 and the arithmetic control circuit 12, but continues the operation of the security circuit 13 without stopping.

これにより、CPU2とコプロセッサ10とを備える半導体装置1において、CPU2とコプロセッサ10を排他的に動作させて低消費電力化した場合にも、セキュリティ回路13の動作は継続されるので、セキュリティ性能(耐タンパー性)が低下するのを防止することができる。コプロセッサの演算機能を一時中断することで低消費電力化を図ることができる。コプロセッサの演算処理中にタイマ割り込みが発生してCPU2を動作させる際の非接触通信への影響を低減することができる。また、中断時にセキュリティ回路は動作を継続する為、中断時もしくは中断からの再開後のセキュリティ回路への攻撃に対する耐性を向上させることが出来る。   As a result, in the semiconductor device 1 including the CPU 2 and the coprocessor 10, even when the CPU 2 and the coprocessor 10 are exclusively operated to reduce power consumption, the operation of the security circuit 13 is continued. It can prevent that (tamper resistance) falls. The power consumption can be reduced by temporarily interrupting the arithmetic function of the coprocessor. It is possible to reduce the influence on the non-contact communication when the timer interrupt occurs during the arithmetic processing of the coprocessor and the CPU 2 is operated. In addition, since the security circuit continues to operate at the time of interruption, it is possible to improve resistance to attacks against the security circuit at the time of interruption or after restarting from interruption.

〔実施形態1〕
図2は、実施形態1に係る半導体装置の構成を表すブロック図である。図1に示した代表的な実施形態に係る半導体装置1に対し、さらにクロック発生回路(CPG)5とメモリ7を備え、セキュリティ回路13が乱数発生回路15と乱数発生状態監視回路16とを含んで構成される例を示す。クロック発生回路(CPG)5は、半導体装置1が例えば非接触ICカードに搭載されるセキュアマイコンの場合は、通信用の電磁波のキャリア信号に基づいて、クロックパルスを発生する回路などで構成することができる。クロック発生回路(CPG)5から出力されたクロックCLKは、CPU2,タイマ3、割り込み制御回路6、メモリ7、コプロセッサ10に供給される。コプロセッサ10の内部では、演算器11と演算制御回路12とセキュリティ回路13と停止起動制御回路14などの回路すべてに供給される。メモリ7は、CPU2のプログラムを格納するROM(Read Only Memory)などの不揮発性メモリと、CPU2やコプロセッサ10の処理の途中経過や結果のデータを保持する、RAM(Random Access Memory)などの揮発性メモリを含んで構成されることができる。クロック発生回路(CPG)5とメモリ7は、特に制限されないが、CPU2やコプロセッサ10とともに同じ半導体チップ上に集積して形成されること望ましい。クロック信号やバス8の信号を外部から観測し、あるいは強制的に信号を印加することが困難となり、耐タンパー性が向上するからである。
Embodiment 1
FIG. 2 is a block diagram illustrating the configuration of the semiconductor device according to the first embodiment. The semiconductor device 1 according to the representative embodiment shown in FIG. 1 further includes a clock generation circuit (CPG) 5 and a memory 7, and the security circuit 13 includes a random number generation circuit 15 and a random number generation state monitoring circuit 16. An example composed of When the semiconductor device 1 is a secure microcomputer mounted on, for example, a non-contact IC card, the clock generation circuit (CPG) 5 is configured by a circuit that generates a clock pulse based on a carrier signal of an electromagnetic wave for communication. Can do. The clock CLK output from the clock generation circuit (CPG) 5 is supplied to the CPU 2, timer 3, interrupt control circuit 6, memory 7, and coprocessor 10. Inside the coprocessor 10, it is supplied to all circuits such as the arithmetic unit 11, the arithmetic control circuit 12, the security circuit 13, and the stop / start control circuit 14. The memory 7 is a non-volatile memory such as a ROM (Read Only Memory) that stores a program of the CPU 2 and a volatile memory such as a RAM (Random Access Memory) that holds data in the middle of the processing of the CPU 2 and the coprocessor 10 and results. The memory can be configured to include. The clock generation circuit (CPG) 5 and the memory 7 are not particularly limited, but are desirably formed integrally with the CPU 2 and the coprocessor 10 on the same semiconductor chip. This is because it becomes difficult to observe the clock signal and the signal of the bus 8 from the outside or to forcibly apply the signal, and the tamper resistance is improved.

セキュリティ回路13は、演算器11の入出力データをマスクするための乱数を発生する、乱数発生回路15を含んで構成される。乱数発生回路15は、セキュリティ回路の一例であり、サイドチャネル解析の対策などで用いる乱数を生成する回路である。サイドチャネル解析とはチップから漏れる消費電力や電磁波などの情報をもとにデータとの相関から値を推定する攻撃であり、その相関をなくすため乱数を使用することがある。ただし、乱数やその使い方が既知になると効果がない。乱数発生回路15が停止している時間が長いほど乱数への改ざん等の恐れがあり、乱数が既知となる可能性がある。あるいは乱数発生回路15の構成によってはクロックを停止させることにより再開直後の乱数性が劣る場合も考えられる。それを避けるために中断時にも乱数発生回路15の動作を継続させて、乱数の生成を継続させる。乱数値のスタックなど攻撃されていないか確認する回路を実装した場合、その回路も中断時に動作させる事で、中断時においても故障と判断した場合に検出できるようにする。本実施例では、乱数生成器で生成した乱数はコプロセッサの演算器の内部データをマスクするために使用する。   The security circuit 13 includes a random number generation circuit 15 that generates a random number for masking input / output data of the arithmetic unit 11. The random number generation circuit 15 is an example of a security circuit, and is a circuit that generates a random number used as a countermeasure for side channel analysis. Side channel analysis is an attack that estimates a value from correlation with data based on information such as power consumption and electromagnetic waves leaking from the chip, and random numbers may be used to eliminate the correlation. However, if the random number and how to use it become known, there is no effect. As the time during which the random number generation circuit 15 is stopped is longer, the random number may be tampered with, and the random number may become known. Alternatively, depending on the configuration of the random number generation circuit 15, it may be considered that the randomness immediately after restarting is inferior by stopping the clock. In order to avoid this, the operation of the random number generation circuit 15 is continued even during interruption, and the generation of random numbers is continued. When a circuit for checking whether or not an attack such as a random value stack is implemented, the circuit is also operated at the time of interruption so that it can be detected when it is determined that a failure has occurred even at the time of interruption. In this embodiment, the random number generated by the random number generator is used to mask the internal data of the coprocessor arithmetic unit.

これにより、コプロセッサ10を演算の途中で停止させた場合であっても、乱数によってマスクされた、演算の途中経過データについて、セキュリティ性能が低下するのを防止することができる。コプロセッサ10の演算の途中経過データは、演算器11の動作の中断により、中断している期間中、演算器11内のフリップフロップやラッチ回路に保持される。通常動作で途中経過データがラッチなどに保持される期間は1サイクルであるのと比較すると、演算の中断期間は数10から数100サイクル以上に及ぶ長期間となる。そのため、外部から探知される危険性が高まる。これを防ぐために、途中経過データを、乱数を鍵として使って暗号化してマスクする。暗号鍵である乱数の値が探知されると、暗号化によるマスクが意味を持たなくなり、耐タンパー性が損なわれる。コプロセッサ10が停止する期間も、乱数発生回路15が継続して乱数を生成し続けることにより、乱数値が探知される危険性を低くくし、セキュリティ性能が低下するのを防止することができる。   As a result, even when the coprocessor 10 is stopped in the middle of the calculation, it is possible to prevent the security performance of the intermediate calculation progress data masked by the random number from being deteriorated. The progress data of the calculation of the coprocessor 10 is held in a flip-flop or latch circuit in the calculator 11 during the interrupted period due to the interruption of the operation of the calculator 11. Compared with the period in which the intermediate progress data is held in the latch or the like in the normal operation, the operation interruption period is a long period extending from several tens to several hundreds of cycles. This increases the risk of being detected from the outside. In order to prevent this, intermediate progress data is encrypted and masked using a random number as a key. When the value of the random number that is the encryption key is detected, the mask by encryption becomes meaningless and the tamper resistance is impaired. Even during the period when the coprocessor 10 is stopped, the random number generation circuit 15 continues to generate random numbers, thereby reducing the risk of detecting random numbers and preventing the security performance from deteriorating.

乱数発生回路15は、例えば、アナログ素子の熱雑音を元にして生成した値を種として、常時連続的に乱数を発生する回路で構成することができる。乱数のビット数は1サイクルで転送可能な8ビット、16ビット、32ビットなどとすることができる。乱数のビット数を大きくして転送に複数サイクルを要する場合には、停止起動制御回路14は、乱数の転送の切れ目を考慮して、演算器11の動作を停止させる必要がある。一方、1サイクルで転送可能なビット数とすれば、乱数の転送の切れ目を考慮する必要がないので、任意のタイミングで演算器11の動作を停止させることができる。   For example, the random number generation circuit 15 can be configured by a circuit that continuously generates a random number using a value generated based on thermal noise of an analog element as a seed. The number of bits of the random number can be 8 bits, 16 bits, 32 bits, etc. that can be transferred in one cycle. When the number of bits of the random number is increased and a plurality of cycles are required for the transfer, the stop / start control circuit 14 needs to stop the operation of the arithmetic unit 11 in consideration of the break of the random number transfer. On the other hand, if the number of bits that can be transferred in one cycle is used, it is not necessary to consider the break of random number transfer, so that the operation of the computing unit 11 can be stopped at an arbitrary timing.

セキュリティ回路13は、さらに、乱数発生回路15による乱数発生状態を監視する、乱数発生状態監視回路16を含んで構成される。   The security circuit 13 further includes a random number generation state monitoring circuit 16 that monitors a random number generation state by the random number generation circuit 15.

これにより、コプロセッサ10を演算の途中で停止させ、さらにマスク用の乱数発生回路15が停止した場合であっても、それを検出して適切な防御措置を執ることができ、演算の途中経過データについて、セキュリティ性能が低下するのを防止することができる。   As a result, even when the coprocessor 10 is stopped in the middle of the operation and the mask random number generation circuit 15 is stopped, it can be detected and appropriate defensive measures can be taken. It is possible to prevent the security performance of data from being deteriorated.

<メモリアクセスの完了を待って中断>
本実施形態1において、半導体装置1は、コプロセッサ10によってアクセス可能なメモリ7を備える。コプロセッサ10の演算中にタイマ割り込みなどにより中断要求が行われた場合、コプロセッサ10が中断出来る状態となったら演算を一時中断し、再開要求により中断した状態から再度演算動作を行なう機能を実装する。コプロセッサ10が中断できる状態とは、データ格納用メモリ7の動作依存を排除する為に、コプロセッサ10が発行したコマンドに対するデータ格納用メモリらのレスポンスをコプロセッサが受け取った状態のことを示す。
<Abort after completion of memory access>
In the first embodiment, the semiconductor device 1 includes a memory 7 that can be accessed by the coprocessor 10. Implements a function that, when an interruption request is made during a calculation by the coprocessor 10 due to a timer interrupt or the like, the calculation is temporarily interrupted when the coprocessor 10 is ready to be interrupted, and the operation is resumed from the state interrupted by the restart request. To do. The state in which the coprocessor 10 can be interrupted indicates a state in which the coprocessor has received a response from the data storage memory to a command issued by the coprocessor 10 in order to eliminate the operation dependence of the data storage memory 7. .

より詳細には、以下のように実装される。メモリ7にはクロック発生回路(CPG)5からクロックCLKが供給され、コプロセッサ10は、演算制御回路12からコマンドを発行することにより、バス8を介してメモリ7にアクセスすることができる。メモリアクセスは、クロック同期で動作する。例えばリードコマンドが発行され、アドレスが指定されると、次のクロックサイクルに、メモリ7から読み出されたデータがバス8に出力され、さらに次のクロックサイクルでコプロセッサ10の演算器11のラッチに取り込まれる。ライトコマンドが発行され、アドレスとデータがバス8に出力されると、次のクロックサイクルにメモリ7の指定されたアドレスにデータが書き込まれる。上述のバスサイクルは一例であって、上述の例とは異なるサイクル数で実行されてもよい。また、バス8はCPU2と共通のバスであり、図示を省略された調停回路によって競合が調停される。本実施形態1では、CPU2とコプロセッサ10がバスマスタであり、バスアクセスが競合する可能性があるが、コプロセッサ10とCPU2は排他的に動作させるので、実動作ではバスの競合を発生させないように設計することができる。   More specifically, it is implemented as follows. A clock CLK is supplied from the clock generation circuit (CPG) 5 to the memory 7, and the coprocessor 10 can access the memory 7 via the bus 8 by issuing a command from the arithmetic control circuit 12. Memory access operates in clock synchronization. For example, when a read command is issued and an address is specified, the data read from the memory 7 is output to the bus 8 in the next clock cycle, and the arithmetic unit 11 of the coprocessor 10 is latched in the next clock cycle. Is taken in. When a write command is issued and the address and data are output to the bus 8, the data is written to the designated address of the memory 7 in the next clock cycle. The above bus cycle is an example, and may be executed with a different number of cycles from the above example. The bus 8 is a common bus with the CPU 2, and the competition is arbitrated by an arbitration circuit (not shown). In the first embodiment, the CPU 2 and the coprocessor 10 are bus masters and bus access may compete, but the coprocessor 10 and the CPU 2 operate exclusively, so that bus competition does not occur in actual operation. Can be designed to

タイマ割り込みは任意のタイミングで発生するため、リードコマンドが発行された後でリードデータが読み込まれる前に、または、ライトコマンドが発行された後でメモリ7へのデータの書き込みが完了する前に、タイマ割り込みが発生する可能性がある。その場合、コマンドが発行された後にタイマ割り込みが発生し、リードまたはライトアクセスの動作が完了する前に、コプロセッサ10の演算器11やメモリ7の動作を停止させてしまうと、アクセスされたデータが失われる恐れがある。例えば、リードコマンドによってメモリ7から読み出されたデータが、バス8上にあるときに演算器11が動作を停止すると、そのデータを取り込むことができない。バス8が他のアクセスで使われるとデータが失われる。また、ライトアクセスによってコプロセッサ10からバス8に出力されたライトデータが、メモリ7に書き込まれる保証がなくなる。   Since the timer interrupt occurs at an arbitrary timing, before the read data is read after the read command is issued, or before the writing of data to the memory 7 is completed after the write command is issued, A timer interrupt may occur. In this case, if the timer interrupt occurs after the command is issued and the operation of the arithmetic unit 11 or the memory 7 of the coprocessor 10 is stopped before the read or write access operation is completed, the accessed data May be lost. For example, if the calculator 11 stops operating when the data read from the memory 7 by the read command is on the bus 8, the data cannot be fetched. If the bus 8 is used for another access, data is lost. In addition, there is no guarantee that the write data output from the coprocessor 10 to the bus 8 by the write access is written to the memory 7.

そこで、停止起動制御回路14は、コプロセッサ10による演算処理の実行中のタイマ割り込みが発生したとき、コプロセッサ10よるメモリ7へのアクセスが完了した後に、演算器11と演算制御回路12の動作を停止させる。   Therefore, the stop / start control circuit 14 operates the arithmetic unit 11 and the arithmetic control circuit 12 after the coprocessor 10 completes access to the memory 7 when a timer interrupt occurs while the coprocessor 10 is executing arithmetic processing. Stop.

これにより、コプロセッサ10を演算の途中で停止させたときに、コプロセッサ10がメモリアクセスの途中であった場合にも、メモリアクセスのデータは適切に保持され、コプロセッサ10が演算を再開したときに正常な動作を継続することができる。コプロセッサ10が中断できる状態になるのを待って中断させるため、データ格納用メモリ7の動作依存を排除することが出来る。   As a result, when the coprocessor 10 is stopped in the middle of the operation, even if the coprocessor 10 is in the middle of the memory access, the data of the memory access is appropriately retained, and the coprocessor 10 resumes the operation. Sometimes normal operation can continue. Since the coprocessor 10 is suspended after waiting for a state where it can be interrupted, the operation dependence of the data storage memory 7 can be eliminated.

より具体的には、以下のように実現される。中断要求であるタイマ割り込みが、停止起動制御回路14に入力されている。停止起動制御回路14は、タイマ割り込みを受信すると、演算制御回路12の出力するコマンド信号の状態に依存して、演算器用停止制御信号と中断許可信号を出力する。演算器用停止制御信号により演算器11と演算制御回路12の動作を停止させる。   More specifically, it is realized as follows. A timer interrupt which is an interruption request is input to the stop / start control circuit 14. When receiving the timer interrupt, the stop / start control circuit 14 outputs an arithmetic unit stop control signal and an interruption permission signal depending on the state of the command signal output from the arithmetic control circuit 12. The operation of the arithmetic unit 11 and the arithmetic control circuit 12 is stopped by the arithmetic unit stop control signal.

演算制御回路12はメモリ7に対して、コプロセッサ10によるメモリ7へのアクセスに際して、リードコマンドまたはライトコマンドを発行し、アクセスしないときにNOPコマンドを発行する。停止起動制御回路14は、コプロセッサ10による演算処理の実行中にタイマ割り込みが発生したとき、NOPコマンドが所定の回数だけ連続して発行された後に、演算器用停止制御信号を出力して、演算器11と演算制御回路12の動作を停止させる。   The arithmetic control circuit 12 issues a read command or a write command to the memory 7 when the coprocessor 10 accesses the memory 7, and issues a NOP command when not accessing. The stop / start control circuit 14 outputs a stop control signal for an arithmetic unit after a NOP command is issued continuously for a predetermined number of times when a timer interrupt occurs during the execution of the arithmetic processing by the coprocessor 10. The operation of the calculator 11 and the arithmetic control circuit 12 is stopped.

これにより、メモリアクセスの完了を、簡便かつ的確に判定することができる。   Thereby, completion of memory access can be determined easily and accurately.

割り込み制御回路6は、中断許可信号によってタイマ割り込み信号をマスクすることにより、CPU割り込み信号の出力をマスクすることができる。   The interrupt control circuit 6 can mask the output of the CPU interrupt signal by masking the timer interrupt signal with the interruption permission signal.

停止起動制御回路14は、コプロセッサ10による演算処理の実行中のタイマ割り込みが発生したとき、中断許可信号を中断禁止状態にし、NOPコマンドが所定の回数連続して発行された後に、中断許可信号を中断許可状態にする。中断許可信号は、割り込み制御回路6に入力され、コプロセッサ10よるメモリ7へのアクセスが完了するまでの期間、タイマ割り込み信号をマスクし、割り込みベクタ信号の出力を遅らせる。   The stop / start control circuit 14 sets a suspension permission signal to a suspension prohibited state when a timer interrupt during execution of arithmetic processing by the coprocessor 10 occurs, and after a NOP command is issued continuously a predetermined number of times, the suspension permission signal Is suspended. The interrupt permission signal is input to the interrupt control circuit 6, masks the timer interrupt signal and delays the output of the interrupt vector signal until the access to the memory 7 by the coprocessor 10 is completed.

これにより、タイマ割り込みのCPU2への入力を、メモリアクセスの完了まで待たせることができ、CPU2は、コプロセッサ10によるメモリ7へのアクセスが完了するのを待って、割り込み処理を開始することとなる。   Thereby, the input of the timer interrupt to the CPU 2 can be made to wait until the memory access is completed. The CPU 2 waits for the coprocessor 10 to complete the access to the memory 7 and starts the interrupt process. Become.

図3は、メモリアクセス(リード)時の中断手順を表すタイミングチャートである。本実施形態の半導体装置1をセキュアマイコンとして非接触型ICカードに搭載した場合を例に採って説明する。横軸は時間であり、縦軸に各モジュールの動作シーケンス、コプロセッサ10の動作タイミング、メモリ(RAM)7の動作タイミング、及び、演算器用停止制御信号、中断許可信号、タイマ割り込み信号、割り込みクリア信号を示す。ICカードが非接触通信によって受信状態からCPUとコプロセッサの動作可能状態を経て送信状態に遷移する過程を示す。   FIG. 3 is a timing chart showing an interruption procedure at the time of memory access (read). A case where the semiconductor device 1 of the present embodiment is mounted on a non-contact type IC card as a secure microcomputer will be described as an example. The horizontal axis represents time, and the vertical axis represents the operation sequence of each module, the operation timing of the coprocessor 10, the operation timing of the memory (RAM) 7, the stop control signal for the arithmetic unit, the interruption permission signal, the timer interrupt signal, and the interrupt clear. Signals are shown. The process by which the IC card transits from the reception state to the transmission state through the operable state of the CPU and coprocessor by non-contact communication is shown.

時刻t0からt1までの受信状態では、CPU2とコプロセッサ10はとも停止状態にある。クロックCLKの供給も開始されていない。この期間に受信した電磁波を検波してセキュアマイコンである半導体装置1が動作するための電源を生成し、合せて発振回路を動作させてクロックCLKの供給を開始する。クロックCLKは通信のための搬送波(キャリア)を元に生成してもよい。   In the reception state from time t0 to t1, both the CPU 2 and the coprocessor 10 are in a stopped state. The supply of the clock CLK is not started. The electromagnetic wave received during this period is detected to generate a power source for operating the semiconductor device 1 that is a secure microcomputer, and the oscillation circuit is also operated to start supplying the clock CLK. The clock CLK may be generated based on a carrier wave for communication.

時刻t1からCPUとコプロセッサの動作可能状態になり、まず、CPU2がプログラム実行状態に遷移する。この間に、各種の初期化処理を行い、通信のプロトコル処理を行う。暗号の処理は特殊な演算を必要とし、高い演算性能を求められるので、コプロセッサ10を用いて実行される。コプロセッサ10へのデータの受け渡しと演算内容の設定も、この期間に行われる。   From time t1, the CPU and the coprocessor become operable, and first, the CPU 2 transitions to the program execution state. During this time, various initialization processes are performed, and communication protocol processes are performed. Since the cryptographic process requires special computation and high computation performance is required, it is executed using the coprocessor 10. Data transfer to the coprocessor 10 and calculation content setting are also performed during this period.

時刻t2においてCPU2はコプロセッサ10の制御レジスタに起動コマンドを設定するなどの方法により、コプロセッサ10に演算の開始を指示し、自らはスリープ状態に遷移する。一方、コプロセッサ10は停止状態から演算状態に遷移する。コプロセッサ10は、演算状態では演算に必要なデータをRAM7から読み込み、途中経過データをRAM7に格納する。メモリアクセスにはコマンドを発行する。コマンドは、リードコマンド(R)、ライトコマンド(W)、及びNOP(N)の3種類である。リードコマンドが発行されると次のサイクルでRAM7にラッチされる。リードデータはさらにその次のサイクルでバス8に出力される。図3にはRAM7内のRAMデータバスのうちリードバスを示す。リードコマンドに対応するデータはリードデータであり、ライトデータに対応するデータは不定(x)である。   At time t2, the CPU 2 instructs the coprocessor 10 to start computation by a method such as setting a start command in the control register of the coprocessor 10, and shifts itself to the sleep state. On the other hand, the coprocessor 10 transitions from the stop state to the computation state. The coprocessor 10 reads data necessary for calculation from the RAM 7 and stores intermediate progress data in the RAM 7 in the calculation state. A command is issued for memory access. There are three types of commands: read command (R), write command (W), and NOP (N). When a read command is issued, it is latched in the RAM 7 in the next cycle. The read data is further output to the bus 8 in the next cycle. FIG. 3 shows a read bus among the RAM data buses in the RAM 7. The data corresponding to the read command is read data, and the data corresponding to the write data is indefinite (x).

時刻t3にタイマ割り込み信号が遷移し、中断要求が発生したものとする。その後、ライトコマンド2個とリードコマンド2個が発行され、さらにその後NOPコマンド2個が発行されるものとする。時刻t4において発行されたリードコマンドには、NOPコマンド2個が続いている。時刻t4に発行されたリードコマンドは、時刻t5にRAM7にラッチされてリード動作が行われ、読み出されたデータが時刻t6に演算器のラッチに読み込まれる。この間、時刻t5とt6にはNOPコマンドが発行され、新たなアクセスコマンドが発行されない。停止起動制御回路14は、コマンドを監視し、リードコマンドに続いて2個の連続するNOPコマンドが発行されたときに、時刻t6に演算器用停止制御信号を活性化させる。これにより、演算器11と演算制御回路12が動作を停止するが、時刻t4に発行されたリードコマンドの読み出しデータは、既に演算器11にラッチされているので、失われることはなく演算を再開したときにすぐに使用可能となる。また、時刻t5とt6においては新たなコマンドが発行されていないので、完了していないアクセスコマンドはない。これにより、コプロセッサ10は、演算器11と演算制御回路12の動作が停止され、中断状態に遷移する。   It is assumed that the timer interrupt signal transits at time t3 and an interruption request is generated. Thereafter, two write commands and two read commands are issued, and then two NOP commands are issued. The read command issued at time t4 is followed by two NOP commands. The read command issued at time t4 is latched in the RAM 7 at time t5 to perform a read operation, and the read data is read into the latch of the arithmetic unit at time t6. During this time, the NOP command is issued at times t5 and t6, and no new access command is issued. The stop / start control circuit 14 monitors the command, and activates the arithmetic unit stop control signal at time t6 when two successive NOP commands are issued following the read command. As a result, the operation unit 11 and the operation control circuit 12 stop operating, but the read data of the read command issued at the time t4 is already latched in the operation unit 11, so that the operation is resumed without being lost. Will be available immediately. Further, since no new command is issued at times t5 and t6, there is no access command that has not been completed. As a result, the coprocessor 10 stops the operations of the arithmetic unit 11 and the arithmetic control circuit 12, and transitions to an interrupted state.

時刻t7には中断許可信号が活性化され、割り込み制御回路6でのタイマ割り込み信号のマスク処理を終わらせ、CPU2に割り込みベクタ信号として伝達され、CPU2は例外処理状態に遷移する。CPU2は、時刻t9に割り込みクリア信号を出力することにより、時刻t10でタイマ割り込み信号をクリアする。CPU2はその後、プログラム実行状態に遷移する。   At time t7, the interrupt permission signal is activated, the masking process of the timer interrupt signal in the interrupt control circuit 6 is finished, and is transmitted to the CPU 2 as an interrupt vector signal, and the CPU 2 transitions to the exception processing state. The CPU 2 clears the timer interrupt signal at time t10 by outputting an interrupt clear signal at time t9. Thereafter, the CPU 2 transitions to a program execution state.

時刻t11においてCPU2はコプロセッサ10の制御レジスタに起動コマンドを設定するなどの方法により、コプロセッサ10に演算の再開を指示し、自らはスリープ状態に遷移する。コプロセッサ10は中断許可信号を非活性化して演算器用停止制御信号を非活性化し、再び演算状態に遷移する。時刻t12で演算器用停止制御信号が非活性化されると、演算器11と演算制御回路12が動作を再開し、RAM7へのアクセスも再開される。   At time t11, the CPU 2 instructs the coprocessor 10 to resume the operation by a method such as setting a start command in the control register of the coprocessor 10, and shifts itself to the sleep state. The coprocessor 10 deactivates the interruption permission signal, deactivates the computing unit stop control signal, and transitions to the computing state again. When the arithmetic unit stop control signal is deactivated at time t12, the arithmetic unit 11 and the arithmetic control circuit 12 resume their operations, and access to the RAM 7 is also resumed.

以上のように、リードコマンドが発行された後、2個のNOPコマンドが連続して発行されるのを待って、停止起動制御回路14は演算器用停止制御信号を活性化させて演算器11と演算制御回路12の動作を停止させる。これにより、コプロセッサ10がRAM7のリードアクセスの途中であった場合にも、リードデータは適切に保持され、コプロセッサ10が演算を再開したときに正常な動作を継続することができる。   As described above, after the read command is issued, after waiting for two NOP commands to be issued in succession, the stop activation control circuit 14 activates the arithmetic unit stop control signal and The operation of the arithmetic control circuit 12 is stopped. Thereby, even when the coprocessor 10 is in the middle of read access to the RAM 7, the read data is appropriately held, and normal operation can be continued when the coprocessor 10 resumes the operation.

停止起動制御回路14が演算器用停止制御信号を活性化させるために、観測すべきNOPコマンドの数は、一例に過ぎない。コプロセッサ10とバス8とメモリ7のパイプライン構造によって適宜調整される。   The number of NOP commands to be observed in order for the stop / start control circuit 14 to activate the arithmetic unit stop control signal is merely an example. The coprocessor 10, the bus 8, and the memory 7 are appropriately adjusted according to the pipeline structure.

図4は、メモリアクセス(ライト)時の中断手順を表すタイミングチャートである。   FIG. 4 is a timing chart showing an interruption procedure at the time of memory access (write).

時刻t3にタイマ割り込み信号が遷移し、中断要求が発生するまでの動作は、図3に示したものと同様である。図4では、時刻t4において発行されたライトコマンドには、NOPコマンド2個が続いていた場合について説明する。時刻t4に発行されたライトコマンドは、時刻t5にRAM7にラッチされてライト動作が行われ、コプロセッサ10から出力されたデータは、同じ時刻t5にRAM7に書き込まれる。時刻t5とt6にはNOPコマンドが発行され、新たなアクセスコマンドが発行されない。停止起動制御回路14は、コマンドを監視し、ライトコマンドに続いて2個の連続するNOPコマンドが発行されたときに、時刻t6に演算器用停止制御信号を活性化させる。これにより、演算器11と演算制御回路12が動作を停止するが、時刻t4に発行されたライトコマンドの出力データは、既にRAM7に格納されているので、失われることはなく演算を再開したときにすぐに使用可能となる。また、時刻t5とt6においては新たなコマンドが発行されていないので、完了していないアクセスコマンドはない。これにより、コプロセッサ10は、演算器11と演算制御回路12の動作が停止され、中断状態に遷移する。   The operation from when the timer interrupt signal transitions at time t3 until an interruption request is generated is the same as that shown in FIG. In FIG. 4, a case where the write command issued at time t4 is followed by two NOP commands will be described. The write command issued at time t4 is latched in the RAM 7 at time t5 and a write operation is performed, and the data output from the coprocessor 10 is written into the RAM 7 at the same time t5. At times t5 and t6, a NOP command is issued and no new access command is issued. The stop / start control circuit 14 monitors the command, and activates the calculator stop control signal at time t6 when two consecutive NOP commands are issued following the write command. As a result, the operation unit 11 and the operation control circuit 12 stop operating, but the output data of the write command issued at time t4 is already stored in the RAM 7, so that the operation is resumed without being lost. It can be used immediately. Further, since no new command is issued at times t5 and t6, there is no access command that has not been completed. As a result, the coprocessor 10 stops the operations of the arithmetic unit 11 and the arithmetic control circuit 12, and transitions to an interrupted state.

時刻t7以降の動作は、図3に示した場合と同様である。時刻t12で演算器用停止制御信号が非活性化されると、演算器11と演算制御回路12が動作を再開し、RAM7へのアクセスも再開される。   The operation after time t7 is the same as that shown in FIG. When the arithmetic unit stop control signal is deactivated at time t12, the arithmetic unit 11 and the arithmetic control circuit 12 resume their operations, and access to the RAM 7 is also resumed.

以上のように、ライトコマンドが発行された後、2個のNOPコマンドが連続して発行されるのを待って、停止起動制御回路14は演算器用停止制御信号を活性化させて演算器11と演算制御回路12の動作を停止させる。これにより、コプロセッサ10がRAM7のリードアクセスの途中であった場合にも、リードデータは適切に保持され、コプロセッサ10が演算を再開したときに正常な動作を継続することができる。   As described above, after the write command is issued, the stop activation control circuit 14 activates the arithmetic unit stop control signal after waiting for two NOP commands to be issued in succession. The operation of the arithmetic control circuit 12 is stopped. Thereby, even when the coprocessor 10 is in the middle of read access to the RAM 7, the read data is appropriately held, and normal operation can be continued when the coprocessor 10 resumes the operation.

停止起動制御回路14が演算器用停止制御信号を活性化させるために、観測すべきNOPコマンドの数が一例に過ぎない点も、図3に示した例と同様である。コプロセッサ10とバス8とメモリ7のパイプライン構造によって適宜調整される。   The number of NOP commands to be observed is only an example in order for the stop / start control circuit 14 to activate the arithmetic unit stop control signal, which is similar to the example shown in FIG. The coprocessor 10, the bus 8, and the memory 7 are appropriately adjusted according to the pipeline structure.

図5は、メモリアクセス(NOP1回)時の中断手順を表すタイミングチャートである。   FIG. 5 is a timing chart showing an interruption procedure at the time of memory access (NOP 1 time).

停止起動制御回路14が演算器用停止制御信号を活性化させるために、観測すべきNOPコマンドの数が、図3、図4に示したように2回であるときには、図5に示すように、タイマ割り込み後の1回のNOPコマンドでは、停止起動制御回路14は演算器用停止制御信号を活性化させない。1回のNOPコマンド前に発行されたコマンドによるアクセスが完了しないうちに、NOPコマンドの次のアクセスコマンドの実行が開始されるためである。途中、何度もNOPコマンドが発行されても、連続して所定回数のNOPコマンドが発行されなければ、停止起動制御回路14は演算器用停止制御信号を活性化させない。   When the number of NOP commands to be observed is two times as shown in FIGS. 3 and 4 in order that the stop / start control circuit 14 activates the stop control signal for the arithmetic unit, as shown in FIG. In one NOP command after the timer interruption, the stop / start control circuit 14 does not activate the calculator stop control signal. This is because the execution of the access command next to the NOP command is started before the access by the command issued before one NOP command is completed. Even if the NOP command is issued many times during the process, the stop / start control circuit 14 does not activate the stop control signal for the arithmetic unit unless a predetermined number of NOP commands are continuously issued.

停止起動制御回路14が演算器用停止制御信号を活性化させるために、観測すべきNOPコマンドの数が一例に過ぎない点は、図3、図4に示した例と同様である。   Since the stop / start control circuit 14 activates the arithmetic unit stop control signal, the number of NOP commands to be observed is only an example, similar to the example shown in FIGS.

<コプロセッサの回路はフィードバックフリップフロップ(F/F)>
コプロセッサ10の演算器11の動作を停止させる手段は、種々の選択肢から採用することができる。図6は、演算回路を停止させるために、フィードバック付きフリップフロップ(F/F)を採用した例である。フリップフロップは、演算器11のパイプライン構造を形成する記憶回路の一種であり、演算の途中経過データを保持する。新たなデータによって保持する値の更新を抑制してしまえば、演算器11の動作は停止する。
<Coprocessor circuit is feedback flip-flop (F / F)>
A means for stopping the operation of the arithmetic unit 11 of the coprocessor 10 can be adopted from various options. FIG. 6 shows an example in which a flip-flop with feedback (F / F) is employed to stop the arithmetic circuit. The flip-flop is a kind of storage circuit that forms a pipeline structure of the arithmetic unit 11 and holds intermediate progress data. If the update of the value held by the new data is suppressed, the operation of the computing unit 11 is stopped.

図6には、演算器11の演算回路部と演算データ格納レジスタ部が模式的に示される。ビット数を始めとして回路規模を簡略化して示す。組合せ回路30〜32と演算器_1(40)と演算器_2(41)とで3段のパイプラインを構成し、各段にはフィードバック付きF/F21が配置される。さらにもう1段のパイプラインを経て演算データ格納レジスタ部のフリップフロップ(F/F)20にデータが格納される。リードデータバスから入力されるデータは、演算制御信号によって制御される組合せ回路30、31、32を経て3個のフィードバック付きF/F21にラッチされる。その出力は演算器_1(40)に入力され、その結果はセレクタ25を経て2個のフィードバック付きF/F21にラッチされる。セレクタ25は、演算制御信号によって制御され、2個のフィードバック付きF/F21に演算器_1(40)の出力をラッチするか、2個のフィードバック付きF/F21の値を保持するかを選択的に制御する。2個のフィードバック付きF/F21のうちの1個の出力が演算器_2(41)に入力され、その出力が1個のフィードバック付きF/F21にラッチされる。このフィードバック付きF/F21の出力は組合せ回路30、31、32にフィードバックされ、また、組合せ回路33を経て演算データ格納レジスタ部のフリップフロップ20に格納される、その出力は、組合せ回路34を経てライトデータバスに出力される。演算データ格納レジスタ部のフリップフロップ20はクロック入力端に、演算制御信号で制御されるクロックゲート23を備えている。演算制御信号により、新たな値をラッチして更新するか、前サイクルの値を維持するかが制御される。   FIG. 6 schematically shows an arithmetic circuit unit and an arithmetic data storage register unit of the arithmetic unit 11. The circuit scale is simplified, including the number of bits. The combinational circuits 30 to 32, the arithmetic unit_1 (40), and the arithmetic unit_2 (41) form a three-stage pipeline, and an F / F 21 with feedback is arranged in each stage. Further, the data is stored in the flip-flop (F / F) 20 of the operation data storage register unit through another pipeline. Data input from the read data bus is latched by three F / Fs 21 with feedback via combinational circuits 30, 31, and 32 controlled by operation control signals. The output is input to the arithmetic unit_1 (40), and the result is latched in the two feedback F / Fs 21 via the selector 25. The selector 25 is controlled by an arithmetic control signal, and selectively selects whether to latch the output of the computing unit_1 (40) in the two feedback F / Fs 21 or to hold the values of the two feedback F / Fs 21. To control. One output of the two F / Fs 21 with feedback is input to the computing unit_2 (41), and the output is latched in one F / F 21 with feedback. The output of the feedback F / F 21 is fed back to the combinational circuits 30, 31, and 32, and is stored in the flip-flop 20 of the operation data storage register unit via the combinational circuit 33. Output to the write data bus. The flip-flop 20 of the operation data storage register unit includes a clock gate 23 controlled by an operation control signal at the clock input end. The operation control signal controls whether a new value is latched and updated, or whether the previous cycle value is maintained.

フィードバック付きF/F21は、フリップフロップ20とセレクタ24によって構成され、演算器用停止制御信号によって制御される。演算器用停止制御信号が活性化されることにより、F/F20の出力がセレクタ24によりF/F20の入力にフィードバックされ、一方、新たなデータは入力されず保持されるデータは更新されない。   The feedback F / F 21 includes a flip-flop 20 and a selector 24, and is controlled by an arithmetic unit stop control signal. When the arithmetic unit stop control signal is activated, the output of the F / F 20 is fed back to the input of the F / F 20 by the selector 24, while no new data is input and the held data is not updated.

これにより、簡便かつ的確に、コプロセッサ10の演算動作を停止させることができる。また、コプロセッサ10が演算を停止してもクロックの供給が継続されるので、クロック周波数の信号の電磁輻射を観測するサイドチャネル攻撃に対するセキュリティ性能の低下を抑えることができる。   Thereby, the arithmetic operation of the coprocessor 10 can be stopped simply and accurately. In addition, since the clock supply is continued even when the coprocessor 10 stops the computation, it is possible to suppress a decrease in the security performance against a side channel attack for observing the electromagnetic radiation of the clock frequency signal.

一方、クロックゲーティングによってフリップフロップのデータの更新を抑え、演算回路の動作を停止させることもできる。   On the other hand, the update of data in the flip-flop can be suppressed by clock gating, and the operation of the arithmetic circuit can be stopped.

図7は、演算回路を停止させるために、ゲーテッドクロック付きF/Fを採用した例である。図6のフィードバック付きF/F21に代えて、ゲーテッドクロック付きF/F22を備える。ゲーテッドクロック付きF/F22は、F/F20とクロックゲート23によって構成され、演算器用停止制御信号によって制御される。演算器用停止制御信号が活性化されることにより、クロックゲート23がF/F20へのクロック信号の入力がマスクされ、データが更新されない。   FIG. 7 shows an example in which an F / F with a gated clock is used to stop the arithmetic circuit. Instead of the F / F 21 with feedback in FIG. 6, an F / F 22 with a gated clock is provided. The gated F / F 22 includes an F / F 20 and a clock gate 23, and is controlled by an arithmetic unit stop control signal. When the arithmetic unit stop control signal is activated, the clock gate 23 masks the input of the clock signal to the F / F 20, and the data is not updated.

これにより、簡便かつ的確に、コプロセッサ10の演算動作を停止させることができる。また、コプロセッサ10が演算を停止するとF/Fへのクロック供給も停止されるので、演算を中断した状態におけるコプロセッサ10の消費電力をさらに低減することができ、さらにフィードバック付きF/F21に比べて少ない回路規模で実装することができる。   Thereby, the arithmetic operation of the coprocessor 10 can be stopped simply and accurately. Further, when the coprocessor 10 stops the operation, the clock supply to the F / F is also stopped, so that it is possible to further reduce the power consumption of the coprocessor 10 in a state where the operation is interrupted, and to the F / F 21 with feedback. It can be implemented with a smaller circuit scale.

〔実施形態2〕
図8は、実施形態2に係る半導体装置の構成を表すブロック図である。
[Embodiment 2]
FIG. 8 is a block diagram illustrating a configuration of a semiconductor device according to the second embodiment.

実施形態2に係る半導体装置において、図3に示した実施形態1に係る半導体装置1との違いは、セキュリティ回路13が、メモリ7に保持されるデータが改変されたことを監視する、メモリ監視回路17を含んで構成される点である。他の構成及び動作は、実施形態1と同様であるので、説明を省略する。   In the semiconductor device according to the second embodiment, the difference from the semiconductor device 1 according to the first embodiment shown in FIG. 3 is that the security circuit 13 monitors that the data held in the memory 7 has been altered. This is a point that includes the circuit 17. Other configurations and operations are the same as those of the first embodiment, and thus description thereof is omitted.

メモリ監視回路17についてさらに詳しく説明する。メモリ7は、攻撃もしくは宇宙線などによるRAMのデータ改ざん、データ化けなどの故障を検出する冗長回路、具体的にはパリティ機能や誤り検出(EDC: Error Detection Code)機能を実装する。中断時に一部もしくは全部のデータとそのデータを入力とした冗長回路の出力を比較して整合性を確認、問題があればリセット要求信号を出すことでチップ動作を停止させるなどを行うことで、攻撃を失敗に終わらせる。中断時においても定期的に整合性を確認することでデータと冗長回路の複数の故障による誤動作をより困難とさせる。   The memory monitoring circuit 17 will be described in more detail. The memory 7 is equipped with a redundant circuit for detecting failures such as RAM data falsification or data corruption due to attacks or cosmic rays, specifically a parity function or an error detection code (EDC) function. By comparing some or all of the data with the output of the redundant circuit that received the data at the time of interruption, checking the consistency, if there is a problem, by stopping the chip operation by issuing a reset request signal, etc. Make the attack fail. Even at the time of interruption, it is made more difficult to malfunction due to multiple failures of data and redundant circuits by periodically checking the consistency.

これにより、コプロセッサ10の演算が中断されている期間に、メモリ7の内容に意図しない変化が発生した場合にも、それを検出することができ、メモリ7に保持されるデータについて、セキュリティ性能が低下するのを防止することができる。   As a result, even if an unintended change occurs in the contents of the memory 7 during the period when the calculation of the coprocessor 10 is interrupted, it can be detected, and the security performance of the data held in the memory 7 can be detected. Can be prevented from decreasing.

メモリ7は、格納するデータにパリティまたは誤り検出符号を付与し、格納されたデータに付与されたパリティまたは誤り検出符号の正当性を検証する機能を備える。メモリ監視回路17は、その正当性の検証結果が入力され、正当性が損なわれたときに、そのことをCPU2に対して通知可能に構成される。CPU2への通知方法は、例えば、割り込み、ステータスレジスタ、または、セキュリティリセットなどである。   The memory 7 has a function of adding a parity or error detection code to stored data and verifying the validity of the parity or error detection code added to the stored data. The memory monitoring circuit 17 is configured to be able to notify the CPU 2 when the validity verification result is input and the validity is lost. The notification method to the CPU 2 is, for example, an interrupt, a status register, or a security reset.

これにより、簡便かつ的確にメモリに格納された値を監視することができる。コプロセッサ10の中断時にパリティ機能やEDC機能を動作させて、データ格納用メモリ7から中間値、および冗長ビットを定期的にリードする事で、データ改ざん、データ化けを困難にさせることができる。   Thereby, the value stored in the memory can be monitored easily and accurately. By operating the parity function or EDC function when the coprocessor 10 is interrupted and periodically reading the intermediate value and the redundant bit from the data storage memory 7, it is possible to make it difficult to tamper with the data and garble the data.

図8に示したセキュリティ回路13は、データバスマスク用の乱数生成回路15と乱数発生状態監視回路16とRAM監視回路17とを含んで構成される例を示したが、RAM監視回路17のみを備えていれば上記の効果を奏する。一方、コプロセッサ10の演算の途中経過を保護するための別のセキュリティ回路を含んで構成されてもよい。   Although the security circuit 13 shown in FIG. 8 is configured to include the random number generation circuit 15 for the data bus mask, the random number generation state monitoring circuit 16, and the RAM monitoring circuit 17, only the RAM monitoring circuit 17 is shown. If it is provided, the above-described effects can be obtained. On the other hand, another security circuit for protecting the progress of the calculation of the coprocessor 10 may be included.

〔実施形態3〕
図9は、実施形態3に係る半導体装置の構成を表すブロック図である。
[Embodiment 3]
FIG. 9 is a block diagram illustrating a configuration of a semiconductor device according to the third embodiment.

実施形態3に係る半導体装置において、図8に示した実施形態2に係る半導体装置1との違いは、クロック生成回路(CPG)5が、クロック制御回路1(18)とクロック制御回路2(19)を含んで構成される点である。クロック制御回路1(18)は、CPU2、タイマ3及び割り込み制御回路6にクロックCLK1を供給する。クロック制御回路2(19)は、メモリ7と、コプロセッサ10の演算器11、演算制御回路12、セキュリティ回路13及び停止起動制御回路14とに、クロックCLK2を供給する。他の構成及び動作は、実施形態1と同様であるので、詳細な説明は省略する。   The semiconductor device according to the third embodiment is different from the semiconductor device 1 according to the second embodiment shown in FIG. 8 in that the clock generation circuit (CPG) 5 includes a clock control circuit 1 (18) and a clock control circuit 2 (19 ). The clock control circuit 1 (18) supplies the clock CLK1 to the CPU 2, the timer 3 and the interrupt control circuit 6. The clock control circuit 2 (19) supplies the clock CLK2 to the memory 7, the arithmetic unit 11, the arithmetic control circuit 12, the security circuit 13, and the stop / start control circuit 14 of the coprocessor 10. Since other configurations and operations are the same as those in the first embodiment, detailed description thereof is omitted.

コプロセッサ10が演算処理の実行中にタイマ割り込みが発生したとき、クロックCLK2の供給が継続されることにより、セキュリティ回路13の動作が継続され、コプロセッサ10によるメモリ7へのアクセスが完了した後に、演算器用停止制御信号により、演算器11と演算制御回路12の動作を停止させる。   When a timer interrupt occurs while the coprocessor 10 is executing arithmetic processing, the supply of the clock CLK2 is continued, so that the operation of the security circuit 13 is continued and the access to the memory 7 by the coprocessor 10 is completed. The operation of the arithmetic unit 11 and the arithmetic control circuit 12 is stopped by the arithmetic unit stop control signal.

これにより、コプロセッサ10へ供給されるクロック信号(CLK2)をCPU2へ供給されるクロック信号(CLK1)と独立に制御することを可能とすることができる。   As a result, the clock signal (CLK2) supplied to the coprocessor 10 can be controlled independently of the clock signal (CLK1) supplied to the CPU 2.

図9に示したセキュリティ回路13は、データバスマスク用の乱数生成回路15と乱数発生状態監視回路16とRAM監視回路17とを含んで構成される例を示したが、乱数生成回路15と乱数発生状態監視回路16、または、RAM監視回路17のいずれか一方であってもよく、コプロセッサ10の演算の途中経過を保護するための別のセキュリティ回路を含んで構成されてもよい。   Although the security circuit 13 shown in FIG. 9 is configured to include the random number generation circuit 15 for the data bus mask, the random number generation state monitoring circuit 16, and the RAM monitoring circuit 17, the random number generation circuit 15 and the random number generation circuit 15 are shown. Either the occurrence state monitoring circuit 16 or the RAM monitoring circuit 17 may be used, and another security circuit for protecting the progress of the calculation of the coprocessor 10 may be included.

図10は、CLK1=CLK2の場合の動作を表すタイミングチャートである。   FIG. 10 is a timing chart showing the operation when CLK1 = CLK2.

図3、4、5に示した実施形態1に係る半導体装置1の動作タイミングと同様であるが、クロック信号(CLK1)とクロック信号(CLK2)とが、それぞれCPU2とコプロセッサ10へ独立に供給される点で相違する。   Although the operation timing is the same as that of the semiconductor device 1 according to the first embodiment shown in FIGS. 3, 4, and 5, the clock signal (CLK 1) and the clock signal (CLK 2) are independently supplied to the CPU 2 and the coprocessor 10, respectively. Is different.

CLK1はCLKと同様に時刻t1から供給され、CLK2はコプロセッサ10が演算状態になる、時刻t2から供給される。CLK1は、CPU2がスリープ状態にある、時刻t2から時刻t6までの期間と時刻t11以降の期間は、供給を停止される。一方、CLK2はコプロセッサ10が中断状態にある時刻t7から時刻t11までの期間も供給を継続される。   CLK1 is supplied from time t1 in the same manner as CLK, and CLK2 is supplied from time t2 when the coprocessor 10 is in the computing state. The supply of CLK1 is stopped during the period from time t2 to time t6 and the period after time t11 when the CPU 2 is in the sleep state. On the other hand, the supply of CLK2 is continued during a period from time t7 to time t11 when the coprocessor 10 is suspended.

CPU2がスリープ状態にある期間にCLK1の供給を停止することにより、半導体装置1の消費電力を低減することができ、コプロセッサ10が演算処理を中断状態にある期間も、CLK2の供給を継続することにより、セキュリティ回路13の動作を継続させ、セキュリティ性能が低下するのを防止することができる。   By stopping the supply of CLK1 during the period in which the CPU 2 is in the sleep state, the power consumption of the semiconductor device 1 can be reduced, and the supply of CLK2 is continued even during the period in which the coprocessor 10 is in the processing interruption state. As a result, the operation of the security circuit 13 can be continued and the security performance can be prevented from deteriorating.

図11は、CLK2の周波数を下げる場合の動作を表すタイミングチャートである。   FIG. 11 is a timing chart showing the operation when the frequency of CLK2 is lowered.

図10に示した動作タイミングとの違いは、コプロセッサ10が演算処理を中断状態にある時刻t7から時刻t11までの期間に、CLK2の周波数を低下させる点である。クロック周波数を変更するには、クロック信号に波形の乱れが発生しないようにするため、ある程度の遅延が生じる。図11では、時刻t8から時刻12までの期間のCLK2の周波数を、4分の1に低下させた例を示している。   The difference from the operation timing shown in FIG. 10 is that the frequency of CLK2 is lowered during the period from time t7 to time t11 when the coprocessor 10 is in the processing interruption state. In order to change the clock frequency, a certain amount of delay is caused in order to prevent the clock signal from being disturbed. FIG. 11 shows an example in which the frequency of CLK2 in the period from time t8 to time 12 is reduced to a quarter.

クロック周波数を低下させても耐タンパー性を維持することができるセキュリティ回路であれば、セキュリティ性能の低下を防止しながら、コプロセッサ10の中断中の消費電力を低減することができる。データをマスクするための乱数発生回路15は、クロック周波数が低下されても乱数の発生を継続する。周波数の低下に伴って乱数値が保持される時間は長くなるため、外部からの攻撃によってプロービングされる可能性は若干高まるものの、コプロセッサ10の中断期間よりも極めて短い期間であるので、大幅なセキュリティ性能の低下は防止される。乱数発生状態監視回路16は、乱数発生回路15と同じ周波数で動作すれば、セキュリティ性能の低下はない。メモリ(RAM)監視回路17は、クロック周波数の低下に伴って監視の周期が長くなり、外部からの攻撃を検知する能力が若干低下するものの、コプロセッサ10の中断期間よりも極めて短い期間であるので、大幅なセキュリティ性能の低下は防止される。   If the security circuit can maintain tamper resistance even when the clock frequency is lowered, the power consumption during the interruption of the coprocessor 10 can be reduced while preventing the security performance from being lowered. The random number generation circuit 15 for masking data continues to generate random numbers even when the clock frequency is lowered. Since the time for which the random number value is held increases as the frequency decreases, the probability of being probed by an attack from the outside increases slightly, but since the period is extremely shorter than the interruption period of the coprocessor 10, A decrease in security performance is prevented. If the random number generation state monitoring circuit 16 operates at the same frequency as the random number generation circuit 15, there is no deterioration in security performance. The memory (RAM) monitoring circuit 17 is a period that is extremely shorter than the interruption period of the coprocessor 10 although the monitoring cycle becomes longer as the clock frequency decreases and the ability to detect an attack from the outside slightly decreases. Therefore, a significant decrease in security performance is prevented.

クロック制御回路2(19)は、クロックCLKと中断許可信号が入力され、中断許可信号が活性化されている期間、CLKを分周してCLK2に出力する回路で構成することができる。分周によって周波数を低下させることにより、瞬時に周波数を変更することができる。図11に示したCLK2の周波数の変更のための遅延である時刻t7から時刻t8の期間と時刻t11から時刻t12までの期間を最小限に抑えることができる。   The clock control circuit 2 (19) can be constituted by a circuit that divides CLK and outputs it to CLK2 while the clock CLK and the suspension permission signal are input and the suspension permission signal is activated. By reducing the frequency by frequency division, the frequency can be changed instantaneously. The period from time t7 to time t8 and the period from time t11 to time t12, which are delays for changing the frequency of CLK2 shown in FIG. 11, can be minimized.

以上本発明者によってなされた発明を実施形態に基づいて具体的に説明したが、本発明はそれに限定されるものではなく、その要旨を逸脱しない範囲において種々変更可能であることは言うまでもない。   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.

例えば、ブロック図に示した回路ブロックの包含関係や名称は一例であって、ブロック分割の方法は柔軟に決めることができる。また、タイミングチャートに示した信号の、ハイアクティブ/ロウアクティブは、任意に決めることができる。   For example, the inclusion relations and names of the circuit blocks shown in the block diagram are examples, and the block division method can be determined flexibly. Further, high active / low active of the signals shown in the timing chart can be arbitrarily determined.

1 半導体装置
2 CPU
3 タイマ(TMR)
5 クロック発生回路(CPG)
6 割り込み制御回路(INTC)
7 メモリ(RAM)
8 バス
10 コプロセッサ
11 演算器
12 演算制御回路
13 セキュリティ回路
14 停止起動回路
15 乱数発生回路
16 乱数発生状態監視回路
17 メモリ(RAM)監視回路
18、19 クロック制御回路
20 フリップフロップ(FF)
21 フィードバック付きFF
22 ゲーテッドクロック付きFF
23 クロックゲート
24 セレクタ
25 セレクタ
30〜34 組合せ回路
40〜41 演算回路
1 Semiconductor device 2 CPU
3 Timer (TMR)
5 Clock generation circuit (CPG)
6 Interrupt control circuit (INTC)
7 Memory (RAM)
8 Bus 10 Coprocessor 11 Operation Unit 12 Operation Control Circuit 13 Security Circuit 14 Stop Start Circuit 15 Random Number Generation Circuit 16 Random Number Generation Status Monitoring Circuit 17 Memory (RAM) Monitoring Circuit 18, 19 Clock Control Circuit 20 Flip-flop (FF)
21 FF with feedback
22 FF with gated clock
23 clock gate 24 selector 25 selector 30-34 combination circuit 40-41 arithmetic circuit

Claims (12)

CPUと、タイマ割り込みを発生するタイマと、コプロセッサとを備える半導体装置であって、
前記コプロセッサは、演算器と、前記演算器を制御する演算制御回路と、前記演算器の入出力データを外部からの攻撃から保護するセキュリティ回路と、停止起動制御回路とを含んで構成され、
前記コプロセッサによる演算処理の実行中に前記タイマ割り込みが発生したとき、前記停止起動制御回路は、前記セキュリティ回路の動作を継続させたまま、前記演算器と前記演算制御回路の動作を停止させる、半導体装置。
A semiconductor device comprising a CPU, a timer for generating a timer interrupt, and a coprocessor,
The coprocessor includes an arithmetic unit, an arithmetic control circuit that controls the arithmetic unit, a security circuit that protects input / output data of the arithmetic unit from an external attack, and a stop / start control circuit,
When the timer interrupt occurs during execution of arithmetic processing by the coprocessor, the stop activation control circuit stops the operation of the arithmetic unit and the arithmetic control circuit while continuing the operation of the security circuit. Semiconductor device.
請求項1において、前記セキュリティ回路は、前記演算器の入出力データをマスクするための乱数を発生する、乱数発生回路を含んで構成される、半導体装置。   2. The semiconductor device according to claim 1, wherein the security circuit includes a random number generation circuit that generates a random number for masking input / output data of the arithmetic unit. 請求項2において、前記セキュリティ回路は、さらに、前記乱数発生回路による乱数発生状態を監視する、乱数発生状態監視回路を含んで構成される、半導体装置。   3. The semiconductor device according to claim 2, wherein the security circuit further includes a random number generation state monitoring circuit that monitors a random number generation state by the random number generation circuit. 請求項1において、前記半導体装置は、前記コプロセッサによってアクセス可能なメモリをさらに備え、
前記停止起動制御回路は、前記コプロセッサによる演算処理の実行中の前記タイマ割り込みが発生したとき、前記コプロセッサによる前記メモリへのアクセスが完了した後に、前記演算器と前記演算制御回路の動作を停止させる、半導体装置。
2. The semiconductor device according to claim 1, further comprising a memory accessible by the coprocessor,
When the timer interrupt during the execution of the arithmetic processing by the coprocessor occurs, the stop / start control circuit performs operations of the arithmetic unit and the arithmetic control circuit after the access to the memory by the coprocessor is completed. A semiconductor device to be stopped.
請求項4において、前記半導体装置は、前記タイマから発行されるタイマ割り込み信号が入力され、前記CPUに対してCPU割り込み信号を出力する割り込み制御回路をさらに備え、
前記演算制御回路は前記メモリに対して、前記コプロセッサによる前記メモリへのアクセスに際して、リードコマンドまたはライトコマンドを発行し、アクセスしないときにNOPコマンドを発行可能に構成され、
前記停止起動制御回路は、前記コプロセッサによる演算処理の実行中の前記タイマ割り込みが発生したとき、前記NOPコマンドが連続して発行された後に、前記演算器と前記演算制御回路の動作を停止させる、半導体装置。
5. The semiconductor device according to claim 4, further comprising an interrupt control circuit that receives a timer interrupt signal issued from the timer and outputs a CPU interrupt signal to the CPU.
The arithmetic control circuit is configured to issue a read command or a write command to the memory when the coprocessor accesses the memory, and issue a NOP command when not accessing the memory.
The stop / start control circuit stops the operation of the arithmetic unit and the arithmetic control circuit after the NOP command is continuously issued when the timer interrupt occurs during the execution of arithmetic processing by the coprocessor. , Semiconductor devices.
請求項5において、前記半導体装置は、前記タイマ割り込みに際して前記タイマから発行されるタイマ割り込み信号が入力され、前記停止起動制御回路から中断許可信号が入力され、前記CPUに対してCPU割り込み信号を出力する割り込み制御回路をさらに備え、
前記割り込み制御回路は、前記中断許可信号によって前記タイマ割り込み信号をマスクすることにより、前記CPU割り込み信号の出力をマスク可能に構成され、
前記停止起動制御回路は、前記コプロセッサによる演算処理の実行中の前記タイマ割り込みが発生したとき、前記中断許可信号を中断禁止状態にし、前記NOPコマンドが連続して発行された後に、前記中断許可信号を中断許可状態にする、半導体装置。
6. The semiconductor device according to claim 5, wherein a timer interrupt signal issued from the timer at the time of the timer interrupt is input, an interrupt permission signal is input from the stop / start control circuit, and a CPU interrupt signal is output to the CPU An interrupt control circuit for
The interrupt control circuit is configured to mask the output of the CPU interrupt signal by masking the timer interrupt signal with the interruption permission signal,
The stop / start control circuit sets the suspension permission signal to a suspension prohibited state when the timer interrupt during execution of the arithmetic processing by the coprocessor occurs, and after the NOP command is continuously issued, the suspension permission signal A semiconductor device in which a signal is allowed to be interrupted.
請求項4において、前記セキュリティ回路は、前記メモリに保持されるデータが改変されたことを監視する、メモリ監視回路を含んで構成される、半導体装置。   5. The semiconductor device according to claim 4, wherein the security circuit includes a memory monitoring circuit that monitors that data held in the memory has been altered. 請求項7において、前記メモリは、格納するデータにパリティまたは誤り検出符号を付与し、格納されたデータに付与されたパリティまたは誤り検出符号の正当性を検証する機能を備え、
前記メモリ監視回路は、前記正当性の検証結果が入力され、正当性が損なわれたときに前記CPUに対して通知可能に構成される、半導体装置。
The memory according to claim 7, wherein the memory has a function of adding a parity or error detection code to stored data and verifying the validity of the parity or error detection code added to the stored data,
The memory monitoring circuit is a semiconductor device configured to be able to notify the CPU when the validity verification result is inputted and the validity is impaired.
請求項1において、前記演算器と前記演算制御回路は、出力を入力にフィードバックすることによって保持する値の更新を抑制可能な記憶回路を備え、
前記コプロセッサによる演算処理の実行中に前記タイマ割り込みが発生したとき、前記停止起動制御回路は、前記記憶回路に保持される値の更新を抑制することによって、前記演算器と前記演算制御回路の動作を停止させる、半導体装置。
In Claim 1, the said arithmetic unit and the said arithmetic control circuit are provided with the memory | storage circuit which can suppress the update of the value hold | maintained by feeding back an output to an input,
When the timer interrupt occurs during the execution of the arithmetic processing by the coprocessor, the stop / start control circuit suppresses updating of the value held in the storage circuit, whereby the arithmetic unit and the arithmetic control circuit A semiconductor device that stops operation.
請求項4において、前記演算器と前記演算制御回路と前記セキュリティ回路と前記メモリとには、同一系統のクロックが供給され、
前記演算器と前記演算制御回路は、前記クロックが入力され、出力を入力にフィードバックすることによって保持する値の更新を抑制可能な記憶回路を備え、
前記コプロセッサによる演算処理の実行中の前記タイマ割り込みが発生したとき、前記クロックの供給が継続されることにより、前記セキュリティ回路の動作が継続され、前記コプロセッサによる前記メモリへのアクセスが完了した後に、前記停止起動制御回路は、前記記憶回路に保持される値の更新を抑制することによって、前記演算器と前記演算制御回路の動作を停止させる、半導体装置。
In Claim 4, a clock of the same system is supplied to the arithmetic unit, the arithmetic control circuit, the security circuit, and the memory,
The arithmetic unit and the arithmetic control circuit each include a memory circuit that is capable of suppressing an update of a value held by inputting the clock and feeding back an output to the input.
When the timer interrupt during the execution of the arithmetic processing by the coprocessor occurs, the supply of the clock is continued, so that the operation of the security circuit is continued and the access to the memory by the coprocessor is completed. Later, the stop activation control circuit stops the operation of the arithmetic unit and the arithmetic control circuit by suppressing the update of the value held in the memory circuit.
請求項10において、前記コプロセッサによる前記メモリへの前記アクセスが完了した後に、前記クロックの周波数を低下させる、半導体装置。   11. The semiconductor device according to claim 10, wherein the frequency of the clock is reduced after the access to the memory by the coprocessor is completed. 請求項11において、前記半導体装置は、前記クロックを供給するクロック発生回路と、前記タイマから発行されるタイマ割り込み信号が入力され、前記停止起動制御回路から中断許可信号が入力され、前記CPUに対してCPU割り込み信号を出力する割り込み制御回路とをさらに備え、
前記割り込み制御回路は、前記中断許可信号によって前記タイマ割り込み信号をマスクすることにより、前記CPU割り込み信号の出力をマスク可能に構成され、
前記演算制御回路は前記メモリに対して、前記コプロセッサによる前記メモリへのアクセスに際して、リードコマンドまたはライトコマンドを発行し、アクセスしないときにNOPコマンドを発行可能に構成され、
前記停止起動制御回路は、前記コプロセッサによる演算処理の実行中の前記タイマ割り込みが発生したとき、前記中断許可信号を中断禁止状態にし、前記NOPコマンドが所定回数連続して発行された後に、前記中断許可信号を中断許可状態にし、
前記クロック発生回路は、前記中断許可信号が中断許可状態のときに、入力されているクロックソースを分周することによって前記クロックの周波数を低下させる、半導体装置。
12. The semiconductor device according to claim 11, wherein a clock generation circuit that supplies the clock and a timer interrupt signal issued from the timer are input, and an interruption permission signal is input from the stop / start control circuit, to the CPU And an interrupt control circuit for outputting a CPU interrupt signal.
The interrupt control circuit is configured to mask the output of the CPU interrupt signal by masking the timer interrupt signal with the interruption permission signal,
The arithmetic control circuit is configured to issue a read command or a write command to the memory when the coprocessor accesses the memory, and issue a NOP command when not accessing the memory.
The stop / start control circuit sets the suspension permission signal to a suspension prohibited state when the timer interrupt during execution of the arithmetic processing by the coprocessor occurs, and after the NOP command is continuously issued a predetermined number of times, Set the suspension permission signal to the suspension permission state,
The clock generation circuit reduces the frequency of the clock by dividing an input clock source when the interruption permission signal is in an interruption permission state.
JP2013015226A 2013-01-30 2013-01-30 Semiconductor device Pending JP2014147010A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013015226A JP2014147010A (en) 2013-01-30 2013-01-30 Semiconductor device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013015226A JP2014147010A (en) 2013-01-30 2013-01-30 Semiconductor device

Publications (1)

Publication Number Publication Date
JP2014147010A true JP2014147010A (en) 2014-08-14

Family

ID=51426925

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013015226A Pending JP2014147010A (en) 2013-01-30 2013-01-30 Semiconductor device

Country Status (1)

Country Link
JP (1) JP2014147010A (en)

Similar Documents

Publication Publication Date Title
Qiu et al. Voltjockey: Breaching trustzone by software-controlled voltage manipulation over multi-core frequencies
JP4030719B2 (en) Intelligent IC
Kong et al. PUFatt: Embedded platform attestation based on novel processor-based PUFs
US9792229B2 (en) Protecting a memory
US8438658B2 (en) Providing sealed storage in a data processing device
US20160125187A1 (en) System and Method for a Renewable Secure Boot
US7774616B2 (en) Masking a boot sequence by providing a dummy processor
US7779273B2 (en) Booting a multiprocessor device based on selection of encryption keys to be provided to processors
US8046573B2 (en) Masking a hardware boot sequence
US20080229092A1 (en) Secure Boot Across a Plurality of Processors
US11222144B2 (en) Self-encrypting storage device and protection method
US10678927B2 (en) Randomized execution countermeasures against fault injection attacks during boot of an embedded device
JP7005576B2 (en) An electronic device that uses a small overhead random precharge to prevent side-channel attacks
US20070288739A1 (en) System and method for masking a boot sequence by running different code on each processor
US20160188874A1 (en) System and method for secure code entry point control
JP6513463B2 (en) Semiconductor integrated circuit
JP2010011353A (en) Arithmetic processing unit
Mahmoud et al. Electrical-level attacks on CPUs, FPGAs, and GPUs: Survey and implications in the heterogeneous era
US9536086B2 (en) Circuit arrangement, a method for forming a circuit arrangement, and method for integrity checking
ES2894890T3 (en) Sequence verification
Gross et al. Fpganeedle: Precise remote fault attacks from fpga to cpu
JP2019514094A (en) Control the transition between operating mode and test mode
JP2014147010A (en) Semiconductor device
US20190097801A1 (en) Apparatus for Protection of Electronic Circuitry and Associated Methods
Easter et al. S/390 parallel enterprise server CMOS cryptographic coprocessor