JP2005071203A - Microprocessor - Google Patents
Microprocessor Download PDFInfo
- Publication number
- JP2005071203A JP2005071203A JP2003302404A JP2003302404A JP2005071203A JP 2005071203 A JP2005071203 A JP 2005071203A JP 2003302404 A JP2003302404 A JP 2003302404A JP 2003302404 A JP2003302404 A JP 2003302404A JP 2005071203 A JP2005071203 A JP 2005071203A
- Authority
- JP
- Japan
- Prior art keywords
- clock
- peripheral
- cpu
- frequency
- generation unit
- 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
Links
Images
Landscapes
- Microcomputers (AREA)
Abstract
Description
この発明は、マイクロプロセッサに関する。 The present invention relates to a microprocessor.
従来から、タイマやシリアルI/Oポートなどの周辺I/Oを内蔵し、かかる周辺I/Oに供給されるクロックの周波数を変更することが可能なマイクロプロセッサが提案されている。なお、マイクロプロセッサに関する技術が特許文献1に開示されている。
Conventionally, there has been proposed a microprocessor that incorporates peripheral I / O such as a timer and a serial I / O port and can change the frequency of a clock supplied to the peripheral I / O. A technique relating to a microprocessor is disclosed in
従来のマイクロプロセッサにおいては、周辺I/Oに供給するクロックの周波数を変更する際、CPUが周波数の変更の要求を行ってから実際に変更されるまで時間差を生じる。そのため、周波数が切り替わる前に周辺I/Oを動作させてしまうことがあり、これによってマイクロプロセッサが誤動作することがある。また、周辺I/Oに供給されるクロックの周波数は可変であるため、CPUの実行プログラムの不具合等により、周辺I/Oの動作仕様外の周波数を有するクロックが周辺I/Oに入力されたり、周辺I/Oの動作中に周辺I/Oへ供給されるクロックの周波数が変更されることがあり、これらによってマイクロプロセッサが誤動作することがある。 In the conventional microprocessor, when the frequency of the clock supplied to the peripheral I / O is changed, there is a time difference from when the CPU requests the change of the frequency to when it is actually changed. Therefore, the peripheral I / O may be operated before the frequency is switched, which may cause the microprocessor to malfunction. In addition, since the frequency of the clock supplied to the peripheral I / O is variable, a clock having a frequency outside the operation specifications of the peripheral I / O is input to the peripheral I / O due to a defect in the execution program of the CPU. The frequency of the clock supplied to the peripheral I / O may be changed during the operation of the peripheral I / O, which may cause the microprocessor to malfunction.
そこで、本発明は上述の問題に鑑みて成されたものであり、マイクロプロセッサの誤動作を低減することが可能な技術を提供することを目的とする。 Accordingly, the present invention has been made in view of the above-described problems, and an object thereof is to provide a technique capable of reducing malfunction of a microprocessor.
この発明の第1のマイクロプロセッサは、割り込み機能を有するCPUと、周波数可変にクロックを出力するクロック生成部と、前記クロックに基づいて動作を行い、前記CPUからアクセスされる周辺I/Oと、割り込み発生部とを備え、前記クロック生成部は、前記CPUからの変更要求に基づいて前記クロックの周波数を変更し、前記割り込み発生部は、前記クロック生成部での前記クロックの周波数の変更が完了すると、前記CPUに割り込み要求を通知する。 A first microprocessor according to the present invention includes a CPU having an interrupt function, a clock generation unit that outputs a clock with variable frequency, a peripheral I / O that operates based on the clock and is accessed from the CPU, An interrupt generator, wherein the clock generator changes the frequency of the clock based on a change request from the CPU, and the interrupt generator completes the change of the clock frequency in the clock generator Then, an interrupt request is notified to the CPU.
また、この発明の第2のマイクロプロセッサは、CPUと、周波数可変にクロックを出力するクロック生成部と、前記クロックに基づいて動作を行い、前記CPUからのアクセス要求に対する確認応答信号を前記CPUに出力する周辺I/Oと、クロック変更完了判定部とを備え、前記CPUは、前記周辺I/Oに前記アクセス要求を通知した際には、前記周辺I/Oから前記確認応答信号を受け取った後に次の動作を行い、前記クロック生成部は、前記CPUからの変更要求に基づいて前記クロックの周波数を変更し、前記クロック変更完了判定部は、前記クロック生成部での前記クロックの周波数の変更中を示すビジー信号と、前記クロック生成部での前記クロックの周波数の変更の完了を示す完了信号とを前記周辺I/Oに出力し、前記周辺I/Oは、前記ビジー信号が入力されている状態で前記CPUから前記アクセス要求があるときには、前記完了信号の入力後に、前記確認応答信号を出力する。 According to a second microprocessor of the present invention, a CPU, a clock generation unit that outputs a clock with variable frequency, an operation based on the clock, and an acknowledgment signal for an access request from the CPU are sent to the CPU. The CPU includes a peripheral I / O for outputting and a clock change completion determination unit, and the CPU receives the confirmation response signal from the peripheral I / O when the access request is notified to the peripheral I / O. The following operation is performed later, the clock generation unit changes the frequency of the clock based on a change request from the CPU, and the clock change completion determination unit changes the frequency of the clock in the clock generation unit A busy signal indicating the inside and a completion signal indicating the completion of the change of the frequency of the clock in the clock generation unit are output to the peripheral I / O. Peripheral I / O, when the busy signal is the access request from the CPU in a state that is entered, after the input of the completion signal, and outputs the acknowledgment signal.
また、この発明の第3のマイクロプロセッサは、CPUと、周波数可変にクロックを出力するクロック生成部と、前記クロックに基づいて動作を行う周辺I/Oと、前記クロックの前記周辺I/Oへの供給を制御するクロック供給制御部とを備え、前記クロック生成部は、前記CPUからの変更要求に基づいて前記クロックの周波数を変更し、前記クロック供給制御部は、前記クロック生成部における前記クロックの変更先の周波数が所定の周波数と一致するかどうかを検出する検出回路を有し、前記検出回路の検出結果に基づき前記クロックを前記周辺I/Oへ供給するか否かを制御するの検出結果に基づき前記クロックを前記周辺I/Oへ供給するか否かを制御する。 The third microprocessor of the present invention includes a CPU, a clock generation unit that outputs a clock with variable frequency, a peripheral I / O that operates based on the clock, and the peripheral I / O of the clock. A clock supply control unit that controls supply of the clock, the clock generation unit changes the frequency of the clock based on a change request from the CPU, and the clock supply control unit is configured to change the clock in the clock generation unit. Detection circuit for detecting whether or not the frequency to be changed coincides with a predetermined frequency, and detecting whether or not to supply the clock to the peripheral I / O based on the detection result of the detection circuit Based on the result, it is controlled whether or not the clock is supplied to the peripheral I / O.
また、この発明の第4のマイクロプロセッサは、CPUと、周波数可変にクロックを出力するクロック生成部と、前記クロックに基づいて動作する周辺I/Oと、前記CPUからの前記周辺I/Oへのアクセスを制御するアクセス制御部とを備え、前記クロック生成部は、前記CPUからの変更要求に基づいて前記クロックの周波数を変更し、前記アクセス制御部は、前記クロック生成部における前記クロックの変更先の周波数が所定の周波数と一致するかどうかを検出する検出回路を有し、前記検出回路の検出結果に基づき前記CPUからの前記周辺I/Oへのアクセスを許可するか否かを制御する。 The fourth microprocessor of the present invention includes a CPU, a clock generation unit that outputs a clock with variable frequency, a peripheral I / O that operates based on the clock, and the peripheral I / O from the CPU. An access control unit that controls access to the clock, wherein the clock generation unit changes the frequency of the clock based on a change request from the CPU, and the access control unit changes the clock in the clock generation unit It has a detection circuit for detecting whether or not the previous frequency matches a predetermined frequency, and controls whether to permit access to the peripheral I / O from the CPU based on the detection result of the detection circuit. .
また、この発明の第5のマイクロプロセッサは、周波数可変にクロックを出力するクロック生成部と、前記クロックに基づいて動作を行う周辺I/Oと、前記クロックの周波数に対する変更要求を前記クロック生成部に出力するCPUと、前記クロック生成部への前記変更要求の通知を許可するか否かの制御を行うクロック変更制御部とを備え、前記クロック変更制御部は、前記制御において、前記周辺I/Oが動作していないときには、前記クロック生成部への前記変更要求の通知を許可し、前記周辺I/Oが動作中のときには、前記クロック生成部への前記変更要求の通知を許可せず、前記クロック生成部は、前記変更要求に基づいて前記クロックの周波数を変更する。 The fifth microprocessor of the present invention includes a clock generation unit that outputs a clock with a variable frequency, a peripheral I / O that operates based on the clock, and a change request for the frequency of the clock. And a clock change control unit that controls whether or not to permit notification of the change request to the clock generation unit, and the clock change control unit includes the peripheral I / O in the control. When O is not operating, the notification of the change request to the clock generation unit is permitted. When the peripheral I / O is operating, the notification of the change request to the clock generation unit is not permitted. The clock generation unit changes the frequency of the clock based on the change request.
また、この発明の第6のマイクロプロセッサは、周波数可変にクロックを出力するクロック生成部と、前記クロックに基づいて動作を行う周辺I/Oと、前記クロックの周波数に対する変更要求と、前記クロックの周波数の変更先を示す第1の情報とを前記クロック生成部に出力するCPUと、前記クロック生成部への前記変更要求の通知を許可するか否かの制御を行うクロック変更制御部とを備え、前記クロック変更制御部は、前記第1の情報が示す周波数が所定の周波数と一致するかどうかを検出する検出回路を有し、前記検出回路の検出結果に基づき前記クロック生成部への前記変更要求の通知を許可するか否かを制御し、前記クロック生成部は、前記第1の情報及び前記変更要求に基づいて前記クロックの周波数を変更する。 According to a sixth aspect of the present invention, there is provided a clock generation unit that outputs a clock with variable frequency, a peripheral I / O that operates based on the clock, a change request for the frequency of the clock, A CPU that outputs first information indicating a frequency change destination to the clock generation unit; and a clock change control unit that controls whether or not to permit notification of the change request to the clock generation unit. The clock change control unit includes a detection circuit that detects whether or not a frequency indicated by the first information matches a predetermined frequency, and the change to the clock generation unit is performed based on a detection result of the detection circuit. Whether or not to permit notification of the request is controlled, and the clock generation unit changes the frequency of the clock based on the first information and the change request.
この発明の第1のマイクロプロセッサによれば、周辺I/Oに入力されるクロックの周波数が変更された後にCPUに割り込み要求が通知される。これにより、CPUは、クロック生成部でのクロック周波数の変更が完了したことを認識することができる。従って、CPUが、割り込み発生部から割り込み要求を受け取った後に周辺I/Oにアクセスすることによって、クロック周波数が変更される前にCPUが周辺I/Oにアクセスすることを防止することができる。その結果、マイクロプロセッサの誤動作を防止することができる。 According to the first microprocessor of the present invention, an interrupt request is notified to the CPU after the frequency of the clock input to the peripheral I / O is changed. Thereby, the CPU can recognize that the change of the clock frequency in the clock generation unit has been completed. Accordingly, by accessing the peripheral I / O after the CPU receives the interrupt request from the interrupt generation unit, the CPU can be prevented from accessing the peripheral I / O before the clock frequency is changed. As a result, malfunction of the microprocessor can be prevented.
また、この発明の第2のマイクロプロセッサによれば、クロック生成部でのクロック周波数の変更中にCPUからのアクセス要求が通知された場合には、クロック周波数の変更が完了した後に、周辺I/Oは確認応答信号をCPUに出力している。従って、クロック周波数の変更中にCPUが再度周辺I/Oにアクセスすることを防止することができる。その結果、クロック周波数が変更されていない状態で周辺I/Oが動作することを低減できる。その結果、マイクロプロセッサの誤動作を低減することができる。 According to the second microprocessor of the present invention, when an access request from the CPU is notified during the change of the clock frequency in the clock generation unit, the peripheral I / O is changed after the change of the clock frequency is completed. O outputs an acknowledgment signal to the CPU. Therefore, it is possible to prevent the CPU from accessing the peripheral I / O again while changing the clock frequency. As a result, it is possible to reduce the peripheral I / O from operating when the clock frequency is not changed. As a result, malfunction of the microprocessor can be reduced.
また、この発明の第3のマイクロプロセッサによれば、検出回路での所定の周波数として、周辺I/Oにとっての不当な周波数、例えば周辺I/Oの動作仕様外の周波数を採用することによって、CPUの実行プログラムの不具合等により、クロックの周波数が不当な周波数に変更された場合であっても、周辺I/Oには当該不当な周波数を有するクロックは入力されない。そのため、周辺I/Oの誤動作を低減することができ、マイクロプロセッサの誤動作を低減できる。 Further, according to the third microprocessor of the present invention, by adopting an inappropriate frequency for the peripheral I / O, for example, a frequency outside the operation specifications of the peripheral I / O, as the predetermined frequency in the detection circuit, Even if the frequency of the clock is changed to an inappropriate frequency due to a defect in the execution program of the CPU, a clock having the inappropriate frequency is not input to the peripheral I / O. Therefore, malfunctions of peripheral I / O can be reduced, and malfunctions of the microprocessor can be reduced.
また、この発明の第4のマイクロプロセッサによれば、検出回路での所定の周波数として、周辺I/Oにとっての不当な周波数、例えば周辺I/Oの動作仕様外の周波数を採用することによって、CPUの実行プログラムの不具合等により、不当な周波数を有するクロックが入力された状態でCPUが周辺I/Oにアクセスしようとしたとしても、実際にアクセスされることを防止することができる。その結果、不当な周波数を有するクロックが入力されている周辺I/Oを動作させることがないため、マイクロプロセッサの誤動作を低減できる。 Further, according to the fourth microprocessor of the present invention, by adopting an inappropriate frequency for the peripheral I / O, for example, a frequency outside the operation specifications of the peripheral I / O, as the predetermined frequency in the detection circuit, Even if the CPU tries to access the peripheral I / O in a state where a clock having an inappropriate frequency is input due to a defect in the execution program of the CPU, it can be prevented from being actually accessed. As a result, since the peripheral I / O to which the clock having an inappropriate frequency is input is not operated, the malfunction of the microprocessor can be reduced.
また、この発明の第5のマイクロプロセッサによれば、周辺I/Oの動作中には、クロック周波数に対する変更要求はクロック生成部には通知されない。そのため、周辺I/Oの動作中にクロック周波数が変更されることがない。従って、周辺I/Oの誤動作を低減でき、マイクロプロセッサの誤動作を低減できる。 Further, according to the fifth microprocessor of the present invention, a change request for the clock frequency is not notified to the clock generation unit during the operation of the peripheral I / O. Therefore, the clock frequency is not changed during the operation of the peripheral I / O. Therefore, malfunctions of peripheral I / O can be reduced, and malfunctions of the microprocessor can be reduced.
また、この発明の第6のマイクロプロセッサによれば、検出回路での所定の周波数として、周辺I/Oにとっての不当な周波数、例えば周辺I/Oの動作仕様外の周波数を採用することによって、CPUの実行プログラムの不具合等により、CPUがクロック周波数を不当な周波数に変更しようとしたとしても、変更要求はクロック生成部には通知されない。従って、クロック周波数が不当な周波数に変更されることがない。その結果、周辺I/Oの誤動作を低減でき、マイクロプロセッサの誤動作を低減できる。 Further, according to the sixth microprocessor of the present invention, by adopting an inappropriate frequency for the peripheral I / O, for example, a frequency outside the operation specifications of the peripheral I / O, as the predetermined frequency in the detection circuit, Even if the CPU tries to change the clock frequency to an inappropriate frequency due to a defect in the execution program of the CPU, the change request is not notified to the clock generation unit. Therefore, the clock frequency is not changed to an inappropriate frequency. As a result, malfunctions of peripheral I / O can be reduced, and malfunctions of the microprocessor can be reduced.
実施の形態1.
図1は本発明の実施の形態1に係るマイクロプロセッサ100の構成を示すブロック図である。図1に示されるように、本実施の形態1に係るマイクロプロセッサ100は、割り込み機能を有するCPU1と、アドレスデコーダ2と、周辺I/O部3と、割り込み発生部4と、クロック生成部5とを備えている。
FIG. 1 is a block diagram showing a configuration of a
CPU1は、クロック生成部5から出力されるCPUクロックCCLKに基づいて動作し、周辺I/O部3やクロック生成部5の動作を制御する。CPU1は、アドレスデコーダ2及びクロック生成部5に、I/Oアクセス要求信号AREQ及び書き込み有効信号WENをそれぞれ出力する。なお、書き込み有効信号WENはHighレベルの信号である。
The
周辺I/O部3は周辺I/O30,31を備えており、各周辺I/O30,31はクロック生成部5から出力される周辺クロックPCLKに基づいて動作を行う。周辺I/O30,31は、例えばシリアルI/OポートやパラレルI/Oポート、あるいはタイマなどであって、制御レジスタ群30a,31aをそれぞれ有している。制御レジスタ群30a,31aは、複数のレジスタから成り、CPU1が当該レジスタにデータを書き込むことによって周辺I/O30,31の動作が制御される。
The peripheral I /
例えば、周辺I/O30がタイマである場合、周辺I/O30はクロック生成部5からの周辺クロックPCLKをカウントしてタイマ動作を行う。このときの制御レジスタ群30aは、タイマ動作の開始あるいは停止を指示するためのレジスタや、カウント時間を設定するレジスタなどから成る。また、例えば周辺I/O31が非同期式のシリアルI/Oポートの場合、周辺I/O31は、クロック生成部5からの周辺クロックPCLKをデータ受信時のサンプリングクロックとして用いたり、周辺クロックPCLKに基づいて通信速度を決定したりする。このときの制御レジスタ群31aは、送信を開始したり、受信を許可するためのレジスタや、通信速度を設定するためのレジスタなどから成る。
For example, when the peripheral I /
クロック生成部5は、クロック選択回路50と、Dフリップフロップ(以後「D−FF」と呼ぶ)51と、レジスタ52とを備えており、周辺クロックPCLK及びCPUクロックCCLKを周波数可変に出力する。レジスタ52はCPU1によってデータが書き込まれ、書き込まれたデータをデータFDATA0として出力する。D−FF51は、クロック選択回路50から出力されるクロックDCLKの立ち上がりに同期してデータFDATA0を取り込んで、それをデータFDATA1として出力する。
The
図2はクロック選択回路50の構成を示すブロック図である。図2に示されるように、クロック選択回路50は、セレクタ50a,50bと、逓倍器50c〜50eと、分周器50f〜50hとを備えている。逓倍器50c〜50eのそれぞれには、マイクロプロセッサ100の外部からシステムクロックSCLKが入力されている。逓倍器50cはシステムクロックSCLKの周波数を4倍にしてセレクタ50aに出力し、逓倍器50dはシステムクロックSCLKの周波数を2倍にしてセレクタ50aに出力する。また、逓倍器50eはシステムクロックSCLKの周波数を1倍にして、つまりシステムクロックSCLKをそのままセレクタ50aに出力する。
FIG. 2 is a block diagram showing the configuration of the
データFDATA1は、クロック選択回路50での逓倍比を示す逓倍比選択信号SELAと、クロック選択回路50での分周比を示す分周比選択信号SELBとから成り、セレクタ50aは、逓倍比選択信号SELAに基づいて、入力されたクロックのうちのいずれか一つを選択して出力する。具体的には、逓倍比選択信号SELAが逓倍比“4”を示す場合には逓倍器50cの出力を選択し、逓倍比“2”を示す場合には逓倍器50dの出力を選択し、逓倍比“1”を示す場合には逓倍器50eの出力を選択する。このように、セレクタ50aが選択するクロックによって、クロック選択回路50での逓倍比が決定される。
The data FDATA1 includes a multiplication ratio selection signal SELA that indicates a multiplication ratio in the
分周器50fは、セレクタ50aから出力されるクロックをそのままセレクタ50bに出力する。分周器50gは、セレクタ50aから出力されるクロックの周波数を1/2倍にしてセレクタ50bに出力し、分周器50hはセレクタ50aから出力されるクロックの周波数を1/4倍にしてセレクタ50bに出力する。セレクタ50bは、データFDATA1に含まれる分周比選択信号SELBに基づいて、入力されたクロックのうちいずれか一つを選択して周辺クロックPCLKとして出力する。具体的には、分周比選択信号SELBが分周比“1”を示す場合には分周器50fの出力を選択し、分周比“1/2”を示す場合には分周器50gの出力を選択し、分周比“1/4”を示す場合には分周器50hの出力を選択する。このように、セレクタ50bが選択するクロックによって、クロック選択回路50での分周比が決定される。
The
また分周器50fは、セレクタ50aから出力されるクロックをそのままCPUクロックCCLKとして出力し、分周器50hは、セレクタ50aから出力されるクロックの周波数を1/4倍にしてクロックDCLKとして出力する。
The
クロック生成部5は以上のように構成されているため、CPU1がレジスタ52に設定するデータを変更することによって、クロック選択回路50での逓倍比あるいは分周比を変更することができ、クロック生成部5から出力されるCPUクロックCCLK、周辺クロックPCLK、及びクロックDCLKの周波数を変更することができる。なお、周辺クロックPCLKの周波数は、システムクロックSCLKの周波数に、クロック選択回路50での逓倍比と分周比とを掛け合わせたものであり、CPUクロックCCLKの周波数は、システムクロックSCLKにクロック選択回路50での逓倍比を掛け合わせたものである。また、クロックDCLKの周波数は、クロック選択回路50で設定可能な分周比の中での最小公倍数の分周比である1/4を、システムクロックSCLKの周波数に掛け合わせたものである。
Since the
割り込み発生部4は、比較器40,41と、割り込み発生回路42と、D−FF43,44とを備えている。比較器40は、データFDATA0,1を互いに比較して、一致すればHighレベルの信号を、不一致であればLowレベルの信号を出力する。D−FF44は、クロックDCLKの立ち上がりに同期して比較器40の出力を取り込んで出力する。D−FF43は、D−FF44の出力を、クロックDCLKの立ち上がりに同期して取り込んで出力する。比較器41は、D−FF43,44の出力を互いに比較して、一致すればHighレベルの信号を、不一致であればLowレベルの信号を割り込み発生回路42に出力する。割り込み発生回路42は、比較器41の出力レベルが変化すると、CPU1に対して割り込み要求信号IREQを出力する。CPU1は割り込み要求信号IREQを受け取ると、割り込み処理を行う。
The interrupt
アドレスデコーダ2は、I/O選択信号PSEL0,1を周辺I/O部3に出力しており、CPU1からのI/Oアクセス要求信号AREQを受け取ると、そのときのアドレスバスABUSの値を読み込む。そして、読み込んだアドレスの値に基づいてI/O選択信号PSEL0,1のどちらか一方をHighレベルにする。具体的には、読み込んだアドレスの値が、周辺I/O30のアドレスを示す場合には、I/O選択信号PSEL0,1をそれぞれHighレベル及びLowレベルにし、周辺I/O31のアドレスを示す場合には、I/O選択信号PSEL0,1をそれぞれLowレベル及びHighレベルにする。
The
周辺I/30にはI/O選択信号PSEL0が入力されており、その信号がLowレベルからHighレベルになると確認応答信号(以後「確認応答信号ACK0」と呼ぶ)を出力する。また周辺I/O31にはI/O選択信号PSEL1が入力されており、その信号がLowレベルからHighレベルになると確認応答信号(以後「確認応答信号ACK1」と呼ぶ)を出力する。周辺I/O30,31からそれぞれ出力された確認応答信号ACK0,1は、確認応答信号ACKとしてCPU1に出力される。
An I / O selection signal PSEL0 is input to the peripheral I / 30, and an acknowledgment signal (hereinafter referred to as “acknowledgment signal ACK0”) is output when the signal changes from Low level to High level. The peripheral I /
このように、I/O選択信号PSEL0,1のどちらか一方がHighレベルになると、周辺I/O部3からは確認応答信号ACKが出力され、それがCPU1に入力される。
As described above, when either one of the I / O selection signals PSEL0 and PSEL1 becomes High level, the peripheral I /
次に、周辺I/O部3の制御レジスタ群30a,31aにデータを設定する際のマイクロプロセッサ100の動作について説明する。ここでは、代表的に周辺I/O30の制御レジスタ群30aにデータを設定する際の動作について説明する。
Next, the operation of the
CPU1は、周辺I/O30が内蔵する制御レジスタ群30aのあるレジスタに所定のデータを設定する際には、アドレスデコーダ2に対して、I/Oアクセス要求信号AREQを出力するとともに、設定を行うレジスタのアドレスをアドレスバスABUSに出力する。また、それと同時に、設定するデータをデータバスDBUSに出力する。アドレスデコーダ2は、I/Oアクセス要求信号AREQを受け取ると、アドレスバスABUSの値を読み込んで、I/O選択信号PSEL0をHighレベルにする。このように、I/O選択信号PSEL0がHighレベルになることによって、CPU1からのアクセス要求が周辺I/O30に通知される。
When setting predetermined data in a register in the
周辺I/O30は、I/O選択信号PSEL0がHighレベルになると、CPU1からのアクセス要求に対する確認応答信号ACK0を出力し、これが確認応答信号ACKとしてCPU1に入力される。これと同時に、アドレスバスABUSの値を読み込み、その値が示すレジスタに、データバスDBUSのデータを書き込む。
When the I / O selection signal PSEL0 becomes High level, the peripheral I /
以上のようにして、周辺I/O30の制御レジスタ群30aにデータが設定される。CPU1は、確認応答信号ACKを受け取ると、周辺I/O30へのアクセスが受け付けられたと判断し、次の動作を開始する。
As described above, data is set in the
次に、クロック生成部5から出力される周辺クロックPCLKの周波数を変更する際のマイクロプロセッサ100の動作について説明する。図3は、このときのマイクロプロセッサ100の動作を示すタイミングチャートである。本実施の形態1では、一例として、クロック選択回路50での逓倍比は一定とし、そこでの分周比を変更することによって、周辺クロックPCLKの周波数を変更する場合について説明する。具体的には、クロック選択回路50での分周比を“1”から“1/2”に変更して周辺クロックPCLKの周波数を一度変更し、その後分周比を“1/2”から“1/4”に変更して周辺クロックPCLKの周波数を再度変更する際のマイクロプロセッサ100の動作について説明する。なお、以下の説明では、クロック選択回路50での逓倍比は常に“1”であって、セレクタ50aは逓倍器50eの出力を常に選択するものとする。
Next, the operation of the
図3に示される時刻t1において、CPU1は、書き込み有効信号WENをレジスタ52に出力して、周辺クロックPCLKの周波数に対する変更要求(以後「変更要求CR」と呼ぶ)をクロック生成部5に通知する。これと同時に、CPU1は周波数の変更先を示す情報(以後「変更先情報VI」と呼ぶ)を含むデータをデータバスDBUSに出力する。このデータを「変更データVD」と呼ぶ。
At time t1 shown in FIG. 3, the
変更データVDには、変更先情報VIとして、クロック選択回路50に設定する分周比の値、ここでは値“1/2”と、クロック選択回路50に設定する逓倍比の値とが含まれている。上述のように、本実施の形態1では、周辺クロックPCLKの周波数を変更する際には逓倍比は変更しないため、変更データVDに含まれている逓倍比の値は“1”である。
The change data VD includes, as the change destination information VI, the value of the frequency division ratio set in the
レジスタ52は、書き込み有効信号WENを受け取ると、データバスDBUSを介して変更データVDをそれ自身に書き込む。そして、書き込んだ変更データVDをデータFDATA0として出力する。このようにして、図3に示されるように、時刻t1において、レジスタ52に設定されている分周比の値が“1”から“1/2”に変化し、データFDATA0の値が変化する。なお図3における、レジスタ52に設定されているデータ、あるいはD−FF51の出力データを示す欄に示されている「×1」、「×1/2」及び「×1/4」は、そのデータに含まれる分周比の値を意味している。
When the
時刻t1において、D−FF51はデータFDATA0の以前の値を保持しているため、データFDATA0の値が変化すると、データFDATA0,1は互い一致せず、時刻t1において、比較器40の出力はHighレベルからLowレベルに遷移する。その後、時刻t2においてクロックDCLKが立ち上がると、D−FF51は変化後のデータFDATA0を取り込んで出力するため、クロック選択回路50には、時刻t1でレジスタ52に設定された変更データVDがデータFDATA1として入力される。そして、その変更データVDのうち、分周比を示すデータは分周比選択信号SELBとしてセレクタ50bに入力され、逓倍比を示すデータは逓倍比選択信号SELAとしてセレクタ50aに入力される。このときの分周比選択信号SELBは分周比“1/2”を示すため、セレクタ50bは分周器50gの出力を選択して出力する。その結果、図3に示されるように、時刻t2において、周辺クロックPCLKの周波数が、システムクロックSCLKの周波数の1倍から1/2倍に変更される。
At time t1, the D-
このように、本実施の形態1に係るクロック生成部5では、クロックDCLKの立ち上がりタイミングで周辺クロックPCLKの周波数を変更している。そして、クロック選択回路50で設定可能な分周比の最小公倍数の分周比でセレクタ50aの出力を分周する分周器50hの出力を、クロックDCLKとして採用している。これは、周辺クロックPCLKの周波数を変更した場合に、デューティが異常なクロックが周辺I/O部3に入力されないようにするためである。
As described above, in the
時刻t2において、データFDATA1が変化すると、データFDATA0,1は互いに一致するようになり、比較器40の出力はLowレベルからHighレベルに遷移する。これと同時に、D−FF44の出力がHighレベルからLowレベルに遷移する。このとき、D−FF43の出力はHighレベルであるため、比較器41の出力はHighレベルからLowレベルに遷移する。比較器41の出力レベルが変化すると、割り込み発生回路42は、CPU1に割り込み要求信号IREQを出力し、CPU1は割り込み処理を行う。
When the data FDATA1 changes at time t2, the data FDATA0 and 1 become coincident with each other, and the output of the
ここで、図3に示されるように、周辺クロックPCLKの周波数が変更されるタイミングとほぼ同じタイミングで比較器41の出力は変化する。そして、割り込み発生回路42は、比較器41の出力レベルの変化を検出して割り込み要求信号IREQを出力する。従ってCPU1は、周辺クロックPCLKの周波数の変更が完了した後に割り込み要求を受け取ることになる。
Here, as shown in FIG. 3, the output of the comparator 41 changes at substantially the same timing as the timing at which the frequency of the peripheral clock PCLK is changed. The interrupt
このように、本実施の形態1に係る割り込み発生部4は、クロック生成部5における周辺クロックPCLKの周波数変更の完了を検出してCPU1に割り込み要求を通知する。
As described above, the interrupt
CPU1は、割り込み発生部4から割り込み要求が通知されることによって、周辺クロックPCLKの周波数が変更されたことを認識し、その後、周辺I/O30や周辺I/O31にアクセスしてそれらを動作させる。
The
次に、図3に示す時刻t11において、CPU1は、書き込み有効信号WENを再度レジスタ52に出力する。これと同時に、CPU1は新たな変更先情報VIを含む変更データVDをデータバスDBUSに出力する。このときの変更データVDには、変更先情報VIとして、分周比の値“1/4”と逓倍比の値“1”とが含まれている。
Next, at time t <b> 11 shown in FIG. 3, the
レジスタ52は、書き込み有効信号WENを受け取ると、データバスDBUSを介して変更データVDをそれ自身に書き込んで、書き込んだ変更データVDをデータFDATA0として出力する。このようにして、図3に示されるように、時刻t11において、レジスタ52に設定されている分周比の値が“1/2”から“1/4”に変化し、データFDATA0の値が変化する。
Upon receiving the write enable signal WEN, the
時刻t11において、D−FF51はデータFDATA0の以前の値を保持しているため、時刻t1のときと同様に、比較器40の出力はHighレベルからLowレベルに遷移する。その後、時刻t12において、クロックDCLKが立ち上がると、D−FF51は変化後のデータFDATA0を取り込んで出力するため、クロック選択回路50には、時刻t11でレジスタ52に設定された変更データVDがデータFDATA1として入力される。そして、その変更データVDのうち、分周比を示すデータは分周比選択信号SELBとしてセレクタ50bに入力され、逓倍比を示すデータは逓倍比選択信号SELAとしてセレクタ50aに入力される。このときの分周比選択信号SELBは分周比“1/4”を示すため、セレクタ50bは分周器50hの出力を選択して出力する。その結果、図3に示されるように、時刻t12において、周辺クロックPCLKの周波数が、システムクロックSCLKの周波数の1/2倍から1/4倍に変更される。
At time t11, since the D-
また時刻t12において、データFDATA1が変化すると、データFDATA0,1は互いに一致するようになり、比較器40の出力はLowレベルからHighレベルに遷移する。
Further, when the data FDATA1 changes at time t12, the data FDATA0, 1 coincide with each other, and the output of the
時刻t12の直前では、比較器40の出力はLowレベルであるため、時刻t12では、D−FF44の出力は変化せず、Lowレベルが維持される。そして、時刻t12の直前では、D−FF44の出力はLowレベルであるため、時刻t12において、D−FF43の出力がHighレベルからLowレベルに遷移する。その結果、時刻t12において、D−FF43,44の出力が互いに一致するようになり、比較器41の出力はLowレベルからHighレベルに遷移する。
Immediately before time t12, the output of the
比較器41の出力レベルが変化すると、割り込み発生回路42は、CPU1に割り込み要求信号IREQを出力する。上述のように、周辺クロックPCLKの周波数が変更されるタイミングとほぼ同じタイミングで比較器41の出力は変化し、割り込み発生回路42は、比較器41の出力レベルの変化を検出して割り込み要求信号IREQを出力するため、CPU1は、周辺クロックPCLKの周波数の変更が完了した後に割り込み要求を受け取ることになる。
When the output level of the comparator 41 changes, the interrupt
その後CPU1は、周辺I/O部3の周辺I/O30や、周辺I/O31にアクセスして、それらを動作させる。
Thereafter, the
このように本実施の形態1に係るマイクロプロセッサ100では、クロック生成部5がCPU1から通知される変更要求CR及び変更先情報VIに基づいて周辺クロックPCLKの周波数を変更している。クロック生成部5は、クロックDCLKの立ち上がりタイミングで周辺クロックPCLKの周波数を変更しているため、クロック生成部5へのCPU1の変更要求CRの通知から、実際に周辺クロックPCLKの周波数が変更されるまで時間差を生じる。そのため、CPU1が変更要求CRを出力した後、すぐに周辺I/O30,31にアクセスすると、周辺クロックPCLKの周波数が変更されおらず、周辺I/O30,31が誤動作することがある。
As described above, in the
例えば、周辺I/O30がシリアルI/Oポートである場合、周辺クロックPCLKの周波数が変更される前に制御レジスタ群31aに所定のデータが設定されて、当該シリアルI/Oポートが通信動作を行うと、所望の通信速度が実現できない。また、周辺I/O30がタイマである場合、周辺クロックPCLKの周波数が変更される前に制御レジスタ群31aに所定のデータが設定されて、当該タイマがタイマ動作を行うと、所望の時間を計測できなくなる。
For example, when the peripheral I /
しかしながら、本実施の形態1では、割り込み発生部4が、周辺クロックPCLKの周波数が実際に変更された後にCPU1に割り込み要求を通知しているため、CPU1は、クロック生成部5での周辺クロックPCLKの周波数の変更が完了したことを認識することができる。従って、CPU1が割り込み発生部4から割り込み要求を受け取った後に、周辺I/O30,31にアクセスすることによって、周辺クロックPCLKの周波数が変更される前にCPU1が周辺I/O30,31にアクセスすることを防止することができる。その結果、周辺I/O30,31の誤動作を低減でき、マイクロプロセッサ100の誤動作を低減することができる。
However, in the first embodiment, since the interrupt
実施の形態2.
図4は本発明の実施の形態2に係るマイクロプロセッサ200の構成を示すブロック図である。本実施の形態2に係るマイクロプロセッサ200は、上述の実施の形態1に係るマイクロプロセッサ100において、構成としては、割り込み発生部4の代わりにクロック変更完了判定部6を備えるものである。
FIG. 4 is a block diagram showing a configuration of the
クロック変更完了判定部6は、上述の比較器40を備えている。比較器40は、データFDATA0,1を相互に比較して、一致すればHighレベルの信号である完了信号FNSを、不一致であればLowレベルの信号であるビジー信号BSYを、周辺I/O部3に出力する。
The clock change
周辺I/O30,31のそれぞれには、完了信号FNS及びビジー信号BSYが入力される。周辺I/O30は、ビジー信号BSYが入力されている状態でCPU1からアクセス要求があると、つまり、クロック変更完了判定部6の出力がLowレベルのときにI/O選択信号PSEL0がHighレベルになると、制御レジスタ群30aへのデータ書き込みと、確認応答信号ACK0の出力を保留する。そして、比較器40の出力がビジー信号BSYから完了信号FNSに切り替わり、周辺I/O30に完了信号FNSが入力されると、周辺I/O30は、保留しておいた制御レジスタ群30aへのデータ書き込みを実行する。同時に、周辺I/O30はCPU1に確認応答信号ACK0を出力し、この信号が確認応答信号ACKとしてCPU1に入力される。
A completion signal FNS and a busy signal BSY are input to the peripheral I /
同様に、周辺I/O31は、ビジー信号BSYが入力されている状態でCPU1からアクセス要求があると、つまり、クロック変更完了判定部6の出力がLowレベルのときにI/O選択信号PSEL1がHighレベルになると、制御レジスタ群31aへのデータ書き込みと、確認応答信号ACK1の出力を保留する。そして、比較器40の出力がビジー信号BSYから完了信号FNSに切り替わり、周辺I/O31に完了信号FNSが入力されると、周辺I/O31は、保留しておいた制御レジスタ群31aへのデータ書き込みを実行する。同時に、周辺I/O31はCPU1に確認応答信号ACK1を出力し、この信号が確認応答信号ACKとしてCPU1に入力される。
Similarly, when the peripheral I /
CPU1は、確認応答信号ACKを受け取ると、周辺I/O30,31へのアクセスが受け付けられたものと認識し、次の動作を開始する。その他の構成及び動作について、実施の形態1に係るマイクロプロセッサ100と同じであるためその説明は省略する。
When the
実施の形態1で図3を参照して説明したように、周辺クロックPCLKの周波数を変更する際には、CPU1から書き込み有効信号WENがレジスタ52に入力されて、変更データVDがレジスタ52に設定される。レジスタ52に変更データVDが設定されると、比較器40の出力はHighレベルからLowレベルとなり、比較器40はビジー信号BSYを出力する。そして、比較器40は、その後のクロックDCLKの立ち上がりタイミングで、ビジー信号BSY出力から完了信号FNS出力に切り替える。また、ビジー信号BSY出力から完了信号FNS出力に切り替わるタイミングで、周辺クロックPCLKの周波数が変更される。
As described with reference to FIG. 3 in the first embodiment, when the frequency of the peripheral clock PCLK is changed, the write enable signal WEN is input from the
このようにビジー信号BSYは、CPU1がクロック生成部5に変更要求CRを通知してから、実際に周辺クロックPCLKの周波数が変更されるまで比較器40から出力されているため、周辺クロックPCLKの周波数の変更中を示す信号であると言える。
Thus, since the busy signal BSY is output from the
一方、完了信号FNSは、クロック生成部5において周辺クロックPCLKの周波数が実際に変更されるタイミングで比較器40から出力されるため、周辺クロックPCLKの周波数の変更の完了を示す信号であると言える。
On the other hand, since the completion signal FNS is output from the
このように本実施の形態2に係るマイクロプロセッサ200では、周辺I/O30,31は、ビジー信号BSYが入力されている状態でCPU1からアクセス要求があるときには、完了信号FNSの入力後に、確認応答信号ACK0,1をそれぞれCPU1に出力している。つまり、クロック生成部5での周辺クロックPCLKの周波数の変更中に、CPU1からのアクセス要求が通知された場合には、周辺クロックPCLKの周波数の変更が完了した後に、周辺I/O30,31は確認応答信号ACK0,1をそれぞれCPU1に出力する。従って、周辺クロックPCLKの周波数の変更中にCPU1が再度周辺I/O30,31にアクセスすることを防止することができる。
As described above, in the
本実施の形態2に係るマイクロプロセッサ200と異なり、周辺I/O部3が周辺クロックPCLKの周波数の変更中でも確認応答信号ACKをCPU1に通知する場合であって、周辺I/O30がシリアルI/Oポートである場合、CPU1は確認応答信号ACKを受け取ると次の動作に移行するため、周辺クロックPCLKの周波数が変更されていない状態で、CPU1は周辺I/O30に通信動作を実行させてしまうことがある。そのため、所望の通信速度が実行できないことがある。
Unlike the
本実施の形態2では、周辺クロックPCLKの周波数の変更中にCPU1が再度周辺I/O部3にアクセスすることを防止することができるため、周辺クロックPCLKの周波数が変更されていない状態で、周辺I/O30が通信動作を行うことを低減できる。その結果、所望の通信速度が実現でき、マイクロプロセッサ200の誤動作を低減することができる。
In the second embodiment, it is possible to prevent the
また本実施の形態2では、周辺I/O30,31は、クロック生成部5でのクロック周波数の変更が完了した後にCPU1からのアクセス要求に対しての所定の動作、本実施の形態2では制御レジスタ群30a,31aへのデータの書き込みを行っている。そのため、周辺クロックPCLKの周波数が変更される前に、周辺I/O30,31が動作することを防止することができる。従って、周辺I/O30,31の誤動作を低減でき、その結果、マイクロプロセッサ200の誤動作を更に低減することができる。
In the second embodiment, the peripheral I /
実施の形態3.
図5は本発明の実施の形態3に係るマイクロプロセッサ300の構成を示すブロック図である。本実施の形態3に係るマイクロプロセッサ300は、上述の実施の形態1において、構成としては、割り込み発生部4の替わりに割り込み発生部14を備え、クロック供給制御部7a,7bを更に備えるものである。
FIG. 5 is a block diagram showing a configuration of a microprocessor 300 according to
クロック供給制御部7a,7bは、周辺I/O30,31にそれぞれ対応して設けられており、周辺I/O30,31への周辺クロックPCLKの供給をそれぞれ制御する。各クロック供給制御部7a,7bは、比較器70及びメモリ71を有する検出回路73とOR回路72とを備えている。
The
図6は比較器70とメモリ71の構成を示すブロック図である。図6に示されるように、メモリ71は複数個のレジスタR1〜Rn(n≧2)で構成されている。各レジスタR1〜Rnは、記憶情報の書き換えが可能であって、データバスDBUSを介してCPU1によって読み書きされる。なお、レジスタR1〜Rnを特に区別する必要が無い場合には、これらを総称してレジスタRnと呼ぶ。
FIG. 6 is a block diagram showing the configuration of the
クロック供給制御部7aにおけるメモリ71のレジスタRnには、所定の周波数を示す情報が記憶されている。例えば、クロック生成部5に設定可能な周辺クロックPCLKの周波数のうち、周辺I/O30の動作仕様外の周波数を示す情報(以後「禁止クロック情報FI1A」と呼ぶ)がレジスタRnに記憶されている。そして、クロック供給制御部7aのメモリ71に記憶されている禁止クロック情報FI1A全体で情報テーブルを構成している。以後、この情報テーブルを「禁止テーブルT1A」と呼ぶ。
Information indicating a predetermined frequency is stored in the register Rn of the
また、クロック供給制御部7bにおけるメモリ71のレジスタRnにも所定の周波数を示す情報が記憶されている。例えば、クロック生成部5に設定可能な周辺クロックPCLKの周波数のうち、周辺I/O31の動作仕様外の周波数を示す情報(以後「禁止クロック情報FI1B」と呼ぶ)がレジスタRnに記憶されている。そして、クロック供給制御部7bのメモリ71に記憶されている禁止クロック情報FI1B全体で情報テーブルを構成している。以後、この情報テーブルを「禁止テーブルT1B」と呼ぶ。
Information indicating a predetermined frequency is also stored in the register Rn of the
このように、本実施の形態3に係るメモリ71には、周辺I/Oに入力すべきでない周辺クロックPCLKの周波数を示す情報が記憶されている。
As described above, the
本実施の形態3では、クロック選択回路50に設定可能な逓倍比と分周比との組み合わせのうち、周辺クロックPCLKの周波数が周辺I/O30,31の動作仕様外の値となるような組み合わせが、禁止クロック情報FI1A,FI1Bとしてそれぞれ採用されている。
In the third embodiment, among combinations of multiplication ratios and frequency division ratios that can be set in the
例えば、システムクロックSCLKが10MHz、周辺I/O30が最大10MHzで動作することが可能な場合、逓倍比“4”と分周比“1”との組み合わせと、逓倍比“4”と分周比“1/2”との組み合わせと、逓倍比“2”と分周比“1”との組み合わせとが、レジスタR1〜R3にそれぞれ記憶されており、禁止テーブルT1Aにこれらの組み合わせが含まれている。また例えば、システムクロックSCLKが10MHzであって、周辺I/O31が最大20MHzで動作することが可能な場合、逓倍比“4”と分周比“1”との組み合わせがレジスタR1に記憶されており、この組み合わせが禁止テーブルT1Bに含まれている。
For example, when the system clock SCLK can operate at 10 MHz and the peripheral I /
比較器70は、図6に示されるように、n個の比較回路CM1〜CMnと、OR回路ORとを備えている。比較回路CM1〜CMnは、レジスタR1〜Rnにそれぞれ対応して設けられている。クロック供給制御部7aにおける各比較回路CM1〜CMnは、それに対応するレジスタRnに記憶されている禁止クロック情報FI1Aと、データFDATA1とを比較して、一致すればHighレベルを出力し、不一致であればLowレベルを出力する。同様に、クロック供給制御部7bにおける各比較回路CM1〜CMnは、それに対応するレジスタRnに記憶されている禁止クロック情報FI1Bと、データFDATA1とを比較して、一致すればHighレベルを出力し、不一致であればLowレベルを出力する。そして、OR回路ORは、比較回路CM1〜CMnの出力の論理和を演算して、その演算結果を検出回路73の出力としてOR回路72に出力する。
As shown in FIG. 6, the
これにより、クロック供給制御部7aのメモリ71に記憶されている禁止テーブルT1A内に、データFDATA1の値が存在するときには、検出回路73からHighレベルが出力され、存在しないときにはLowレベルが出力される。また、クロック供給制御部7bのメモリ71に記憶されている禁止テーブルT1B内に、データFDATA1の値が存在するときには、Highレベルが出力され、存在しないときにはLowレベルを出力される。
As a result, when the value of the data FDATA1 exists in the prohibition table T1A stored in the
以上のように、検出回路73の比較器70では、メモリ71に記憶されている所定の周波数を示す情報と、データFDATA1とを比較している。ここで、上述のように、データFDATA1には、逓倍比選択信号SELAと分周比選択信号SELBとが含まれているため、CPU1が周辺クロックPCLKの周波数を変更する場合には、データFDATA1は周辺クロックPCLKの変更先の周波数を示している。従って、メモリ71に記憶されている情報と、データFDATA1とを比較することによって、その情報が示す周波数、本実施の形態3では周辺I/Oの動作仕様外の周波数と、周辺クロックPCLKの変更先の周波数とが比較される。つまり、本実施の形態3に係る比較器70は、メモリ71が記憶する情報が示す周波数と、周辺クロックPCLKの変更先の周波数とを比較し、その比較結果を出力している。
As described above, the
このように、検出回路73では、周辺クロックPCLKの変更先の周波数と、メモリ71が記憶する情報が示す周波数とを比較することによって、その変更先の周波数が、当該情報が示す周波数と一致するかどうかを検出している。本実施の形態3に係る検出回路73では、周辺クロックPCLKの変更先の周波数と、周辺I/Oの動作仕様外の周波数とが一致するか否かを検出している。そして、一致する場合にはHighレベルを、一致しない場合にはLowレベルをそれぞれ検出結果としてOR回路72に出力している。
As described above, the
クロック供給制御部7aのOR回路72は、検出回路73の出力と、クロック選択回路50から出力される周辺クロックPCLKとの論理和を演算して周辺I/O30に出力する。これにより、周辺I/O30には、検出回路73の出力がHighレベルのときには周辺クロックPCLKが供給されず、Lowレベルのときには周辺クロックPCLKが供給される。このように、クロック供給制御部7aは、検出回路73から出力される検出結果に基づき、周辺クロックPCLKを周辺I/O30へ供給するか否かを制御している。
The OR
同様にクロック供給制御部7bのOR回路72は、検出回路73の出力と、クロック選択回路50から出力される周辺クロックPCLKとの論理和を演算して周辺I/O31に出力する。これにより、周辺I/O31には、検出回路73の出力がHighレベルのときには周辺クロックPCLKが供給されず、Lowレベルのときには周辺クロックPCLKが供給される。このように、クロック供給制御部7bは、検出回路73から出力される検出結果に基づき、周辺クロックPCLKを周辺I/O31へ供給するか否かを制御している。なお、メモリ71のレジスタRnへの値の書き込みは、マイクロプロセッサ300の電源投入時又はリセット時の初期化の時にCPU1によって行われる。
Similarly, the
また、クロック供給制御部7a,7bの検出回路73の出力は、それぞれ比較結果信号CRA,CRBとして割り込み発生部14に入力される。割り込み発生部14にはI/O選択信号PSEL0,PSEL1も入力されている。割り込み発生部14は、比較結果信号CRAがHighレベルのときI/O選択信号PSEL0がLowレベルからHighレベルに遷移すると、割り込み要求信号IREQをCPU1に出力する。更に、割り込み発生部14は、比較結果信号CRBがHighレベルのときI/O選択信号PSEL1がLowレベルからHighレベルに遷移すると、割り込み要求信号IREQをCPU1に出力する。その他の構成及び動作について実施の形態1に係るマイクロプロセッサ100と同じであるためその説明は省略する。
The outputs of the
以上のように、本実施の形態3に係るマイクロプロセッサ300では、クロック生成部5における周辺クロックPCLKの変更先の周波数が、メモリ71に記憶されている情報が示す周波数と一致すると、周辺I/O30,31には周辺クロックPCLKが供給されない。従って、周辺I/O30,31に入力すべきでない周辺クロックPCLKが有する不当な周波数を示す情報を、メモリ71に記憶させることによって、CPU1の実行プログラムの不具合等で、周辺クロックPCLKが不当な周波数に設定された場合には、周辺クロックPCLKの周辺I/O30,31への供給が停止する。
As described above, in the microprocessor 300 according to the third embodiment, when the frequency to which the peripheral clock PCLK is changed in the
例えば、本実施の形態3のように、メモリ71に、周辺I/O30,31の動作仕様外の周波数を示す情報を記憶させることによって、周辺クロックPCLKの周波数が周辺I/O30,31の動作仕様外に設定された場合には、周辺クロックPCLKの変更先の周波数が周辺I/O30,31の動作仕様外の周波数であることが検出回路73で検出され、その検出結果に基づき、周辺I/O30,31への周辺クロックPCLKの入力が停止される。
For example, as shown in the third embodiment, by storing information indicating the frequency outside the operation specifications of the peripheral I /
また、CPU1で高速処理を実行させるためにCPU1に入力されるCPUクロックCCLKの周波数を大きくする場合に、周辺クロックPCLKの周波数も変更されて周辺I/O30,31の動作仕様外に設定された場合であっても、周辺I/O30,31にはそのような周辺クロックPCLKは入力されない。
Further, when the frequency of the CPU clock CCLK input to the
以上のように、本実施の形態3に係るマイクロプロセッサ300では、周辺I/O30,31に、不当な周波数を有する周辺クロックPCLKが入力されることを防止できるため、周辺I/O30,31の誤動作を低減することができ、その結果、マイクロプロセッサ300の誤動作を低減できる。
As described above, in the microprocessor 300 according to the third embodiment, it is possible to prevent the peripheral clock PCLK having an inappropriate frequency from being input to the peripheral I /
また、本実施の形態3に係る割り込み発生部14は、比較結果信号CRAがHighレベルのときにI/O選択信号PSEL0が立ち上がると、CPU1に割り込み要求信号IREQを出力している。比較結果信号CRAのHighレベルは、周辺I/O30に周辺クロックPCLKが供給されていない状態を示しており、I/O選択信号PSEL0の立ち上がりは、CPU1から周辺I/O30へアクセス要求があったことを示している。従って、割り込み発生部14は、クロック供給制御部7aが周辺I/O30へ周辺クロックPCLKを供給していない場合に、CPU1が周辺I/O30にアクセスすると、CPU1へ割り込み要求を通知している。同様にして、割り込み発生部14は、クロック供給制御部7bが周辺I/O31へ周辺クロックPCLKを供給していない場合に、CPU1が周辺I/O31にアクセスすると、CPU1へ割り込み要求を通知している。
Further, the interrupt
このように本実施の形態3では、CPU1の実行プログラムの不具合等により、周辺クロックPCLKが供給されていない周辺I/O30,31にCPU1がアクセスした場合には、割り込み発生部14から割り込み要求がCPU1に通知されるため、CPU1は周辺I/O30,31に周辺クロックPCLKが供給されていないことを認識することができる。そのため、周辺クロックPCLKが供給されていない周辺I/O30,31にCPU1が再度アクセスすることを防止することができる。
As described above, in the third embodiment, when the
例えば、割り込み発生部14から割り込み要求を受けたCPU1が、レジスタ52に所定のデータを設定することによって周辺クロックPCLKの周波数を周辺I/O30,31の動作仕様内に変更し、その後に周辺I/O30,31にアクセスすることが可能になる。その結果、マイクロプロセッサ300の誤動作を低減することができる。
For example, the
また、CPU1には割り込み発生部14から割り込み要求が通知されるため、CPU1の実行プログラムの開発段階において、当該実行プログラムのデバッグが行いやすくなる。その結果、周辺クロックPCLKが供給されていない状態の周辺I/O30,31にCPU1がアクセスするといった誤動作の発生を低減することができる。
Further, since an interrupt request is notified to the
また、本実施の形態3に係るメモリ71は、記憶情報を書き換えることが可能であるため、マイクロプロセッサ300の設計後あるいは製造後であっても、メモリ71の内容を変更することによって、メモリ71に記憶されている情報が示す所定の周波数を変更することができる。従って、マイクロプロセッサ300の設計後あるいは製造後に、メモリ71に設定された周辺I/O30,31の動作仕様外の周波数を変更することができる。
In addition, since the
通常は、設計後あるいは製造後に周辺I/O30,31の動作を確認して、周辺I/O30,31の動作を保証できる周波数、すなわち動作仕様内の周波数が最終的に決定される。従って、メモリ71に書き換え可能な記憶装置を採用することによって、最終決定後の周辺I/O30,31の動作仕様に基づて、動作仕様外の周波数を示す情報をメモリ71に書き込むことができる。その結果、確実に周辺I/O30,31の誤動作を低減できる。
Usually, after designing or manufacturing, the operation of the peripheral I /
実施の形態4.
図7は本発明の実施の形態4に係るマイクロプロセッサ400の構成を示すブロック図である。本実施の形態4に係るマイクロプロセッサ400は、上述の実施の形態1に係るマイクロプロセッサ100において、構成としては、割り込み発生部4の替わりに割り込み発生部24を備え、アクセス制御部8を更に備えるものである。
FIG. 7 is a block diagram showing a configuration of a
アクセス制御部8は、検出回路80a,80bと、AND回路81,82とを備えており、CPU1からの周辺I/O30,31へのアクセスを制御する。各検出回路80a,80bは、実施の形態3に係る検出回路73と同様に、上述の比較器70とメモリ71とを備えている。検出回路80aのメモリ71には、例えば禁止クロック情報FI1Aが記憶されており、当該メモリ71に記憶されている禁止クロック情報FI1A全体で禁止テーブルT1Aを構成している。また、検出回路80bのメモリ71には、例えば禁止クロック情報FI1Bが記憶されており、当該メモリ71に記憶されている禁止クロック情報FI1B全体で禁止テーブルT1Bを構成している。
The access control unit 8 includes
本実施の形態4では、実施の形態3と同様に、クロック選択回路50に設定可能な逓倍比と分周比との組み合わせのうち、周辺クロックPCLKの周波数が周辺I/O30,31の動作仕様外の値となる組み合わせが、禁止クロック情報FI1A,FI1Bとしてそれぞれ採用されている。
In the fourth embodiment, as in the third embodiment, the frequency of the peripheral clock PCLK is the operation specification of the peripheral I /
検出回路80aの比較器70から出力される比較結果信号CRAは、AND回路81と割り込み発生部24に入力されている。AND回路81は、比較結果信号CRAの反転信号と、I/O選択信号PSEL0との論理積を演算して周辺I/O30に出力する。その結果、周辺I/O30には、検出回路80aの出力がHighレベルのときには、I/O選択信号PSEL0が入力されず、Lowレベルのときに入力される。ここで、上述のように、I/O選択信号PSEL0がHighレベルになることによって、CPU1からのアクセス要求が周辺I/O30に通知される。従って、アクセス制御部8が、比較器70の出力に基づいてI/O選択信号PSEL0の周辺I/O30への入力を制御することによって、CPU1からの周辺I/O30へのアクセスを許可するか否かの制御が行われる。つまり、アクセス制御部8は、検出回路80aから出力される検出結果に基づき、CPU1からの周辺I/O30へのアクセスを許可するか否かの制御を行っている。
The comparison result signal CRA output from the
検出回路80bの比較器70から出力される比較結果信号CRBは、AND回路82と割り込み発生部24に入力されている。AND回路82は、比較結果信号CRBの反転信号と、I/O選択信号PSEL1との論理積を演算して周辺I/O31に出力する。その結果、周辺I/O31には、検出回路80bの出力がHighレベルのときには、I/O選択信号PSEL1が入力されず、Lowレベルのときに入力される。ここで、上述のように、I/O選択信号PSEL1がHighレベルになることによって、CPU1からのアクセス要求が周辺I/O31に通知される。従って、アクセス制御部8が、比較器70の出力に基づいてI/O選択信号PSEL1の周辺I/O31への入力を制御することによって、CPU1からの周辺I/O31へのアクセスを許可するか否かの制御が行われる。つまり、アクセス制御部8は、検出回路80bから出力される検出結果に基づき、CPU1からの周辺I/O31へのアクセスを許可するか否かの制御を行っている。
The comparison result signal CRB output from the
割り込み発生部24にはI/O選択信号PSEL0,PSEL1も入力されている。割り込み発生部24は、比較結果信号CRAがHighレベルのときにI/O選択信号PSEL0がLowレベルからHighレベルに遷移すると、割り込み要求信号IREQをCPU1に出力する。更に、割り込み発生部24は、比較結果信号CRBがHighレベルのときにI/O選択信号PSEL1がLowレベルからHighレベルに遷移すると、割り込み要求信号IREQをCPU1に出力する。その他の構成及び動作について実施の形態1に係るマイクロプロセッサ100と同じであるためその説明は省略する。
The interrupt
このように本実施の形態4に係るマイクロプロセッサ400では、検出回路80a,80bの出力がHighレベルのときには、CPU1からの周辺I/O30,31へのアクセスがそれぞれ禁止される。実施の形態3の内容からも理解できるように、検出回路80a,80bは、クロック生成部5における周辺クロックPCLKの変更先の周波数が、メモリ71に記憶されている情報のいずれかが示す周波数に一致するとHighレベルを出力する。従って、アクセス制御部8の働きによって、周辺クロックPCLKの変更先の周波数が、メモリ71に記憶されている情報が示す周波数と一致するときには、CPU1からの周辺I/O30,31へのアクセスが禁止される。
As described above, in the
その結果、例えばメモリ71に、周辺I/O30,31の動作仕様外の周波数を示す情報を記憶させることによって、CPU1の実行プログラムの不具合等により、動作仕様外の周辺クロックPCLKが入力された状態でCPU1が周辺I/O30,31にアクセスしようとしたとしても、実際にアクセスされることを防止することができる。その結果、動作仕様外の周辺クロックPCLKが入力されている周辺I/O30,31を動作させることがないため、マイクロプロセッサ400の誤動作を低減できる。
As a result, for example, by storing information indicating frequencies outside the operation specifications of the peripheral I /
また、本実施の形態4に係る割り込み発生部24は、比較結果信号CRAがHighレベルのときにI/O選択信号PSEL0が立ち上がると、CPU1に割り込み要求信号IREQを出力している。本実施の形態4では、比較結果信号CRAのHighレベルは、周辺I/O30に動作仕様外の周波数を有する周辺クロックPCLKが入力されていることを示しており、I/O選択信号PSEL0の立ち上がりは、CPU1が周辺I/O30へアクセスしようとしたことを示している。従って、割り込み発生部24は、アクセス制御部8がCPU1からの周辺I/O30へアクセスを禁止している場合に、CPU1が周辺I/O30にアクセスしようとすると、CPU1へ割り込み要求を通知している。同様にして、割り込み発生部24は、アクセス制御部8がCPU1からの周辺I/O31へのアクセスを禁止している場合に、CPU1が周辺I/O31にアクセスしようとすると、CPU1へ割り込み要求を通知している。
The interrupt
このように、アクセス制御部8がCPU1による周辺I/O30,31へのアクセスを禁止している場合に、CPU1が周辺I/O30,31にアクセスしようとすると、CPU1には割り込み要求が通知されるため、CPU1は周辺I/O30,31に不当な周波数を有する周辺クロックPCLKが供給されていることを認識することができる。そのため、例えば動作仕様外の周辺クロックPCLKが供給されている周辺I/O30,31に、CPU1が再度アクセスしようとすることを防止することができる。その結果、マイクロプロセッサ400の誤動作を低減することができる。
As described above, when the access control unit 8 prohibits the
また、CPU1には割り込み発生部24から割り込み要求が通知されるため、CPU1の実行プログラムの開発段階において、当該実行プログラムのデバッグが行いやすくなる。その結果、不当な周波数を有する周辺クロックPCLKが供給されている状態の周辺I/O30,31にCPU1がアクセスするといった誤動作の発生を低減することができる。
Further, since the interrupt request is notified to the
また、検出回路80a,80bのメモリ71は、記憶情報を書き換えることが可能であるため、マイクロプロセッサ400の設計後あるいは製造後であっても、メモリ71の内容を変更することによって、メモリ71に記憶されている情報が示す所定の周波数を変更することができる。従って、マイクロプロセッサ400の設計後あるいは製造後に、メモリ71に設定された、周辺I/O30,31の動作仕様外の周波数を変更することができる。その結果、設計後や製造後に最終決定された周辺I/O30,31の動作仕様に基づいて、動作仕様外の周波数を示す情報をメモリ71に書き込むことができ、それにより確実に周辺I/O30,31の誤動作を低減できる。
Further, since the
実施の形態5.
図8は本発明の実施の形態5に係るマイクロプロセッサ500の構成を示すブロック図である。本実施の形態5に係るマイクロプロセッサ500は、上述の実施の形態1に係るマイクロプロセッサ100において、構成としては、割り込み発生部4の替わりに割り込み発生部34を備え、クロック変更制御部9を更に備えるものである。
FIG. 8 is a block diagram showing a configuration of a
クロック変更制御部9は、検出回路90と、レジスタ92と、OR回路93と、AND回路94,95とを備えている。上述のように、CPU1は周辺クロックPCLKの周波数に対する変更要求CRをクロック生成部5に出力する。クロック変更制御部9は、クロック生成部5への変更要求CRの通知を許可するか否かの制御を行う。以後、この制御を「通知許可制御CNT」と呼ぶ。
The clock change control unit 9 includes a
検出回路90は、実施の形態3に係る検出回路73と同様に、比較器70とメモリ71とを備えており、本実施の形態4に係るメモリ71には、所定の周波数を示す情報が記憶されている。例えば、メモリ71の各レジスタR1〜Rnには、クロック生成部5に設定可能な周辺クロックPCLKの周波数のうち、周辺I/O30,31の動作仕様外の周波数を示す情報(以後「禁止クロック情報FI2」と呼ぶ)が記憶されている。そして、メモリ71に記憶されている禁止クロック情報FI2全体で情報テーブルを構成している。以後、この情報テーブルを「禁止テーブルT2」と呼ぶ。なお、本実施の形態5では、周辺クロックPCLKに対する周辺I/O30,31の動作仕様の最大値は互いに同じである。
Like the
本実施の形態5では、クロック選択回路50に設定可能な逓倍比と分周比との組み合わせのうち、周辺クロックPCLKが周辺I/O30,31の動作仕様外となるような組み合わせが、禁止クロック情報FI2として採用されている。例えば、システムクロックSCLKが10MHzであって、周辺I/O30,31がともに最大10MHzで動作することが可能な場合、逓倍比“4”と分周比“1”との組み合わせと、逓倍比“4”と分周比“1/2”との組み合わせと、逓倍比“2”と分周比“1”との組み合わせとが、レジスタR1〜R3にそれぞれ記憶されており、これらの組み合わせが禁止テーブルT2に含まれている。
In the fifth embodiment, among combinations of multiplication ratios and frequency division ratios that can be set in the
このように、本実施の形態5に係るメモリ71には、周辺I/O30,31の両方に入力すべきでない周辺クロックPCLKの周波数を示す情報が記憶されている。
As described above, the
上述の実施の形態3に係る比較器70には、データFDATA1が入力されていたが、本実施の形態5に係る比較器70には、周辺クロックPCLKの周波数を変更する際にCPU1から出力される変更データVDがその代わりに入力される。具体的には、図6に示される比較器70のブロック図において、比較回路CM1〜CMnのそれぞれにCPU1から出力される変更データVDがデータFDATA1の代わりに入力される。従って、本実施の形態5に係る比較器70では、メモリ71に記憶されている情報と変更データVDとが比較され、変更データがVDが、メモリ71に記憶されている情報のいずれかに一致すれば、OR回路ORからHighレベルが出力され、一致しないときにはLowレベルが出力される。
The data FDATA1 is input to the
本実施の形態5では、メモリ71に記憶する情報として、周辺I/O30,31の動作仕様外の周波数を示す情報が採用されているため、本実施の形態5に係る比較器70では、メモリ71に記憶されている禁止テーブルT2の内容と、周辺クロックPCLKの周波数を変更する際にCPU1から出力される変更データVDとが比較され、変更データVDに含まれている分周比と逓倍比との組み合わせが、禁止テーブルT2内に存在するときには、Highレベルが出力され、存在しないときにはLowレベルが出力される。
In the fifth embodiment, information indicating a frequency outside the operation specifications of the peripheral I /
以上のように、検出回路90の比較器70は、メモリ71に記憶されている所定の周波数を示す情報と、変更データVDとを比較している。ここで、上述のように、変更データVDには、周辺クロックPCLKの変更先の周波数を示す変更先情報VIが含まれている。従って、メモリ71に記憶されている情報と、変更データVDとを比較することによって、メモリ71内の情報が示す周波数、本実施の形態5では周辺I/O30,31の動作仕様外の周波数と、周辺クロックPCLKの変更先の周波数とが比較される。つまり、本実施の形態5に係る比較器70は、メモリ71が記憶する情報が示す周波数と、周辺クロックPCLKの変更先の周波数とを比較し、その比較結果を出力している。
As described above, the
このように、検出回路90では、周辺クロックPCLKの変更先の周波数と、メモリ71が記憶する情報が示す周波数とを比較することによって、その変更先の周波数が、メモリ71内の情報が示す周波数と一致するかどうかを検出している。本実施の形態5に係る検出回路90では、周辺クロックPCLKの変更先の周波数と、周辺I/Oの動作仕様外の周波数とが一致するか否かを検出している。そして、一致する場合にはHighレベルを、一致しない場合にはLowレベルをそれぞれ検出結果としてOR回路93に出力している。
As described above, the
OR回路93は、検出回路90の出力と、周辺I/O部3から出力されるI/O実行信号EXとの論理和を演算して出力する。ここでI/O実行信号EXは、周辺I/O30,31の少なくとも一方が動作中の場合にはHighレベルを示し、両方が動作していない場合にはLowレベルを示す。例えば、周辺I/O30,31がそれぞれタイマ及びシリアルI/Oポートである場合、周辺I/O30がタイマ動作を行って時間計測を実行しているとき、あるいは周辺I/O31が外部機器とシリアル通信を行っているときにはI/O実行信号EXはHighレベルを示す。
The OR
レジスタ92には通知許可制御CNTの実行/不実行を示す情報が書き込まれる。本実施の形態5では、通知許可制御CNTの実行を示す情報として“1”がレジスタ52に書き込まれ、不実行を示す情報として“0”がレジスタ52に書き込まれる。そして、レジスタ92は、記憶する値をAND回路94に出力する。なお、レジスタ92への値の書き込みは、例えばCPU1が行う。
Information indicating execution / non-execution of the notification permission control CNT is written in the
AND回路94は、レジスタ92の出力と、AND回路93の出力との論理積を演算して出力する。AND回路95は、AND回路93の出力の反転信号と、CPU1から出力される書き込み有効信号WENとの論理積を演算してレジスタ52に出力する。これにより、レジスタ52には、AND回路94の出力がLowレベルのときには書き込み有効信号WENが入力され、Highレベルのときには入力されない。
The AND
割り込み発生部34には、AND回路94の出力と、書き込み有効信号WENとが入力される。割り込み発生部34は、AND回路94の出力がHighレベルのときに書き込み有効信号WENが入力されるとCPU1に割り込み要求信号IREQを出力する。
The interrupt
なお、本実施の形態5に係るCPU1は、実施の形態1〜4に係るCPU1と異なり、周辺クロックPCLKの周波数を変更する際、変更データVDの出力後、AND回路94の出力が確定してから、書き込み有効信号WENを出力する。その他の構成及び動作について実施の形態1に係るマイクロプロセッサ100と同じであるためその説明は省略する。
Note that the
次に、クロック変更制御部9の動作について詳細に説明する。まず、検出回路90の出力がLowレベルの場合のクロック変更制御部9の動作について説明する。
Next, the operation of the clock change control unit 9 will be described in detail. First, the operation of the clock change control unit 9 when the output of the
レジスタ92に“1”が書き込まれている場合、つまり、レジスタ92に書き込まれている情報が通知許可制御CNTの実行を示す場合、周辺I/O30,31の少なくとも一方が動作中のときには、クロック変更制御部9ではAND回路94の出力がHighレベルとなる。そのため、AND回路95の出力がLowレベルに固定され、クロック生成部5へのCPU1による変更要求CRの通知が許可されない。そして、周辺I/O30,31の両方ともが動作していないときには、AND回路94の出力がLowレベルとなり、CPU1から出力される変更要求CRのクロック生成部5への通知が許可される。
When “1” is written in the
また、レジスタ92に“0”が書き込まれている場合、つまり、レジスタ92に書き込まれている情報が通知許可制御CNTの不実行を示す場合、周辺I/O30,31の動作に関わらず、クロック変更制御部9ではAND回路94の出力が常にLowとなり、クロック生成部5への変更要求CRの通知が常に許可される。
When “0” is written in the
このようにして、レジスタ92に“1”が設定されている場合には、クロック変更制御部9は、周辺I/O30,31が動作中であるか否かに基づく通知許可制御CNTを実行し、レジスタ92に“0”が設定されている場合にはかかる通知許可制御CNTを実行しない。
In this way, when “1” is set in the
ここでCPU1は、上述のように、周辺クロックPCLKの周波数を変更する際、変更データVDの出力後、AND回路94の出力が確定してから、書き込み有効信号WENを出力する。従って、クロック変更制御部9が通知許可制御CNTを実行する際には、CPU1の実行プログラムの不具合等により、周辺I/O30,31の動作中にCPU1が周辺クロックPCLKの周波数を変更しようとしたとしても、変更要求CRはクロック生成部5には通知されない。そのため、周辺I/O30,31の動作中に周辺クロックPCLKの周波数が変更されることがない。従って、周辺I/O30,31の誤動作を低減でき、マイクロプロセッサ500の誤動作を低減できる。
Here, as described above, when the frequency of the peripheral clock PCLK is changed, the
次に、I/O実行信号EXがLowレベルの場合のクロック変更制御部9の動作について説明する。 Next, the operation of the clock change control unit 9 when the I / O execution signal EX is at a low level will be described.
レジスタ92に“1”が書き込まれている場合、変更データVDが検出回路90のメモリ71に記憶されている情報のいずれかに一致するときには、クロック変更制御部9ではAND回路94の出力がHighレベルとなる。本実施の形態5では、メモリ71には周辺I/O30,31の動作仕様外の周波数を示す情報が記憶されているため、変更データVDに含まれる変更先情報VIが周辺I/O30,31の動作仕様外の周波数を示すときにはAND回路94の出力がHighレベルとなる。そのため、AND回路95の出力がLowレベルに固定され、クロック生成部5へのCPU1による変更要求CRの通知が許可されない。
When “1” is written in the
そして、変更データVDが検出回路90のメモリ71に記憶されている情報のいずれにも一致しないときには、AND回路94の出力がLowレベルとなる。本実施の形態5では、変更データVDに含まれる変更先情報VIが周辺I/O30,31の動作仕様内の周波数を示すときにはAND回路94の出力がLowレベルとなる。従って、CPU1から出力される変更要求CRのクロック生成部5への通知が許可される。
When the change data VD does not match any of the information stored in the
このように、本実施の形態5に係るクロック変更制御部9は、検出回路90の検出結果に基づき、クロック生成部5への変更要求CRの通知を許可するか否かを制御している。
As described above, the clock change control unit 9 according to the fifth embodiment controls whether to allow the notification of the change request CR to the
また、レジスタ92に“0”が書き込まれている場合、変更データVDに含まれる変更先情報VIの内容に関わらず、クロック変更制御部9ではAND回路94の出力が常にLowレベルとなる。そのため、クロック生成部5への変更要求CRの通知が常に許可される。
When “0” is written in the
このようにして、レジスタ92に“1”が設定されている場合には、クロック変更制御部9は、変更先情報VIが周辺I/O30,31の動作仕様外を示すか否かに基づく通知許可制御CNTを実行し、レジスタ92に“0”が設定されている場合にはかかる通知許可制御CNTを実行しない。
In this way, when “1” is set in the
以上のように、本実施の形態5に係るマイクロプロセッサ500では、クロック変更制御部9が通知許可制御CNTを実行するときであって、変更先情報VIが示す周波数がメモリ71に記憶されている情報が示す周波数と一致するときには、クロック生成部5へ変更要求CRが通知されない。ここで、上述のように、本実施の形態5に係るCPU1は、周辺クロックPCLKの周波数を変更する際、変更データVDの出力後、AND回路94の出力が確定してから、書き込み有効信号WENを出力する。従って、例えばメモリ71に、周辺I/O30,31の動作仕様外の周波数を示す情報を記憶させることによって、CPU1の実行プログラムの不具合等により、CPU1が周辺クロックPCLKの周波数を周辺I/O30,31の動作仕様外に設定しようとしたとしても、変更要求CRはクロック生成部5には通知されない。そのため、周辺クロックPCLKの周波数が不当な周波数に変更されることがない。その結果、周辺I/O30,31の誤動作を低減でき、マイクロプロセッサ500の誤動作を低減できる。
As described above, in the
また、本実施の形態5に係る割り込み発生部34は、クロック変更制御部9がクロック生成部5への変更要求CRの通知を許可していない状況下で、CPU1から当該変更要求CRが出力されたときには、CPU1に対して割り込み要求を通知する。従って、CPU1の実行プログラムの開発段階において、当該実行プログラムのデバッグが行いやすくなる。その結果、CPU1が周辺クロックPCLKを周辺I/O30,31の動作仕様外に変更しようとするといった不要な動作の発生や、周辺I/O30,31の動作中にCPU1が周辺クロックPCLKの周波数を変更しようとするといった不要な動作の発生を低減することができる。
Further, the interrupt
また、本実施の形態5に係るクロック変更制御部9は、通知許可制御CNTの実行/不実行を示す情報を書き込むことが可能なレジスタ92を備えているため、通知許可制御CNTを実行するか否かの選択を行うことができる。
In addition, since the clock change control unit 9 according to the fifth embodiment includes the
なお本実施の形態5では、CPU1は変更データVDを出力した後に書き込み有効信号WENを出力していたが、実施の形態1〜4に係るCPUと同様に、変更データVDと書き込み有効信号WENとを同時に出力しても良い。この場合には、変更データVDの出力からAND回路94の出力が確定するまで、AND回路95及び割り込み発生部34への書き込み有効信号WENの入力を遅延する遅延回路を設けることによって、クロック生成部5への変更要求CRの通知を制御することが可能となる。
In the fifth embodiment, the
また、検出回路90のメモリ71は、記憶情報を書き換えることが可能であるため、マイクロプロセッサ500の設計後あるいは製造後であっても、メモリ71の内容を変更することによって、メモリ71に記憶されている情報が示す所定の周波数を変更することができる。従って、マイクロプロセッサ500の設計後あるいは製造後に、例えば、メモリ71に設定された、周辺I/O30,31の動作仕様外の周波数を変更することができる。その結果、設計後や製造後に最終決定された周辺I/O30,31の動作仕様に基づいて、動作仕様外の周波数を示す情報をメモリ71に書き込むことができ、それにより確実に周辺I/O30,31の誤動作を低減できる。
In addition, since the
なお、本明細書の実施の形態3〜5では、メモリ71を複数のレジスタR1〜Rnで構成したが、1個のレジスタR1で構成しても良い。この場合には、比較器70内の比較回路は1個の比較回路CM1でよく、OR回路ORが不要となる。そして、比較回路CM1の出力が検出回路73の出力として出力される。
In the third to fifth embodiments of the present specification, the
また、メモリ71を構成するレジスタR1〜Rnの一部のレジスタを、周辺I/O30,31の動作仕様外の周波数を保持するために使用し、他のレジスタを使用しないときには、後段の比較回路CM1〜CMnのうち、当該他のレジスタに対応する比較回路が常にLowレベルを出力するような工夫を行う。
In addition, some of the registers R1 to Rn constituting the
例えば、各レジスタR1〜Rnの最上位ビット(MSB)に有効ビットを設けて、使用するレジスタRnの有効ビットを有効に設定し、未使用のレジスタRnの有効ビットを無効に設定する。そして、レジスタRnの有効ビットを利用して、当該未使用のレジスタRnに対応する後段の比較回路が常にLowレベルを出力するように検出回路を構成しておく。これにより、レジスタR1〜Rnの一部を使用する場合でも、図6に示される基本構成を利用することができる。 For example, a valid bit is provided in the most significant bit (MSB) of each register R1 to Rn, the valid bit of the register Rn to be used is set valid, and the valid bit of the unused register Rn is set invalid. Then, using the effective bit of the register Rn, the detection circuit is configured so that the subsequent comparison circuit corresponding to the unused register Rn always outputs the Low level. Thereby, even when some of the registers R1 to Rn are used, the basic configuration shown in FIG. 6 can be used.
また実施の形態3〜5では、メモリ71をレジスタで構成していたが、RAMまたは書き込み可能なPROM(Programmable ROM)で構成しても良い。なおPROMには、再書き換え不可能なPROM、例えばフューズROM、あるいは再書き換え可能なPROM、例えばEEPROMなどのどちらのROMを採用しても良い。
In the third to fifth embodiments, the
また回路設計の段階で、周辺I/O30,31の動作仕様外・仕様内の周波数を決定することができるのであれば、比較回路CM1〜CMnにおいて、データFDATA1あるいは変更データVDと比較される対象の値は固定値にしても良い。例えば、レジスタRnの出力を比較回路CM1〜CMnに入力する代わりに、電源線やグランド線の配線から得られるHighレベルとLowレベルの組み合わせから成るデジタル値を各比較回路CM1〜CMnに入力しても良い。
In addition, if it is possible to determine the frequency outside or within the operation specifications of the peripheral I /
1 CPU、4,14,24,34 割り込み発生部、5 クロック生成部、6 クロック変更完了判定部、7a,7b クロック供給制御部、8 アクセス制御部、9 クロック変更制御部、30,31 周辺I/O、70 比較器、71 メモリ、73,80a,80b,90 検出回路、92 レジスタ。
1 CPU, 4, 14, 24, 34 Interrupt generation unit, 5 clock generation unit, 6 clock change completion determination unit, 7a, 7b clock supply control unit, 8 access control unit, 9 clock change control unit, 30, 31 peripheral I / O, 70 comparator, 71 memory, 73, 80a, 80b, 90 detection circuit, 92 registers.
Claims (13)
周波数可変にクロックを出力するクロック生成部と、
前記クロックに基づいて動作を行い、前記CPUからアクセスされる周辺I/Oと、
割り込み発生部と
を備え、
前記クロック生成部は、前記CPUからの変更要求に基づいて前記クロックの周波数を変更し、
前記割り込み発生部は、前記クロック生成部での前記クロックの周波数の変更が完了すると、前記CPUに割り込み要求を通知する、マイクロプロセッサ。 A CPU having an interrupt function;
A clock generator that outputs a clock with variable frequency;
Peripheral I / O that operates based on the clock and is accessed from the CPU;
An interrupt generation unit,
The clock generation unit changes the frequency of the clock based on a change request from the CPU,
The interrupt generation unit notifies the CPU of an interrupt request when the change of the clock frequency in the clock generation unit is completed.
周波数可変にクロックを出力するクロック生成部と、
前記クロックに基づいて動作を行い、前記CPUからのアクセス要求に対する確認応答信号を前記CPUに出力する周辺I/Oと、
クロック変更完了判定部と
を備え、
前記CPUは、前記周辺I/Oに前記アクセス要求を通知した際には、前記周辺I/Oから前記確認応答信号を受け取った後に次の動作を行い、
前記クロック生成部は、前記CPUからの変更要求に基づいて前記クロックの周波数を変更し、
前記クロック変更完了判定部は、前記クロック生成部での前記クロックの周波数の変更中を示すビジー信号と、前記クロック生成部での前記クロックの周波数の変更の完了を示す完了信号とを前記周辺I/Oに出力し、
前記周辺I/Oは、前記ビジー信号が入力されている状態で前記CPUから前記アクセス要求があるときには、前記完了信号の入力後に、前記確認応答信号を出力する、マイクロプロセッサ。 CPU,
A clock generator that outputs a clock with variable frequency;
Peripheral I / O that operates based on the clock and outputs an acknowledgment signal to the CPU in response to an access request from the CPU;
A clock change completion determination unit,
When the CPU notifies the access request to the peripheral I / O, the CPU performs the following operation after receiving the confirmation response signal from the peripheral I / O,
The clock generation unit changes the frequency of the clock based on a change request from the CPU,
The clock change completion determination unit receives a busy signal indicating that the clock frequency is being changed in the clock generation unit and a completion signal indicating completion of the clock frequency change in the clock generation unit. Output to / O,
The peripheral I / O is a microprocessor that outputs the confirmation response signal after inputting the completion signal when the CPU requests the access while the busy signal is input.
周波数可変にクロックを出力するクロック生成部と、
前記クロックに基づいて動作を行う周辺I/Oと、
前記クロックの前記周辺I/Oへの供給を制御するクロック供給制御部と
を備え、
前記クロック生成部は、前記CPUからの変更要求に基づいて前記クロックの周波数を変更し、
前記クロック供給制御部は、前記クロック生成部における前記クロックの変更先の周波数が所定の周波数と一致するかどうかを検出する検出回路を有し、前記検出回路の検出結果に基づき前記クロックを前記周辺I/Oへ供給するか否かを制御する、マイクロプロセッサ。 CPU,
A clock generator that outputs a clock with variable frequency;
Peripheral I / O that operates based on the clock;
A clock supply control unit that controls supply of the clock to the peripheral I / O;
The clock generation unit changes the frequency of the clock based on a change request from the CPU,
The clock supply control unit has a detection circuit that detects whether or not a frequency to which the clock is changed in the clock generation unit matches a predetermined frequency, and based on a detection result of the detection circuit, the clock supply control unit A microprocessor that controls whether to supply to I / O.
前記クロック供給制御部が、前記周辺I/Oへ前記クロックを供給していない場合に、前記CPUが前記周辺I/Oにアクセスすると、前記CPUへ割り込み要求を通知する割り込み発生部を更に備える、請求項4に記載のマイクロプロセッサ。 The CPU has an interrupt function;
When the clock supply control unit is not supplying the clock to the peripheral I / O, the CPU further includes an interrupt generation unit that notifies the CPU of an interrupt request when the CPU accesses the peripheral I / O. The microprocessor according to claim 4.
周波数可変にクロックを出力するクロック生成部と、
前記クロックに基づいて動作する周辺I/Oと、
前記CPUからの前記周辺I/Oへのアクセスを制御するアクセス制御部と
を備え、
前記クロック生成部は、前記CPUからの変更要求に基づいて前記クロックの周波数を変更し、
前記アクセス制御部は、前記クロック生成部における前記クロックの変更先の周波数が所定の周波数と一致するかどうかを検出する検出回路を有し、前記検出回路の検出結果に基づき前記CPUからの前記周辺I/Oへのアクセスを許可するか否かを制御する、マイクロプロセッサ。 CPU,
A clock generator that outputs a clock with variable frequency;
Peripheral I / O operating based on the clock;
An access control unit that controls access from the CPU to the peripheral I / O;
The clock generation unit changes the frequency of the clock based on a change request from the CPU,
The access control unit includes a detection circuit that detects whether or not a frequency to which the clock is changed in the clock generation unit matches a predetermined frequency, and based on a detection result of the detection circuit, the peripheral from the CPU A microprocessor that controls whether to permit access to I / O.
前記アクセス制御部が、前記CPUからの前記周辺I/Oへのアクセスを禁止している場合に、前記CPUが前記周辺I/Oにアクセスしようとすると、前記CPUへ割り込み要求を通知する割り込み発生部を更に備える、請求項6に記載のマイクロプロセッサ。 The CPU has an interrupt function;
When the access control unit prohibits access from the CPU to the peripheral I / O, when the CPU tries to access the peripheral I / O, an interrupt is generated to notify the CPU of an interrupt request. The microprocessor according to claim 6, further comprising a unit.
前記クロックに基づいて動作を行う周辺I/Oと、
前記クロックの周波数に対する変更要求を前記クロック生成部に出力するCPUと、
前記クロック生成部への前記変更要求の通知を許可するか否かの制御を行うクロック変更制御部と
を備え、
前記クロック変更制御部は、前記制御において、
前記周辺I/Oが動作していないときには、前記クロック生成部への前記変更要求の通知を許可し、
前記周辺I/Oが動作中のときには、前記クロック生成部への前記変更要求の通知を許可せず、
前記クロック生成部は、前記変更要求に基づいて前記クロックの周波数を変更する、マイクロプロセッサ。 A clock generator that outputs a clock with variable frequency;
Peripheral I / O that operates based on the clock;
A CPU for outputting a change request for the frequency of the clock to the clock generation unit;
A clock change control unit for controlling whether to permit notification of the change request to the clock generation unit,
The clock change control unit, in the control,
When the peripheral I / O is not operating, permit notification of the change request to the clock generation unit,
When the peripheral I / O is operating, the notification of the change request to the clock generation unit is not permitted,
The clock generation unit is a microprocessor that changes a frequency of the clock based on the change request.
前記クロックに基づいて動作を行う周辺I/Oと、
前記クロックの周波数に対する変更要求と、前記クロックの周波数の変更先を示す第1の情報とを前記クロック生成部に出力するCPUと、
前記クロック生成部への前記変更要求の通知を許可するか否かの制御を行うクロック変更制御部と
を備え、
前記クロック変更制御部は、前記第1の情報が示す周波数が所定の周波数と一致するかどうかを検出する検出回路を有し、前記検出回路の検出結果に基づき前記クロック生成部への前記変更要求の通知を許可するか否かを制御し、
前記クロック生成部は、前記第1の情報及び前記変更要求に基づいて前記クロックの周波数を変更する、マイクロプロセッサ。 A clock generator that outputs a clock with variable frequency;
Peripheral I / O that operates based on the clock;
A CPU that outputs a change request to the clock frequency and first information indicating a change destination of the clock frequency to the clock generation unit;
A clock change control unit for controlling whether to permit notification of the change request to the clock generation unit,
The clock change control unit includes a detection circuit that detects whether a frequency indicated by the first information matches a predetermined frequency, and the change request to the clock generation unit based on a detection result of the detection circuit Control whether or not to allow notifications,
The clock generation unit is a microprocessor that changes a frequency of the clock based on the first information and the change request.
前記クロック変更制御部が前記クロック生成部への前記変更要求の通知を許可しない状況下で、前記CPUが前記変更要求を出力したときには前記CPUに割り込み要求を通知する割り込み発生部を更に備える、請求項8及び請求項9のいずれか一つに記載のマイクロプロセッサ。 The CPU has an interrupt function;
The system further comprises an interrupt generation unit that notifies the CPU of an interrupt request when the CPU outputs the change request in a situation where the clock change control unit does not permit the clock generation unit to notify the change request. The microprocessor according to any one of claims 8 and 9.
前記制御の実行/不実行を示す第2の情報を書き込むことが可能なレジスタを有し、
前記クロック変更制御部は、前記レジスタに書き込まれた第2の情報が前記制御の実行を示す場合には前記制御を実行し、前記制御の不実行を示す場合には前記クロック生成部への前記変更要求の通知を常に許可する、請求項8乃至請求項10のいずれか一つに記載のマイクロプロセッサ。 The clock change control unit
A register capable of writing second information indicating execution / non-execution of the control;
The clock change control unit executes the control when the second information written in the register indicates the execution of the control, and executes the control when the second information indicates the non-execution of the control. The microprocessor according to any one of claims 8 to 10, wherein notification of a change request is always permitted.
前記メモリは、前記所定の周波数を示す情報を記憶し、
前記比較器は、前記情報が示す周波数と、前記クロックの変更先の周波数とを比較する、請求項4及び請求項6のいずれか一つに記載のマイクロプロセッサ。 The detection circuit includes a memory in which stored information can be rewritten, and a comparator.
The memory stores information indicating the predetermined frequency,
The microprocessor according to claim 4, wherein the comparator compares a frequency indicated by the information with a frequency to which the clock is changed.
前記メモリは、前記所定の周波数を示す第2の情報を記憶し、
前記比較器は、前記第1の情報と前記第2の情報とを比較する、請求項9に記載のマイクロプロセッサ。 The detection circuit includes a memory in which stored information can be rewritten, and a comparator.
The memory stores second information indicating the predetermined frequency,
The microprocessor according to claim 9, wherein the comparator compares the first information with the second information.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003302404A JP2005071203A (en) | 2003-08-27 | 2003-08-27 | Microprocessor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003302404A JP2005071203A (en) | 2003-08-27 | 2003-08-27 | Microprocessor |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2005071203A true JP2005071203A (en) | 2005-03-17 |
Family
ID=34406675
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2003302404A Pending JP2005071203A (en) | 2003-08-27 | 2003-08-27 | Microprocessor |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2005071203A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1712979A1 (en) * | 2005-04-11 | 2006-10-18 | Koninklijke Philips Electronics N.V. | IC architecture |
JP2012128914A (en) * | 2010-12-16 | 2012-07-05 | Elpida Memory Inc | Semiconductor device |
JP2012203866A (en) * | 2011-03-28 | 2012-10-22 | Renesas Electronics Corp | Clock generation circuit, processor system using the same and clock frequency control method |
-
2003
- 2003-08-27 JP JP2003302404A patent/JP2005071203A/en active Pending
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1712979A1 (en) * | 2005-04-11 | 2006-10-18 | Koninklijke Philips Electronics N.V. | IC architecture |
JP2012128914A (en) * | 2010-12-16 | 2012-07-05 | Elpida Memory Inc | Semiconductor device |
US8971143B2 (en) | 2010-12-16 | 2015-03-03 | PS4 Luxco S.A.R.L | Semiconductor device periodically updating delay locked loop circuit |
JP2012203866A (en) * | 2011-03-28 | 2012-10-22 | Renesas Electronics Corp | Clock generation circuit, processor system using the same and clock frequency control method |
US9252752B2 (en) | 2011-03-28 | 2016-02-02 | Renesas Electronics Corporation | Clock generation circuit, processor system using same, and clock frequency control method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7302518B2 (en) | Method and system for managing a suspend request in a flash memory | |
US7627730B1 (en) | System and method for optimizing a memory controller | |
JPH0677249B2 (en) | Microcomputer | |
US20070118682A1 (en) | Method and apparatus for interfacing and managing NAND flash memory | |
TW403880B (en) | Relocatable code storage in an integrated circuit with an embedded microcontroller | |
US6477658B1 (en) | Microprocessor with variable clock operation | |
KR101793282B1 (en) | Micro computer | |
US20070283139A1 (en) | Information processing apparatus and control method used thereby | |
JP2003044303A (en) | Computer system | |
JP2005071203A (en) | Microprocessor | |
JPH04323746A (en) | Microcontroller unit | |
US6981109B2 (en) | Digital signal processor system having programmable random access memory that executes processing during downloading of a program | |
JP2007193431A (en) | Bus controller | |
US20040186939A1 (en) | Method and apparatus for communications interfacing capable of effectively reducing disk drive power consumption | |
JP4056768B2 (en) | Microcomputer, cache memory control method, and clock control method | |
JP2007188171A (en) | Memory controller | |
JP2021174051A (en) | Interface circuit and control method of interface circuit | |
JP2006202172A (en) | Bus timing control circuit | |
JP5441219B2 (en) | Semiconductor device and serial interface circuit | |
JPH11328961A (en) | Electronic circuit device and interface circuit | |
JP3185207B2 (en) | Data processing system | |
JPH11328003A (en) | Memory control system | |
JP3917736B2 (en) | Integrated circuit | |
JP2006120004A (en) | Information processor | |
JPH0520474A (en) | One chip microcomputer |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20060808 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20080310 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20080318 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20080708 |