JP2015191279A - processing system - Google Patents
processing system Download PDFInfo
- Publication number
- JP2015191279A JP2015191279A JP2014066182A JP2014066182A JP2015191279A JP 2015191279 A JP2015191279 A JP 2015191279A JP 2014066182 A JP2014066182 A JP 2014066182A JP 2014066182 A JP2014066182 A JP 2014066182A JP 2015191279 A JP2015191279 A JP 2015191279A
- Authority
- JP
- Japan
- Prior art keywords
- signal
- address
- peripheral circuit
- processing device
- cpu
- 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.)
- Granted
Links
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Microcomputers (AREA)
- Bus Control (AREA)
Abstract
Description
本発明は、処理システムに関する。 The present invention relates to a processing system.
プロセッサがアクセス可能なアドレス空間の所定のアドレスから所定の周期でデータを読み出し、読み出したデータが所定の条件を満たすとき、プロセッサに対する割り込み信号を発生するポーリング部が知られている(例えば、特許文献1参照)。ポーリング部は、アドレス空間において割り当てられたアドレスを持ち、所定のアドレス、所定の周期及び所定の条件の少なくとも1つを設定するためのデータを格納するレジスタを有する。 There is known a polling unit that reads data at a predetermined cycle from a predetermined address in an address space accessible by the processor, and generates an interrupt signal for the processor when the read data satisfies a predetermined condition (for example, patent document) 1). The polling unit has an address assigned in the address space, and has a register for storing data for setting at least one of a predetermined address, a predetermined period, and a predetermined condition.
また、特定アドレスのデータが期待値になるまでデータを繰り返し参照して待つポーリング処理の実行が演算装置で必要となった場合に、ポーリング処理の実行によりデータが期待値と一致するか否かを判断する判断手段を有する省電力制御装置が知られている(例えば、特許文献2参照)。制御手段は、データが期待値と一致すると判断されるまで、演算装置を省電力モードに遷移するように制御する。 In addition, when the processing device needs to execute polling processing by repeatedly referring to the data until the data at the specific address reaches the expected value, whether or not the data matches the expected value by executing the polling processing is determined. A power saving control device having a determination means for determining is known (for example, see Patent Document 2). The control means controls the arithmetic device to transition to the power saving mode until it is determined that the data matches the expected value.
割り込み処理では、周辺回路が処理の完了の割り込み信号を中央処理装置(CPU)に対して通知する。そのため、CPUは、周辺回路に対して処理の開始を指示した後、全く別の処理を行ったり、割り込み信号が通知されるまで、消費電力の小さいスリープモードで待機することができるメリットがある。しかし、CPUは、割り込み信号が通知された場合、割り込み処理に移行する前に、その時点で実行している処理を後から再開できるようにCPU内部の汎用レジスタの値、プログラムカウンタの値、CPUの内部状態を保持するプロセッサステータスレジスタの値などを一旦、ランダムアクセスメモリ(RAM)に待避する。CPUは、待避が完了した後、割り込み信号に対応した処理を行い、処理が完了したらRAMに待避してある汎用レジスタの値、プログラムカウンタの値、プロセッサステータスレジスタの値を復元し、元々実行していた処理を再開する。 In interrupt processing, the peripheral circuit notifies the central processing unit (CPU) of an interrupt signal indicating completion of processing. Therefore, after instructing the peripheral circuit to start processing, the CPU can perform completely different processing or can stand by in a sleep mode with low power consumption until an interrupt signal is notified. However, when the CPU is notified of the interrupt signal, the CPU is allowed to resume the processing being executed at that time before the transition to the interrupt processing, the value of the general-purpose register in the CPU, the value of the program counter, the CPU The value of the processor status register holding the internal state of the memory is temporarily saved in a random access memory (RAM). After the saving is completed, the CPU performs processing corresponding to the interrupt signal. When the processing is completed, the general-purpose register value saved in the RAM, the program counter value, and the processor status register value are restored and originally executed. Resume the process that was running.
また、CPUは、割り込み信号をスリープモードで受信すると、スリープ時の汎用レジスタ、プログラムカウンタ、プロセッサステータスレジスタの値のRAMへの待避、割り込み信号に対応した処理、RAMからの汎用レジスタ、プログラムカウンタ、プロセッサステータスレジスタの値の復元を行う。割り込み処理では、これらの値のRAMへの待避と復元がオーバーヘッドとなる点がデメリットである。 Further, when the CPU receives the interrupt signal in the sleep mode, the CPU saves the general-purpose register, program counter, and processor status register value during sleep, processing corresponding to the interrupt signal, general-purpose register from the RAM, program counter, Restores the value of the processor status register. In the interrupt processing, the disadvantage is that saving and restoring these values to the RAM is an overhead.
割り込み処理では、周辺回路側が処理の完了を通知する発信元となるのに対し、ポーリング処理では、CPUから周辺回路に対して処理の完了を問い合わせる。具体的には、周辺回路は、自身の処理状態に応じて値が変わる周辺回路ステータスレジスタを備えており、CPUは、この周辺回路ステータスレジスタの値を読み出して値を確認することで、周辺回路の処理が完了しているか否かを判断する。CPUは、読み出した周辺回路ステータスレジスタの値が、まだ処理を実施中であることを表す値であったときは、もう一度、周辺回路ステータスレジスタの値を読み出し、値を確認することを繰り返す。CPUが何度も周辺回路ステータスレジスタの値の読み出しを繰り返しているうちに、いずれ周辺回路が処理を完了し、周辺回路ステータスレジスタの値が処理完了を表す値に変化し、CPUは処理完了を知ることができる。 In the interrupt process, the peripheral circuit side becomes a transmission source notifying the completion of the process, whereas in the polling process, the CPU inquires the peripheral circuit about the completion of the process. Specifically, the peripheral circuit includes a peripheral circuit status register whose value changes according to its processing state, and the CPU reads the value of the peripheral circuit status register and confirms the value to thereby check the peripheral circuit. It is determined whether or not the process is completed. When the read value of the peripheral circuit status register is a value indicating that processing is still being performed, the CPU repeats reading the value of the peripheral circuit status register and confirming the value again. While the CPU repeatedly reads the value of the peripheral circuit status register many times, the peripheral circuit eventually completes the process, and the value of the peripheral circuit status register changes to a value indicating the completion of the process. I can know.
ポーリング処理のメリットは、割り込み処理への移行前と通常処理への復帰前で行われる汎用レジスタ、プログラムカウンタ、プロセッサステータスレジスタの値のRAMへの待避と復帰が行われないため、これらによるクロックサイクルや消費電力のオーバーヘッドがない点である。CPUが周辺回路に処理を行わせる頻度が多いプログラムを実装する場合、これを割り込み処理を用いたプログラムとして実装すると、頻繁に割り込み処理が行われ、割り込み処理のオーバーヘッドが大きくなる点が課題である。 The merit of polling processing is that the values of general-purpose registers, program counters, and processor status registers that are stored before the transition to interrupt processing and before returning to normal processing are not saved to and restored from the RAM. And no power consumption overhead. When implementing a program that causes the CPU to perform processing frequently in the peripheral circuit, if this is implemented as a program using interrupt processing, interrupt processing is frequently performed and the overhead of interrupt processing increases. .
ポーリング処理のデメリットは、周辺回路での処理がなかなか完了せず、CPUが周辺回路ステータスレジスタの値の読み出しを繰り返す回数が多くなる場合に、CPU及びRAMの消費電力が増えたり、CPUの他にバスアクセスするモジュールでの処理時間が延び、消費電力が増えたりする点である。CPUが周辺回路ステータスレジスタを繰り返し読み出すとき、CPUは次の手順で示すプログラムを繰り返し実行することになる。 The disadvantage of the polling process is that when the processing in the peripheral circuit is not completed easily and the number of times the CPU repeats reading the value of the peripheral circuit status register increases, the power consumption of the CPU and RAM increases, and in addition to the CPU The processing time in the module that accesses the bus is extended, and the power consumption is increased. When the CPU repeatedly reads the peripheral circuit status register, the CPU repeatedly executes the program shown in the following procedure.
(1)CPUは、周辺回路ステータスレジスタの値を読み出す。(2)CPUは、読み出した値が周辺回路の処理完了を表す値と一致するか比較する。(3)CPUは、一致しない場合は、(1)に戻ってやり直す。 (1) The CPU reads the value of the peripheral circuit status register. (2) The CPU compares whether the read value matches the value indicating the completion of processing of the peripheral circuit. (3) If they do not match, the CPU returns to (1) and starts again.
このとき、CPUは常に動作し続けることになるので電力を消費する。また、CPUは、(1)、(2)、(3)の実行を指示するプログラムをRAMから読み出すためRAMの電力消費が生ずる。また、CPU、RAM、及び周辺回路は、バスを介して接続され、ステータスレジスタをはじめ周辺回路の各種レジスタへのアクセス、RAMへのアクセスはバスを介して行われる。しかし、ポーリング処理を行っている間、CPUは、頻繁にバスを使用することになる。すると、ダイレクトメモリアクセスコントローラ(DMAC)など、バスを介してアクセスするブロックがCPU以外に存在する場合、これらのブロックのアクセスに対して競合又は阻害することになり、他のブロックの処理完了が遅れたり、動作時間が延びることにより余分な電力を消費したりする。 At this time, the CPU continues to operate and consumes power. Further, since the CPU reads from the RAM a program that instructs execution of (1), (2), and (3), the RAM consumes power. The CPU, RAM, and peripheral circuit are connected via a bus, and access to various registers of the peripheral circuit including the status register and access to the RAM are performed via the bus. However, the CPU frequently uses the bus during the polling process. Then, when there are blocks other than the CPU, such as a direct memory access controller (DMAC), the access to these blocks competes or obstructs, and the processing completion of other blocks is delayed. Or extra power is consumed by extending the operation time.
特許文献1では、ポーリング処理を専用で担うポーリング部が開示されている。CPUが直接、周辺回路のステータスレジスタの値を読み出して期待する値と一致するかを判定する代わりに、ポーリング部がこれを行う。ポーリング部からCPUへは割り込み信号線が接続されており、ステータスレジスタの値が期待値と一致したときは、この割り込み信号線を通じてポーリング部がCPUに対して割り込みを通知する。これによれば、周辺回路が処理完了を通知する信号を割り込み信号としてCPUに直接出力していない場合においても、CPUはポーリング部を介して割り込み処理によって周辺回路での処理完了を知ることができるため、割り込み処理でのメリットである処理完了まで別の処理を行うことができ、また、消費電力の小さいスリープモードで待機できるなどのメリットを享受できる。しかし、CPUは、割り込み信号を受信する度に汎用レジスタ、プログラムカウンタ、プロセッサステータスレジスタの値のRAMへの待避と、処理完了時に元々実行していた処理を再開するためのこれらの値のRAMからの復元が行われるデメリットは解消されない。
特許文献2では、ポーリング処理を専用で担う省電力モード管理部が開示されている。CPUは、予めポーリング対象のステータスレジスタのアドレスと期待する値を省電力モード管理部内に備わったアドレスレジスタとデータレジスタに設定した後、省電力モード管理部に対してポーリング実行を指示する。省電力モード管理部は、CPUへクロックを供給しているクロック制御部に対し、CPUへのクロック供給を止めることを指示し、同時にアドレスレジスタで指示された周辺回路のステータスレジスタの値を読み出す。省電力モード管理部は、読み出した値がデータレジスタで指示された値と一致するかを確認し、不一致の場合、一致するまでステータスレジスタの値を読み出し、値の一致の確認を繰り返し、一致した場合、クロック制御部に対してCPUへのクロック供給を再開させる。 Patent Document 2 discloses a power saving mode management unit that performs dedicated polling processing. The CPU previously sets the address of the status register to be polled and the expected value in the address register and data register provided in the power saving mode management unit, and then instructs the power saving mode management unit to execute polling. The power saving mode management unit instructs the clock control unit that supplies a clock to the CPU to stop the clock supply to the CPU, and simultaneously reads the value of the status register of the peripheral circuit designated by the address register. The power saving mode management unit checks whether the read value matches the value instructed by the data register. If there is a mismatch, it reads the value in the status register until it matches, and repeats the value match check to find a match. In this case, the clock control unit is caused to resume the clock supply to the CPU.
特許文献2では、割り込み処理を用いていないため、汎用レジスタ、プログラムカウンタ、プロセッサステータスレジスタの値のRAMへの待避と復帰が行われるデメリットがない。また、省電力モード管理部が周辺回路のステータスレジスタを繰り返し読み出し、その間、CPUは、クロック供給が停止しているためCPUでの消費電力が抑えられる。また、CPUは、プログラムのRAMからの読み出しやステータスレジスタアクセスのためのバスアクセスも行わないので、RAMでの電力消費やバスアクセスの競合の問題も起こらない。 In Patent Document 2, since interrupt processing is not used, there is no demerit that the values of general-purpose registers, program counters, and processor status registers are saved to and restored from RAM. In addition, the power saving mode management unit repeatedly reads the status register of the peripheral circuit, and during that time, the CPU stops the clock supply, so that power consumption in the CPU can be suppressed. Further, since the CPU does not read the program from the RAM and does not perform bus access for status register access, there is no problem of power consumption in the RAM and contention of bus access.
しかし、特許文献2では、以下に挙げる3つの課題がある。
(1)プログラム中で省電力モード管理部内のアドレスレジスタやデータレジスタの設定、省電力モード管理部に対するポーリング処理開始の指示が必要である。したがって、省電力モード管理部を備えているか否かによって異なる実装のプログラムが必要であり、省電力モード管理部を備えないシステムとの間でプログラムを移植するときにプログラムの変更量が多くなる。
However, Patent Document 2 has the following three problems.
(1) It is necessary to set the address register and data register in the power saving mode management unit and instruct the power saving mode management unit to start polling processing in the program. Therefore, different implementation programs are required depending on whether or not the power saving mode management unit is provided, and the amount of program change increases when the program is ported to a system that does not include the power saving mode management unit.
(2)省電力モード管理部がポーリング対象としている周辺回路以外のモジュールからCPUに割り込みが通知されたときの動作が開示されていない。 (2) The operation when the CPU is notified of an interrupt from a module other than the peripheral circuit that is the polling target by the power saving mode management unit is not disclosed.
(3)突然のクロックの供給停止及び再開が可能な特殊なCPUが必要となる。通常のCPUは、クロックの供給停止が可能なwaitモードを備えるが、waitモードへの移行は、CPU上でwaitモード移行の専用命令を実行することで行われる。waitモードから再びCPUをwake upモードに移行させるには、CPUへのクロックの供給再開とCPUへ何らかの割り込み通知を行うのが一般的である。しかし、割り込み通知によってCPUをwake upモードにした場合、汎用レジスタ、プログラムカウンタ、プロセッサステータスレジスタの値のRAMへの待避と復元が必要となる。 (3) A special CPU capable of suddenly stopping and restarting clock supply is required. A normal CPU has a wait mode in which clock supply can be stopped, but the transition to the wait mode is performed by executing a dedicated instruction for the wait mode transition on the CPU. In order to shift the CPU from the wait mode to the wake up mode again, it is common to restart the supply of the clock to the CPU and notify the CPU of some kind of interrupt. However, when the CPU is set to the wake up mode by the interrupt notification, it is necessary to save and restore the values of the general-purpose register, the program counter, and the processor status register to the RAM.
本発明の目的は、特殊な処理装置を必要とせず、低消費電力でポーリング処理を行うことができる処理システムを提供することである。 An object of the present invention is to provide a processing system that can perform polling processing with low power consumption without requiring a special processing device.
処理システムは、処理装置と、前記処理装置からリクエスト信号及びアドレス信号を入力し、前記処理装置にレディ信号及びリードデータ信号を出力するポーリング回路と、前記ポーリング回路からリクエスト信号及びアドレス信号を入力し、前記ポーリング回路にレディ信号及びリードデータ信号を出力する周辺回路とを有し、前記処理装置は、前記周辺回路にリードアクセスするために、活性化状態のリクエスト信号及び前記周辺回路に対応するアドレス信号を出力し、前記周辺回路は、前記処理装置のリクエスト信号に対応する処理が終了していない場合には非活性化状態のレディ信号を出力し、前記処理装置のリクエスト信号に対応する処理が終了した場合には活性化状態のレディ信号及びリードデータ信号を出力し、前記ポーリング回路は、前記処理装置から入力したアドレス信号が第1のアドレス範囲のアドレスである場合には、前記処理装置から入力したアドレス信号を第2のアドレス範囲のアドレスに変換して前記周辺回路にアドレス信号を出力し、前記処理装置から入力したアドレス信号が第1のアドレス範囲のアドレスでない場合には、前記処理装置から入力したアドレス信号と同じアドレス信号を前記周辺回路に出力するアドレス信号生成部と、前記処理装置から入力したアドレス信号が第1のアドレス範囲のアドレスであり、前記周辺回路から入力したリードデータ信号が前記処理装置から入力したアドレス信号に対応する期待値と同じである場合には、前記周辺回路から入力したレディ信号と同じレディ信号を前記処理装置に出力し、その他の場合には非活性化状態のレディ信号を前記処理装置に出力するレディ信号生成部とを有する。 The processing system inputs a request signal and an address signal from the processing device, a polling circuit that outputs a ready signal and a read data signal to the processing device, and a request signal and an address signal from the polling circuit. And a peripheral circuit that outputs a ready signal and a read data signal to the polling circuit, and the processing device has an activated request signal and an address corresponding to the peripheral circuit for read access to the peripheral circuit. A signal is output, and the peripheral circuit outputs a ready signal in an inactive state when processing corresponding to the request signal of the processing device is not completed, and processing corresponding to the request signal of the processing device is performed. When finished, an active ready signal and a read data signal are output, When the address signal input from the processing device is an address in the first address range, the circuit converts the address signal input from the processing device into an address in the second address range and addresses the peripheral circuit An address signal generation unit that outputs a signal and outputs the same address signal as the address signal input from the processing device to the peripheral circuit when the address signal input from the processing device is not an address in the first address range; When the address signal input from the processing device is an address in the first address range, and the read data signal input from the peripheral circuit is the same as the expected value corresponding to the address signal input from the processing device. The same ready signal input from the peripheral circuit is output to the processing device, and in other cases And a ready signal generator for outputting a ready signal activated state to said processing unit.
ポーリング回路を設けることにより、特殊な処理装置を必要とせず、低消費電力でポーリング処理を行うことができる。 By providing the polling circuit, it is possible to perform polling processing with low power consumption without requiring a special processing device.
図1は、本実施形態によるワイヤレスセンサノード100の構成例を示す図である。ワイヤレスセンサノード100は、全体制御部101、センサ部102、RF(Radio Frequency)部103、発電電源管理部104、アンテナ105及び発電素子106を有する。発電素子106は、光、温度差又は振動などのエネルギー112を基に発電を行い、電力を発電電源管理部104に供給する。発電電源管理部104は、電力を管理し、全体制御部101、センサ部102及びRF部103に対して、電力を供給する。全体制御部101は、I2C(Inter-Integrated Circuit)、SPI(Serial Peripheral Interface)などのシリアルインターフェースを介して、センサ部102、RF部103及び発電電源管理部104を制御する。センサ部102は、温度、照度、加速度又は圧力などの情報111を検出し、情報111を全体制御部101に出力する。全体制御部101は、RF部103及びアンテナ105を介して、情報111を無線信号113として送信する。また、全体制御部101は、RF部103及びアンテナ105を介して、その他の情報を無線信号113として送受信することができる。
FIG. 1 is a diagram illustrating a configuration example of a
ワイヤレスセンサノード100には電池や商用電源が接続されず、発電素子106は、環境から得られるエネルギー112を基に自己発電する。したがって、ワイヤレスセンサノード100は、徹底的な低消費電力が求められる。ワイヤレスセンサノード100に求められる様々な要求仕様や状況に応じた制御を行うために、全体制御部101は、プログラマビリティが求められるため、MCU(マイクロコントローラユニット)が用いられる。
A battery or a commercial power source is not connected to the
図2は、全体制御部101の構成例を示す図である。全体制御部101は、処理システムであり、中央処理装置(CPU)201、ポーリング回路202、RAM203、割り込みコントローラ204、バス205、ダイレクトメモリアクセスコントローラ(DMAC)206、第1の周辺回路PH1、第2の周辺回路PH2、第3の周辺回路PH3及び第4の周辺回路PH4を有する。バス205には、ポーリング回路202、RAM203、DMAC206及び周辺回路PH1〜PH4が接続される。バス205は、ポーリング回路202及び周辺回路PH1〜PH4の間に接続される。割り込みコントローラ204は、周辺回路PH1〜PH4の割り込み信号IR1〜IR4及び外部割込み信号IRRを入力し、割り込み信号IRをCPU201及びポーリング回路202に出力する。周辺回路PH1〜PH4は、それぞれ、イネーブル信号ENS1〜ENS4をポーリング回路202に出力する。周辺回路PH1〜PH3は、I2C回路又はSPI回路などのインターフェース回路であり、それぞれ、図1のセンサ部102、RF部103及び発電電源管理部104に接続される。
FIG. 2 is a diagram illustrating a configuration example of the
図3は、各周辺回路PH1〜PH4の一部の構成例を示す図である。周辺回路PH1〜PH4は、それぞれ、アドレスレジスタ301、送信データバッファレジスタ302、受信データバッファレジスタ303、制御レジスタ304、ステータスレジスタ305、論理和(OR)回路306及びセレクタ307を有する。レジスタ301〜305のデータ端子D及びイネーブル端子ENは、論理回路311〜320の32ビット出力データを入力する。レジスタ301〜305は、それぞれ、クロック信号に同期して、データ端子Dの入力データをラッチし、ラッチした32ビットデータを出力端子Qから出力する。セレクタ307は、バス205から入力するアドレスADDRに応じて、レジスタ301〜305の32ビット出力データのうちのいずれかを選択し、32ビットデータRDATAをバス205に出力する。論理和回路306は、ステータスレジスタ305のイネーブル端子ENの32ビットデータの論理和をイネーブル信号ENSとして出力する。
FIG. 3 is a diagram illustrating a configuration example of a part of each of the peripheral circuits PH1 to PH4. Each of the peripheral circuits PH1 to PH4 includes an
CPU201が周辺回路PH1〜PH3を介してセンサ部102、RF部103及び発電電源管理部104へデータ送信する手順は次の通りである。例として、CPU201が周辺回路PH1を介してセンサ部102へデータ送信する手順を説明する。まず、CPU201は、ポーリング回路202及びバス205を介して、送信先アドレスを周辺回路PH1内のアドレスレジスタ301に書き込む。なお、送信先アドレスは、センサ部102を示すアドレスである。次に、CPU201は、ポーリング回路202及びバス205を介して、送信データを周辺回路PH1内の送信データバッファレジスタ302に書き込む。ここで、送信データは、センサデータ読み出しコマンド等を含む。次に、CPU201は、ポーリング回路202及びバス205を介して、送信の指示を周辺回路PH1内の制御レジスタ304に書き込む。その後、周辺回路PH1は、送信データをセンサ部102に送信する。センサ部102は、送信データに従い、情報111を検出し、周辺回路104、バス205及びポーリング回路202を介して、情報111をCPU201に送信する。
The procedure in which the
図4は、CPU201、ポーリング回路202、バス205及び周辺回路PH1間の信号を示す図である。周辺回路PH1の場合を例に示すが、周辺回路PH2〜PH4も周辺回路PH1の場合と同様である。リクエスト信号REQは、アクセスリクエスト信号である。アドレス信号ADDRは、アクセス先アドレス信号である。アクセス種類信号WRITEは、リード又はライトのアクセスの種類を示す信号である。ライトデータ信号WDATAは、ライトアクセス時のライトデータ信号である。リードデータ信号RDATAは、リードアクセス時のリードデータ信号である。レディ信号READYは、アクセス完了を示す信号である。
FIG. 4 is a diagram illustrating signals among the
例えば、CPU201が32ビットCPUの場合、信号ADDR、WDATA、RDATAは32ビット信号である。信号REQ、ADDR、WRITE、WDATAは、アクセス元からアクセス先に出力される信号である。信号RDATA及びREADYは、アクセス先からアクセス元に出力される信号である。図4では、最終アクセス先が周辺回路PH1になっているが、CPU201がプログラムコードの読み出しやデータの読み出し、書き込みを行うため、図1のRAM203も最終アクセス先となり得る。また、図4では、CPU201がアクセス元になっているが、図2のDMAC206は、RAM203や周辺回路PH1〜PH4に対して読み出しや書き込みアクセスを行うのでアクセス元になり得る。ただし、DMAC206は、ポーリング処理を行わないので、ポーリング回路202を介する必要がなく、直接バス205に接続される。
For example, when the
ポーリング回路202は、CPU201からリクエスト信号REQ、アドレス信号ADDR、アクセス種類信号WRITE及びライトデータ信号WDATAを入力し、CPU201にレディ信号READY及びリードデータ信号RDATAを出力する。周辺回路PH1は、バス205を介して、ポーリング回路202からリクエスト信号REQ、アドレス信号ADDR、アクセス種類信号WRITE及びライトデータWDATAを入力し、ポーリング回路202にレディ信号READY及びリードデータ信号RDATAを出力する。
The
次に、通常のCPU201のポーリング処理を説明する。ポーリング対象としている周辺回路PH1は、CPU201から指示された処理が完了したら、32ビットのステータスレジスタ305の最下位ビットの値を0から1に変更する。CPU201は、32ビットのステータスレジスタ305の値を読み出し、最下位ビットの値を抽出する。最下位ビットが1である場合には、周辺回路PH1の処理が完了しているので、CPU201は、次の処理に移る。最下位ビットが0である場合、周辺回路PH1が、まだ処理を完了していないため、CPU201は、次の処理には移れず、再び周辺回路PH1の処理が完了したかを確認する処理を繰り返す。周辺回路PH1の処理実行に時間がかかり、ステータスレジスタ305の最下位ビットがなかなか1に変化しない場合、CPU201は、何度もステータスレジスタ305の最下位ビットを読み出して確認する処理を繰り返すことになる。本実施形態では、このような繰り返し処理をなくすための処理を説明する。本実施形態では、ステータスレジスタ305の最下位ビットを読み出して得られる値は必ず1であることが保証され、1回目の実行で必ず次の処理に進むことができる。以下、その詳細を説明する。
Next, normal polling processing of the
図5はCPU201及びポーリング回路202間の信号を示すタイミングチャートであり、図6はポーリング回路202及びバス205間の信号を示すタイミングチャートであり、図7はバス205及び周辺回路PH1間の信号を示すタイミングチャートである。信号CLKは、クロック信号である。信号LSBは、周辺回路PH1内のステータスレジスタ305内のデータの最下位ビットの信号である。
5 is a timing chart showing signals between the
CPU201が周辺回路PH1内のステータスレジスタ305の最下位ビットに対して読み出しアクセスする例を説明する。すべての信号は、CPU201、ポーリング回路202、バス205及び周辺回路PH1に共通で供給されるクロック信号CLKの立ち上がりエッジで伝達される。CPU201は、ポーリング回路202に対して、図5の時刻T1において、アクセス要求を行ってもよいことを示す信号READY=1であることを確認し、信号REQ=1とするアクセス要求を出力する。それと同時に、CPU201は、ポーリング回路202に対して、アクセス先アドレスの信号ADDR=A’(ステータスレジスタ305の最下位ビットLSBを示すアドレス)、及びアクセス種類が読み出しアクセスであることを示す信号WRITE=0を出力する。
An example in which the
ポーリング回路202は、内部のアドレス信号生成部1001(図10)により、CPU201から入力された信号ADDR=A’を図6の信号ADDR=Aに変換してバス205へ出力する。また、ポーリング回路202は、CPU201から入力された信号REQ及び信号WRITEをそのままバス205へ出力する。
The
バス205は、ポーリング回路202からの信号REQ及びWRITEにより、CPU201から読み出しアクセスの要求が来ていることを知る。そして、バス205は、信号ADDRからアクセス先を判別し、アクセス先の周辺回路PH1に対して、ポーリング回路202からの信号REQ、ADDR、及びWRITEを出力する。周辺回路PH1は、ステータスレジスタ305の最下位ビットLSBの読み出しデータの準備中であることを示す信号READY=0をバス205に出力する。信号READYは、周辺回路PH1からバス205及びポーリング回路202を介してCPU201に出力される。CPU201は、信号READY=0となっていることから、読み出しアクセスがまだ実行中であることを知る。
The
時刻T3の後、周辺回路PH1は、アドレス信号ADDR=Aで指定されたステータスレジスタ305の値Data(A)の出力準備ができ、信号RDATA=Data(A)を出力し、それと同時に、信号RDATAが有効データであることを示す信号READY=1を出力する。この時、周辺回路PH1は、CPU201から指示されたセンサデータの読み出し処理が完了していないので、ステータスレジスタ305の最下位ビットLSBの値は0である。したがって、信号RDATAの最下位ビットLSBは0である。信号READY及びRDATAは、周辺回路PH1からバス205を介してポーリング回路202に出力される。
After time T3, the peripheral circuit PH1 is ready to output the value Data (A) of the
時刻T4では、ポーリング回路202は、クロック信号CLKの立ち上がりエッジで、信号READY=1となっていることから、それと同時に、信号RDATA=Data(A)が入力されていることを知る。ポーリング回路202は、32ビットの信号RDATAのうち、CPU201がポーリング対象として確認したい最下位ビットLSBの値を取り出し、この値がCPU201が期待する1であるかを確認する。最下位ビットLSBが0であるので、ポーリング回路202は、信号READY=0をCPU201に対して継続して出力する。
At time T4, the
その所定時間後の時刻T6では、ポーリング回路202は、再び、バス205を介して、周辺回路PH1に対して、信号ADDR=A、信号REQ=1、信号WRITE=0を出力する。なお、時刻T6の前の時刻T5では、周辺回路PH1は、CPU201の指示によるセンサデータの読み出し処理が完了し、ステータスレジスタ305の最下位ビットLSBを0から1に変更する。
At time T6 after the predetermined time, the
時刻T7の後では、周辺回路PH1は、ステータスレジスタ305の最下位ビットLSBの読み出しデータの準備中であることを示す信号READY=0を、バス205及びポーリング回路202を介して、CPU201に出力する。CPU201は、信号READY=0となっていることから、読み出しアクセスがまだ実行中であることを知る。
After time T7, the peripheral circuit PH1 outputs a signal READY = 0 indicating that the read data of the least significant bit LSB of the
時刻T8の後、周辺回路PH1は、アドレス信号ADDR=Aで指定されたステータスレジスタ305の値Data(A)の出力準備ができ、信号RDATA=Data(A)を出力し、それと同時に、信号RDATAが有効データであることを示す信号READY=1を出力する。この時、周辺回路PH1は、CPU201から指示されたセンサデータの読み出し処理が完了しているので、ステータスレジスタ305の最下位ビットLSBの値は1である。したがって、信号RDATAの最下位ビットLSBは1である。信号READY及びRDATAは、周辺回路PH1からバス205を介してポーリング回路202に出力される。
After time T8, the peripheral circuit PH1 is ready to output the value Data (A) of the
時刻T8の後では、ポーリング回路202は、信号READY=1となっていることから、それと同時に、信号RDATA=Data(A)が入力されていることを知る。ポーリング回路202は、32ビットの信号RDATAのうち、CPU201がポーリング対象として確認したい最下位ビットLSBの値を取り出し、この値がCPU201が期待する1であるかを確認する。最下位ビットLSBが1であるので、ポーリング回路202は、CPU201に対して、信号READY=1及び32ビット信号RDATA=1を出力する。CPU201は、信号READY=1となっていることから、読み出しアクセスが終了したことを知る。この時、CPU201が入力する信号RDATAは、必ず1であることが保証されている。CPU201は、ステータスレジスタ305の最下位ビットLSBを読み出して得られる値は必ず1であることが保証され、1回目の実行で必ず次の処理に進むことができる。
After the time T8, the
以上のように、CPU201は、周辺回路PH1にリードアクセスするために、「1」のリクエスト信号REQ及び周辺回路PH1に対応するアドレス信号ADDRを出力する。周辺回路PH1は、CPU201のリクエスト信号REQに対応する処理が終了していない場合には「0」のレディ信号READYを出力し、CPU201のリクエスト信号REQに対応する処理が終了した場合には「1」のレディ信号REDY及びリードデータ信号RDATAを出力する。なお、信号REQ及びREADYは、それぞれ、「1」が活性化状態を示し、「0」が非活性化状態を示す。
As described above, the
ポーリング回路202は、信号RDATAの最下位ビットLSBが1になるまで、周辺回路PH1に対して、信号REQ=1等の出力を繰り返す。ポーリング回路202は、周辺回路PH1に対して、信号REQ=1等を2回出力しているが、CPU201は、信号REQ=1のアクセス要求を出力してから、実際に要求した信号RDATA=Data(A’)の到着までの1回の読み出しアクセスで期待する値の1を受け取っている。したがって、CPU201が信号REQ=1の読み出し及び確認処理を繰り返し実行する必要がないので、電力消費が抑えられ、プログラムを繰り返しRAM203から読み出すことによるRAM203の電力消費が抑えられる。
The
図8は、メモリマップを示す図である。以下、ポーリング回路202が、CPU201から入力するアドレス信号ADDRを基にCPU201が32ビットの信号RDATAのうちの何ビット目の値をポーリング処理のチェック対象としているのか、及び期待する値が0と1のどちらなのかを判別する方法を説明する。各レジスタ301〜305は、32ビットでバイトアドレッシング(1バイト=8ビット単位でアドレスが割り振られている)されているものとする。
FIG. 8 is a diagram showing a memory map. Hereinafter, based on the address signal ADDR input from the
第1の周辺回路PH1の各種レジスタ301〜305は、アドレス0x40000000から0x40000FFCにマッピングされている。ここで、0xは、16進数を示す。例えば、ステータスレジスタ305のアドレスは0x40000000、制御レジスタ304は0x40000004、受信データバッファレジスタ303は0x40000008などのようにマッピングされる。通常、CPU201がレジスタ301〜305の値を読み出したり、レジスタ301〜305に値を書き込むときは、これらのアドレスを用いてアクセスする。
The
アドレス0x50000000〜0x5001FFFCは、CPU201が第1の周辺回路PH1のレジスタのあるビットが0であることを期待して、レジスタに読み出しアクセスするときのためのアドレスである。アドレス0x60000000〜0x6001FFFCは、CPU201が第1の周辺回路PH1のレジスタのあるビットが1であることを期待して、レジスタに読み出しアクセスするときのためのアドレスである。
Addresses 0x50000000 to 0x5001FFFC are addresses when the
レジスタ領域801aは、第1の周辺回路PH1の通常レジスタ領域である。レジスタ領域801bは、第1の周辺回路PH1の期待値が0のレジスタ領域である。レジスタ領域801cは、第1の周辺回路PH1の期待値が1のレジスタ領域である。レジスタ領域802aは、第2の周辺回路PH2の通常レジスタ領域である。レジスタ領域802bは、第2の周辺回路PH2の期待値が0のレジスタ領域である。レジスタ領域802cは、第2の周辺回路PH2の期待値が1のレジスタ領域である。レジスタ領域804aは、第4の周辺回路PH4の通常レジスタ領域である。レジスタ領域804bは、第4の周辺回路PH4の期待値が0のレジスタ領域である。レジスタ領域804cは、第4の周辺回路PH4の期待値が1のレジスタ領域である。
The
図9は、第1の周辺回路PH1の通常レジスタ領域801a、期待値が0のレジスタ領域801b、及び期待値が1のレジスタ領域801cの例を示す図である。例えば、通常レジスタ領域801aのアドレスが0x40000000で指定されるレジスタの0ビット目(最下位ビット)Aを値が0であることを期待して読み出しアクセスするときは、CPU201は、信号ADDR=0x50000000をポーリング回路202に出力する。また、通常レジスタ領域801aのアドレスが0x40000000で指定されるレジスタの0ビット目(最下位ビット)Aを値が1であることを期待して読み出しアクセスするときは、CPU201は、信号ADDR=0x60000000をポーリング回路202に出力する。
FIG. 9 is a diagram illustrating an example of the
通常レジスタ領域801aのアドレスが0x40000000で指定されるレジスタの1ビット目Bを値が0であることを期待して読み出しアクセスするときは、CPU201は、信号ADDR=0x50000004をポーリング回路202に出力する。また、通常レジスタ領域801aのアドレスが0x40000000で指定されるレジスタの1ビット目Bを値が1であることを期待して読み出しアクセスするときは、CPU201は、信号ADDR=0x60000004をポーリング回路202に出力する。
The
通常レジスタ領域801aのアドレスが0x40000FFCで指定されるレジスタの31ビット目(最上位ビット)Cを値が0であることを期待して読み出しアクセスするときは、CPU201は、信号ADDR=0x5001FFFCをポーリング回路202に出力する。また、通常レジスタ領域801aのアドレスが0x40000FFCで指定されるレジスタの31ビット目(最上位ビット)Cを値が1であることを期待して読み出しアクセスするときは、CPU201は、信号ADDR=0x6001FFFCをポーリング回路202に出力する。
When the
ポーリング処理でアクセスしたいレジスタ301〜305の通常レジスタ領域801aのアドレスをAddr_n、ビット位置をBITとすると、このビットが0であることを期待して読み出しアクセスするときに、CPU201が出力するアドレス信号ADDRは、次式で表される。
When the address of the
ADDR=0x50000000+(Addr_n−0x40000000)×32×4+BIT×4 ADDR = 0x50000000 + (Addr_n-0x40000000) × 32 × 4 + BIT × 4
同様に、ポーリング処理でアクセスしたいレジスタ301〜305の通常レジスタ領域801aのアドレスをAddr_n、ビット位置をBITとすると、このビットが1であることを期待して読み出しアクセスするときに、CPU201が出力するアドレス信号ADDRは、次式で表される。
Similarly, assuming that the address of the
ADDR=0x60000000+(Addr_n−0x40000000)×32×4+BIT×4 ADDR = 0x60000000 + (Addr_n-0x40000000) × 32 × 4 + BIT × 4
図10は、ポーリング回路202の構成例を示す図である。ポーリング回路202は、アドレス信号生成部1001、レディ(READY)信号生成部1002、リードデータ(RDATA)信号生成部1003及びリクエスト(REQ)信号生成部1004を有する。
FIG. 10 is a diagram illustrating a configuration example of the
図11は、図10のアドレス信号生成部1001の構成例を示す図である。アドレス信号生成部1001は、アドレス比較部1101、アドレス変換部1102、アドレス保持部1103及びセレクタ1104を有する。アドレス信号生成部1001は、CPU201からの信号ADDRを変換し、変換した信号ADDRをバス205へ出力する。アドレス比較部1101は、CPU201から入力される32ビットの信号ADDRのうち、上位4ビットが0x5であれば、期待値0のレジスタ領域801bのアクセスと判断し、上位4ビットが0x6であれば、期待値1のレジスタ領域801cのアクセスと判断する。また、アドレス比較部1101は、上記の上位4ビットがそれ以外の値である場合、通常レジスタ領域801aへのアクセス、RAM203へのアクセスなど、ポーリング処理以外のアクセスと判断する。
FIG. 11 is a diagram illustrating a configuration example of the address
アドレス比較部1101は、信号ADDRの上位4ビットが0x5又は0x6の場合、CPU201からポーリングのためのアクセス要求が来たことを伝えるため、「1」のポーリングアクセス信号を出力し、それ以外の場合、「0」のポーリングアクセス信号を出力する。また、アドレス比較部1101は、期待値信号として、信号ADDRの上位4ビットが0x5の場合は0を出力し、信号ADDRの上位4ビットが0x6の場合は1を出力する。また、アドレス比較部1101は、信号ADDRの下位7ビットを4で割った値を基にポーリング対象のビット位置を算出し、ビット位置信号を出力する。
When the upper 4 bits of the signal ADDR are 0x5 or 0x6, the
アドレス変換部1102は、ポーリングアクセス信号が0の場合は、CPU201からの信号ADDRをそのままアドレス保持部1103及びセレクタ1104に出力する。また、アドレス変換部1102は、ポーリングアクセス信号が1の場合は、以下の手順でアドレスAddr_nを演算し、演算したアドレスAddr_nをアドレス保持部1103及びセレクタ1104に出力する。
When the polling access signal is 0, the
(1)アドレス変換部1102は、期待値が0の場合、CPU201から入力される信号ADDRから0x50000000を減算し、期待値が1の場合、CPU201から入力される信号ADDRから0x60000000を減算する。
(1) The
(2)アドレス変換部1102は、(1)で求めた値を7ビット論理右シフトする。
(2) The
(3)アドレス変換部1102は、(2)で求めた値に0x40000000を加算する。
(3) The
上記の手順により、CPU201がポーリング処理で確認したいビットを含むレジスタの通常レジスタ領域801aのアドレスAddr_nを復元できる。アドレス変換部1102は、アドレスAddr_nをアドレス保持部1103及びセレクタ1104に出力する。
According to the above procedure, the address Addr_n of the
アドレス保持部1103は、ポーリングアクセス信号が1の場合は、アドレス変換部1102が生成したアドレスAddr_nを保持する。これにより、周辺回路PH1から読み出したステータスレジスタ305の値が期待する値でないときにポーリング回路202が、ステータスレジスタ305の読み出しアクセスを繰り返し行うことが可能になる。
The
セレクタ1104は、ポーリングアクセス信号が0の場合は、アドレス変換部1102が出力する信号ADDRをそのままバス205へ出力する。この際、アドレス変換部1102は、アドレス変換を行わず、CPU201からの信号ADDRをそのまま出力している。また、セレクタ1104は、ポーリングアクセス信号が1の場合は、アドレス保持部1103が出力するアドレスAddr_nをバス205へ出力する。
When the polling access signal is 0, the selector 1104 outputs the signal ADDR output from the
以上のように、アドレス信号生成部1001は、CPU201から入力したアドレス信号ADDRが期待値0及び期待値1のレジスタ領域(第1のアドレス範囲)801b及び801cのアドレスである場合には、CPU201から入力したアドレス信号ADDRを通常レジスタ領域(第2のアドレス範囲)801aのアドレスに変換して、バス205を介して周辺回路PH1にアドレス信号ADDRを出力する。また、アドレス信号生成部1001は、CPU201から入力したアドレス信号ADDRが期待値0及び期待値1のレジスタ領域(第1のアドレス範囲)801b及び801cのアドレスでない場合には、CPU201から入力したアドレス信号ADDRと同じアドレス信号ADDRを、バス205を介して周辺回路PH1に出力する。アドレス保持部1103は、CPU201から入力したアドレス信号ADDRを通常レジスタ領域(第2のアドレス範囲)801aのアドレスに変換したアドレスを保持する。
As described above, when the address signal ADDR input from the
図12は、図10のREADY信号生成部1002の構成例を示す図である。READY信号生成部1002は、セレクタR1,R2、ビット位置保持部1201、期待値保持部1202、期待値比較部1203、及びポーリング中断判定部1204を有する。READY信号生成部1002は、CPU201へ出力する信号READYを生成する。
FIG. 12 is a diagram illustrating a configuration example of the READY
ビット位置保持部1201は、ポーリング処理の間、図11のアドレス比較部1101が出力するビット位置信号を保持し、セレクタR1に出力する。セレクタR1は、バス205から入力される32ビットの信号RDATAのうち、ビット位置保持部1201が出力するビット位置信号が示すビット位置の値を選択し、ビット信号として出力する。
The bit
期待値保持部1202は、ポーリング処理の間、図11のアドレス比較部1101が出力する期待値信号を保持し、期待値比較部1203へ出力する。期待値比較部1203は、セレクタR1から入力されるビット信号と期待値保持部1202から入力される期待値信号を比較し、両者が一致した場合には「1」の期待値判定信号を出力し、両者が不一致の場合には「0」の期待値判定信号を出力する。ポーリング中断判定部1204は、CPU201へ入力される割り込み信号IRを入力し、CPU201に対して割り込みが発生した場合は、「1」のポーリング中断信号をセレクタR2に出力する。
The expected
セレクタR2は、図11のアドレス比較部1101が出力するポーリングアクセス信号、期待値比較部1203が出力する期待値判定信号、ポーリング中断判定部1204が出力するポーリング中断信号に応じて、バス205からの信号READY又は0をCPU201に出力する。セレクタR2が出力する信号は、ポーリング回路202からCPU201へ出力される信号READYである。
The selector R2 receives the polling access signal output from the
図13は、セレクタR2の動作を説明するための図である。セレクタR2は、ポーリングアクセス信号、期待値判定信号、及びポーリング中断信号に応じて、信号を出力する。セレクタR2は、ポーリング中断信号が1の場合、ポーリングアクセス信号、期待値判定信号の値にかかわらず、バス205からの信号READYを選択して出力する。その理由は後述する。また、セレクタR2は、ポーリング中断信号が0の場合、以下の動作を行う。
FIG. 13 is a diagram for explaining the operation of the selector R2. The selector R2 outputs a signal in response to the polling access signal, the expected value determination signal, and the polling interruption signal. When the polling interruption signal is 1, the selector R2 selects and outputs the signal READY from the
ポーリングアクセス信号が0の場合、CPU201はポーリングのためのアクセスでない通常のアクセスを行っているため、セレクタR2は、バス205からの信号READYをそのままCPU201に出力する。
When the polling access signal is 0, the
ポーリングアクセス信号が1であり、期待値判定信号が1の場合、CPU201が期待する値が得られているので、セレクタR2は、バス205からの信号READYをそのままCPU201に出力する。この際、ポーリング回路202がバス205を介して周辺回路PH1のステータスレジスタ305の値を読み出す処理は完了しているので、バス205からの信号READYは1となっている。
When the polling access signal is 1 and the expected value determination signal is 1, the value expected by the
ポーリングアクセス信号が1であり、期待値判定信号が0の場合、CPU201が期待する値が得られておらず、CPU201には読み出しアクセスが継続しているように見せるため、セレクタR2は、「0」の信号READYをCPU201に出力する。
When the polling access signal is 1 and the expected value determination signal is 0, the value expected by the
次に、ポーリング中断信号が1になる条件と、そのときのポーリング回路202の動作を説明する。CPU201がポーリング処理をしているとき、もしポーリング対象のステータスレジスタ305の値が長時間にわたってCPUが期待する値に変化しなかった場合、ポーリング回路202からCPU201へ出力する信号READYは長時間にわたって0のままになる。CPU201から見ると、読み出しアクセスが長時間保留になっているように見える。CPU201がバスアクセスの途中に「1」の割り込み信号IRが入力されたときは、バスアクセスの完了を待ってから割り込み処理に移行する設計であった場合、ポーリング回路202が期待値一致を確認するまで、CPU201にとっては、信号READYが0であり、バスアクセスが完了していないように見える。そのため、CPU201は、割り込み処理に移行するまでに長い間待たされることになる。そこで、CPU201に「1」の割り込み信号IRが入力された場合は、CPU201は、すみやかに現在実行しているプログラムを中断し、割り込み処理プログラムに移行する。
Next, the condition that the polling interruption signal becomes 1 and the operation of the
本実施形態では、割り込み処理に移行するまでに長時間の待ち時間が生ずる事態を防ぐために、ポーリング中断判定部1204は、CPU201へ入力される割り込み信号IRを入力し、CPU201に対して割り込みが発生した場合は、ポーリング処理を中断するために「1」のポーリング中断信号を出力する。セレクタR2は、CPU201から見たバスアクセスを完了させるために、バス205からの信号READYをそのままCPU201へ出力する。
In the present embodiment, in order to prevent a situation in which a long waiting time is caused before the transition to the interrupt processing, the polling
このとき、CPU201へ出力される信号RDATAは、ポーリング回路202がもっとも最近読み出したステータスレジスタ305の指定されたビットの値とするため、セレクタR1が出力するビット信号を保持するビット信号保持部1401(図14)を設ける。
At this time, since the signal RDATA output to the
以上のように、READY信号生成部1002は、CPU201から入力したアドレス信号ADDRが期待値0及び期待値1のレジスタ領域(第1のアドレス範囲)801b及び801cのアドレスであり、バス205を介して周辺回路PH1から入力したリードデータ信号RDATAがCPU201から入力したアドレス信号ADDRに対応する期待値と同じである場合には、バス205を介して周辺回路PH1から入力したレディ信号READYと同じレディ信号READYをCPU201に出力し、その他の場合には「0」のレディ信号READYをCPU201に出力する。
As described above, the READY
具体的には、READY信号生成部1002は、CPU201から入力したアドレス信号ADDRが期待値0のレジスタ領域(第3のアドレス範囲)801bのアドレスであり、周辺回路PH1から入力したリードデータ信号RDATAのうちのCPU201から入力したアドレス信号ADDRに対応するビットの値が0である場合には、周辺回路PH1から入力したレディ信号READYと同じレディ信号READYをCPU201に出力する。また、READY信号生成部1002は、CPU201から入力したアドレス信号ADDRが期待値1のレジスタ領域(第4のアドレス範囲)801cのアドレスであり、周辺回路PH1から入力したリードデータ信号RDATAのうちのCPU201から入力したアドレス信号ADDRに対応するビットの値が1である場合には、周辺回路PH1から入力したレディ信号READYと同じレディ信号READYをCPU201に出力する。
Specifically, the READY
また、READY信号生成部1002は、CPU201に入力される割り込み信号IRが「1」(活性化状態)になった場合には、バス205を介して周辺回路PH1から入力したレディ信号READYと同じレディ信号READYをCPU201に出力する。
Further, when the interrupt signal IR input to the
図14は、図10のRDATA信号生成部1003の構成例を示す図である。RDATA信号生成部1003は、ポーリング回路202からCPU201へ出力する信号RDATAを生成する。RDATA信号生成部1003は、ビット信号保持部1401及びセレクタ1402を有する。ビット信号保持部1401は、図9のレジスタ領域801b及び801cのように、図12のREADY信号生成部1002からのビット信号を最下位ビットとして入力し、上位31ビット分を0で埋め、32ビット信号を生成し、セレクタ1402に出力する。セレクタ1402は、ポーリングアクセス信号が「1」の場合、ビット信号保持部1401が出力する32ビット信号を、信号RDATAとしてCPU201に出力する。また、ポーリングアクセス信号が0の場合、CPU201はポーリング処理のためではないバスアクセスを行っていることになるので、セレクタ1402は、バス205からの信号RDATAをそのままCPU201へ出力する。
FIG. 14 is a diagram illustrating a configuration example of the RDATA
以上のように、RDATA信号生成部1003は、CPU201から入力したアドレス信号ADDRが期待値0及び期待値1のレジスタ領域(第1のアドレス範囲)801b及び801cのアドレスである場合には、バス205を介して周辺回路PH1から入力したリードデータ信号RDATAのうちのCPU201から入力したアドレス信号ADDRに対応するビットの信号をリードデータ信号RDATAとしてCPU201に出力する。ビット信号保持部1401は、バス205を介して周辺回路PH1から入力したリードデータ信号RDATAのうちのCPU201から入力したアドレス信号ADDRに対応するビットの信号を保持する。
As described above, when the address signal ADDR input from the
具体的には、RDATA信号生成部1003は、バス205を介して周辺回路PH1から入力したリードデータ信号RDATAのうちのCPU201から入力したアドレス信号ADDRに対応するビットの信号を下位ビットとし、上位ビットを0で埋めた信号をリードデータ信号RDATAとしてCPU201に出力する。
Specifically, the RDATA
図15は、図10のREQ信号生成部1004の構成例を示す図である。REQ信号生成部1004は、ポーリング回路202からバス205へ出力する信号REQを生成する。REQ信号生成部1004は、セレクタ1501及び1502を有する。ポーリングアクセス信号が0の場合、CPU201はポーリング処理のためのアクセスではない通常のアクセスを行っているので、セレクタ1501は、CPU201からの信号REQをそのままバス205への信号REQとして出力する。ポーリングアクセス信号が1の場合、セレクタ1501は、以下の動作により、バス205への信号REQを生成する。
FIG. 15 is a diagram illustrating a configuration example of the REQ
セレクタ1501は、ポーリングアクセス信号が1の場合、周辺回路PH1のステータスレジスタ305の1回目のアクセスのために、「1」の信号REQをバス205に出力する。
When the polling access signal is 1, the
読み出した周辺回路PH1のステータスレジスタ305の値が期待値と一致せず、2回目以降のステータスレジスタ305の読み出しアクセスを行うための信号REQの出力は、セレクタ1502がアクセスタイミング信号を出力したときに行う。セレクタ1502は、図11のアドレス保持部1103が出力する通常レジスタアドレスを基に、周辺回路PH1〜PH4が出力するイネーブル信号ENS1〜ENS4のうちのいずれかを選択し、アクセスタイミング信号としてセレクタ1501に出力する。例えば、周辺回路PH1〜PH4の通常レジスタ領域のアドレスが図8の構成の時、通常レジスタアドレスが0x40000000〜0x40000FFCの範囲の場合、セレクタ1502は、周辺回路PH1のイネーブル信号ENS1を選択し、アクセスタイミング信号として出力する。
The read value of the
図16は、各周辺回路PH1〜PH4内のイネーブル信号生成部の構成例を示す図である。32個のD型フリップフロップFF1〜FF32は、図3のステータスレジスタ305に対応し、32ビット値を記憶する。論理和回路306は、図3の論理和回路306に対応する。イネーブル信号生成部は、イネーブル信号ENSを生成する。第1の周辺回路PH1内のイネーブル信号生成部が出力するイネーブル信号ENSは、図15の第1の周辺回路PH1が出力するイネーブル信号ENS1に対応する。第2の周辺回路PH2内のイネーブル信号生成部が出力するイネーブル信号ENSは、図15の第2の周辺回路PH2が出力するイネーブル信号ENS2に対応する。第3の周辺回路PH3内のイネーブル信号生成部が出力するイネーブル信号ENSは、図15の第3の周辺回路PH3が出力するイネーブル信号ENS3に対応する。第4の周辺回路PH4内のイネーブル信号生成部が出力するイネーブル信号ENSは、図15の第4の周辺回路PH4が出力するイネーブル信号ENS4に対応する。
FIG. 16 is a diagram illustrating a configuration example of the enable signal generation unit in each of the peripheral circuits PH1 to PH4. The 32 D-type flip-flops FF1 to FF32 correspond to the
ステータスレジスタ305は、イネーブル端子EN付きのD型フリップフロップFF1〜FF32を有する。イネーブル端子EN付きのD型フリップフロップFF1〜FF32は、それぞれ、1ビットの記憶素子であり、イネーブル端子ENの信号が1の時に入力端子Dの値を内部に取り込み、保持し、保持した値を出力端子Qから出力する。したがって、各D型フリップフロップFF1〜FF32のイネーブル端子ENに入力される信号が1のとき、各D型フリップフロップFF1〜FF32の値が書き換わる可能性がある。なお、イネーブル端子ENに1が入力されても、入力端子Dへ入力される値がもともと各D型フリップフロップFF1〜FF32が保持している値と同じ場合は、結果的に、各D型フリップフロップFF1〜FF32の値は書き換わらず、出力端子Qから同じ値が出力され続ける。論理和回路306は、D型フリップフロップ(ステータスレジスタ)FF1〜FF32のイネーブル端子ENの信号の論理和をイネーブル信号ENSとして出力する。イネーブル信号ENSは、図15のイネーブル信号ENS1〜ENS4に対応する。
The
図15において、セレクタ1502は、通常レジスタアドレスに応じて、イネーブル信号ENS1〜ENS4のいずれかを選択し、アクセスタイミング信号としてセレクタ1501に出力する。セレクタ1501は、ポーリングアクセス信号が1であり、アクセスタイミング信号が1の場合、ポーリング対象の周辺回路PH1〜PH4のステータスレジスタ305の値が変化した可能性があると判断し、2回目以降の読み出しアクセスのための「1」の信号REQをバス205へ出力する。また、セレクタ1501は、ポーリングアクセス信号が1であり、アクセスタイミング信号が0の場合、ポーリング対象の周辺回路PH1〜PH4のステータスレジスタ305の値が変化した可能性がないと判断し、「0」の信号REQをバス205へ出力する。ステータスレジスタ305の値が変化した可能性がないときは、バス205へ「0」の信号REQを出力するので、無駄にステータスレジスタ305の読み出しアクセスを行うことを防ぐことができる。これにより、ポーリング回路202及びバス205の無駄な電力消費を抑え、DMAC206などの他にバス205を使用するモジュールとのバスアクセス競合を防ぐことができる。
In FIG. 15, the
以上のように、周辺回路PH1〜PH4は、それぞれ、CPU201のリクエスト信号REQに応じて、イネーブル端子ENを有するステータスレジスタ305からリードデータを読み出す。REQ信号生成部1004は、例えば、周辺回路PH1のステータスレジスタ305のイネーブル端子ENの信号が1になった場合に、周辺回路PH1に「1」のリクエスト信号REQを出力する。なお、イネーブル端子ENの信号は、「1」が活性化状態を示し、「0」が非活性化状態を示す。
As described above, each of the peripheral circuits PH1 to PH4 reads the read data from the
具体的には、ステータスレジスタ305は、イネーブル端子ENを有する複数のフリップフロップFF1〜FF32を有する。REQ信号生成部1004は、複数のフリップフロップFF1〜FF32のイネーブル端子ENの信号のうちのいずれかの信号が1になった場合に、周辺回路PH1に「1」のリクエスト信号REQを出力する。
Specifically, the
なお、上記実施形態は、何れも本発明を実施するにあたっての具体化の例を示したものに過ぎず、これらによって本発明の技術的範囲が限定的に解釈されてはならないものである。すなわち、本発明はその技術思想、又はその主要な特徴から逸脱することなく、様々な形で実施することができる。 The above-described embodiments are merely examples of implementation in carrying out the present invention, and the technical scope of the present invention should not be construed in a limited manner. That is, the present invention can be implemented in various forms without departing from the technical idea or the main features thereof.
100 ワイヤレスセンサノード
101 全体制御部
102 センサ部
103 RF部
104 発電電源管理部
105 アンテナ
106 発電素子
201 中央処理装置(CPU)
202 ポーリング回路
203 RAM
204 割り込みコントローラ
205 バス
206 ダイレクトメモリアクセスコントローラ(DMAC)
PH1 第1の周辺回路
PH2 第2の周辺回路
PH3 第3の周辺回路
PH4 第4の周辺回路
DESCRIPTION OF
202
204 Interrupt
PH1 First peripheral circuit PH2 Second peripheral circuit PH3 Third peripheral circuit PH4 Fourth peripheral circuit
Claims (10)
前記処理装置からリクエスト信号及びアドレス信号を入力し、前記処理装置にレディ信号及びリードデータ信号を出力するポーリング回路と、
前記ポーリング回路からリクエスト信号及びアドレス信号を入力し、前記ポーリング回路にレディ信号及びリードデータ信号を出力する周辺回路とを有し、
前記処理装置は、前記周辺回路にリードアクセスするために、活性化状態のリクエスト信号及び前記周辺回路に対応するアドレス信号を出力し、
前記周辺回路は、前記処理装置のリクエスト信号に対応する処理が終了していない場合には非活性化状態のレディ信号を出力し、前記処理装置のリクエスト信号に対応する処理が終了した場合には活性化状態のレディ信号及びリードデータ信号を出力し、
前記ポーリング回路は、
前記処理装置から入力したアドレス信号が第1のアドレス範囲のアドレスである場合には、前記処理装置から入力したアドレス信号を第2のアドレス範囲のアドレスに変換して前記周辺回路にアドレス信号を出力し、前記処理装置から入力したアドレス信号が第1のアドレス範囲のアドレスでない場合には、前記処理装置から入力したアドレス信号と同じアドレス信号を前記周辺回路に出力するアドレス信号生成部と、
前記処理装置から入力したアドレス信号が第1のアドレス範囲のアドレスであり、前記周辺回路から入力したリードデータ信号が前記処理装置から入力したアドレス信号に対応する期待値と同じである場合には、前記周辺回路から入力したレディ信号と同じレディ信号を前記処理装置に出力し、その他の場合には非活性化状態のレディ信号を前記処理装置に出力するレディ信号生成部とを有することを特徴とする処理システム。 A processing device;
A polling circuit for inputting a request signal and an address signal from the processing device, and outputting a ready signal and a read data signal to the processing device;
A peripheral circuit that inputs a request signal and an address signal from the polling circuit and outputs a ready signal and a read data signal to the polling circuit,
The processing device outputs an activated request signal and an address signal corresponding to the peripheral circuit for read access to the peripheral circuit,
The peripheral circuit outputs a deactivated ready signal when the processing corresponding to the request signal of the processing device is not completed, and when the processing corresponding to the request signal of the processing device is completed. Outputs an active ready signal and read data signal,
The polling circuit includes:
When the address signal input from the processing device is an address in the first address range, the address signal input from the processing device is converted to an address in the second address range and the address signal is output to the peripheral circuit When the address signal input from the processing device is not an address in the first address range, an address signal generation unit that outputs the same address signal as the address signal input from the processing device to the peripheral circuit;
When the address signal input from the processing device is an address in a first address range, and the read data signal input from the peripheral circuit is the same as the expected value corresponding to the address signal input from the processing device, A ready signal generating unit that outputs a ready signal that is the same as the ready signal input from the peripheral circuit to the processing device; in other cases, a ready signal generation unit that outputs a ready signal in an inactive state to the processing device Processing system.
前記ポーリング回路は、前記周辺回路のレジスタのイネーブル端子の信号が活性化状態になった場合に、前記周辺回路に活性化状態のリクエスト信号を出力するリクエスト信号生成部を有することを特徴とする請求項1記載の処理システム。 The peripheral circuit reads read data from a register having an enable terminal in response to a request signal of the processing device,
The polling circuit includes a request signal generation unit that outputs an activated request signal to the peripheral circuit when a signal of an enable terminal of a register of the peripheral circuit is activated. Item 2. The processing system according to Item 1.
前記リクエスト信号生成部は、前記周辺回路の複数のフリップフロップのイネーブル端子の信号のうちのいずれかの信号が活性化状態になった場合に、前記周辺回路に活性化状態のリクエスト信号を出力することを有することを特徴とする請求項2記載の処理システム。 The peripheral circuit register includes a plurality of flip-flops having an enable terminal,
The request signal generation unit outputs an activated request signal to the peripheral circuit when any one of the signals of the enable terminals of the plurality of flip-flops of the peripheral circuit is activated. The processing system according to claim 2, further comprising:
前記レディ信号生成部は、
前記処理装置から入力したアドレス信号が前記第3のアドレス範囲のアドレスであり、前記周辺回路から入力したリードデータ信号のうちの前記処理装置から入力したアドレス信号に対応するビットの値が0である場合には、前記周辺回路から入力したレディ信号と同じレディ信号を前記処理装置に出力し、
前記処理装置から入力したアドレス信号が前記第4のアドレス範囲のアドレスであり、前記周辺回路から入力したリードデータ信号のうちの前記処理装置から入力したアドレス信号に対応するビットの値が1である場合には、前記周辺回路から入力したレディ信号と同じレディ信号を前記処理装置に出力することを特徴とする請求項1〜5のいずれか1項に記載の処理システム。 The first address range has a third address range with an expected value of 0 and a fourth address range with an expected value of 1.
The ready signal generator is
The address signal input from the processing device is an address in the third address range, and the value of the bit corresponding to the address signal input from the processing device in the read data signal input from the peripheral circuit is 0. In this case, the same ready signal input from the peripheral circuit is output to the processing device,
The address signal input from the processing device is an address in the fourth address range, and the value of the bit corresponding to the address signal input from the processing device in the read data signal input from the peripheral circuit is 1. 6. The processing system according to claim 1, wherein a ready signal that is the same as a ready signal input from the peripheral circuit is output to the processing device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014066182A JP6260394B2 (en) | 2014-03-27 | 2014-03-27 | Processing system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014066182A JP6260394B2 (en) | 2014-03-27 | 2014-03-27 | Processing system |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2015191279A true JP2015191279A (en) | 2015-11-02 |
JP6260394B2 JP6260394B2 (en) | 2018-01-17 |
Family
ID=54425760
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2014066182A Expired - Fee Related JP6260394B2 (en) | 2014-03-27 | 2014-03-27 | Processing system |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6260394B2 (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2009238001A (en) * | 2008-03-27 | 2009-10-15 | Texas Instr Japan Ltd | Computer system |
JP2011013914A (en) * | 2009-07-01 | 2011-01-20 | Toshiba Storage Device Corp | Power-saving controller and power-saving control method |
JP2011034385A (en) * | 2009-08-03 | 2011-02-17 | Renesas Electronics Corp | Semiconductor device |
-
2014
- 2014-03-27 JP JP2014066182A patent/JP6260394B2/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2009238001A (en) * | 2008-03-27 | 2009-10-15 | Texas Instr Japan Ltd | Computer system |
JP2011013914A (en) * | 2009-07-01 | 2011-01-20 | Toshiba Storage Device Corp | Power-saving controller and power-saving control method |
JP2011034385A (en) * | 2009-08-03 | 2011-02-17 | Renesas Electronics Corp | Semiconductor device |
Also Published As
Publication number | Publication date |
---|---|
JP6260394B2 (en) | 2018-01-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10649935B2 (en) | Deferred inter-processor interrupts | |
JP5102789B2 (en) | Semiconductor device and data processor | |
US10997100B2 (en) | Communications interface between host system and state machine | |
US12072833B2 (en) | Executing functions in response to reading event indices on an event queue by a state machine | |
CN105988400B (en) | Microcontroller unit | |
KR20150112660A (en) | System on chip, method thereof, and device including the same | |
JPWO2011117987A1 (en) | Multi-core system and startup method | |
JP2001067235A (en) | Interruption controller and microcomputer | |
JP5981004B2 (en) | Semiconductor device | |
JP2008041059A (en) | Multiprocessor controller and information processor | |
JP6260394B2 (en) | Processing system | |
JP5561374B2 (en) | Information processing system | |
JP5805546B2 (en) | Semiconductor device | |
JP2007052685A (en) | Microcontroller | |
JP2008021040A (en) | Bus master circuit, bus control method and computer program | |
US20200293429A1 (en) | Semiconductor Apparatus and Debug System | |
JP4580879B2 (en) | Reconfigurable circuit | |
JPH10154124A (en) | Microprocessor and multiprocessor system | |
JP2013041534A (en) | Semiconductor integrated circuit and interruption generation method | |
JP2009163338A (en) | Information processor | |
JP2013123125A (en) | Configuration device | |
JP2013143075A (en) | Semiconductor device | |
JP2006236060A (en) | Bus interface circuit |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20161206 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20171017 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20171114 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20171127 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6260394 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |