JP3563223B2 - Register circuit - Google Patents

Register circuit Download PDF

Info

Publication number
JP3563223B2
JP3563223B2 JP04060897A JP4060897A JP3563223B2 JP 3563223 B2 JP3563223 B2 JP 3563223B2 JP 04060897 A JP04060897 A JP 04060897A JP 4060897 A JP4060897 A JP 4060897A JP 3563223 B2 JP3563223 B2 JP 3563223B2
Authority
JP
Japan
Prior art keywords
data
register
write
cpu
circuit
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.)
Expired - Fee Related
Application number
JP04060897A
Other languages
Japanese (ja)
Other versions
JPH10240496A (en
Inventor
木 浩 鈴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kawasaki Microelectronics Inc
Original Assignee
Kawasaki Microelectronics Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kawasaki Microelectronics Inc filed Critical Kawasaki Microelectronics Inc
Priority to JP04060897A priority Critical patent/JP3563223B2/en
Publication of JPH10240496A publication Critical patent/JPH10240496A/en
Application granted granted Critical
Publication of JP3563223B2 publication Critical patent/JP3563223B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Classifications

    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Executing Machine-Instructions (AREA)
  • Information Transfer Systems (AREA)
  • Logic Circuits (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、システムクロックに同期して動作する周辺デバイスの内部レジスタにデータを書き込むためのレジスタ回路に関するものである。
【0002】
【従来の技術】
例えば、ハードディスクコントローラ等の周辺デバイスの内部には、その動作を制御するための様々な内部レジスタが設けられており、CPUから周辺デバイスの内部レジスタにデータを設定する場合には、周辺デバイスのシステムクロックに同期させて、CPUのデータを周辺デバイスの内部レジスタに書き込んだり、あるいは、CPUのライト信号によって、CPUのデータを周辺デバイスの内部レジスタに直接書き込んでいる。
【0003】
ここで、図5に、従来のレジスタ回路の一例の構成回路図を示す。
このレジスタ回路78は、周辺デバイスのシステムクロックに同期させて、CPUからのデータを周辺デバイスの内部レジスタに書き込む場合のレジスタ回路の一例を示したもので、図示例においては、フリップフロップ80,82、アドレスデコーダ26、フリップフロップ84,86、ゲート88、ANDゲート90、セレクタ92および内部レジスタ12を有する。
【0004】
一般的に、CPUから周辺デバイスの内部レジスタ12にデータを書き込む場合、CPUからは、内部レジスタ12にデータを書き込むためのストローブ信号となるライト信号CPU_WRITEが立ち下がった後、データを書き込む内部レジスタ12を指定するためのアドレスCPU_ADDRESSや、内部レジスタ12に書き込むデータCPU_DATA等が出力され、ライト信号CPU_WRITEが立ち上がる時点で、これらの値は有効(Valid)になる。
【0005】
図6のタイミングチャートに示されるように、CPUのライト信号CPU_WRITEの立ち上がりで、CPUから出力された有効なアドレスCPU_ADDRESSとデータCPU_DATAが、それぞれのフリップフロップ80,82に保持され、それぞれラッチアドレスLATCH_ADDRESSとラッチデータLATCH_DATAとして出力された後、ラッチアドレスLATCH_ADDRESSが、アドレスデコーダ26によってデコードされる。
【0006】
また、CPUのライト信号CPU_WRITEが、周辺デバイスのシステムクロックSYSTEM_CLOCKによって、フリップフロップ84,86に順次シフトされる。その後、ゲート88によって、ライト信号CPU_WRITEの立ち上がりが検出され、フリップフロップ82に保持されたラッチデータLATCH_DATAを内部レジスタ12に書き込むための、1クロックサイクルのハイレベルのタイミング信号が発生される。
【0007】
ここで、ラッチアドレスLATCH_ADDRESSが、内部レジスタ12を指定するものであれば、アドレスデコーダ26の出力はハイレベルとなり、上述するタイミング信号が、ANDゲート90を経て、同期ライト信号SYNC_WRITEとしてセレクタ92の選択入力端子に入力される。これにより、セレクタ92から、ラッチデータLATCH_DATAが1クロックサイクルの間出力され、システムクロックSYSTEM_CLOCKの立ち上がりで内部レジスタ12に書き込まれる。
【0008】
これに対し、ラッチアドレスLATCH_ADDRESSが、内部レジスタ12を指定するものでなければ、アドレスデコーダ26の出力はローレベルとなり、ANDゲート90によって、同期ライト信号SYNC_WRITEがローレベルに保持される。これにより、セレクタ92からは、内部レジスタ12に保持されているデータが出力され、システムクロックSYSTEM_CLOCKの立ち上がりで再び内部レジスタ12に取り込まれる。
【0009】
続いて、図7に、従来のレジスタ回路の別の例の構成回路図を示す。
このレジスタ回路94は、CPUのライト信号によって、CPUのデータを周辺デバイスの内部レジスタに直接書き込む場合のレジスタ回路の一例を示したもので、図示例においては、アドレスデコーダ26、ゲート96および内部レジスタ12を有する。
【0010】
図8のタイミングチャートに示されるように、CPUのアドレスCPU_ADDRESSが、アドレスデコーダ26によってデコードされ、アドレスCPU_ADDRESSが、内部レジスタ12を指定するものであれば、ライト信号CPU_WRITEが、ゲート96を経てレジスタライト信号REG_WRITEとして出力され、CPUのデータCPU_DATAが、レジスタライト信号REG_WRITEの立ち上がりで内部レジスタ12に書き込まれる。
【0011】
これに対し、アドレスCPU_ADDRESSが、内部レジスタ12を指定するものでなければ、アドレスデコーダ26の出力はローレベルとなり、ゲート96によって、レジスタライト信号REG_WRITEがハイレベルに保持される。すなわち、レジスタライト信号REG_WRITEが変化しないため、CPUのデータCPU_DATAは、内部レジスタ12には書き込まれず、内部レジスタ12のデータは保持される。
【0012】
ところで、CPUによって、周辺デバイスの内部レジスタにデータが設定された後、周辺デバイスの内部では、その内部レジスタに設定されたデータが参照されるだけであれば、すなわち、周辺デバイスの内部で、システムクロックに同期して、内部レジスタのデータを変更して使用する必要がないのであれば、上述するいずれのレジスタ回路78,94の構成であってもよいが、レジスタ回路94の方が、回路規模が小さいという利点がある。
【0013】
これに対し、周辺デバイスの内部で、CPUによって設定された内部レジスタのデータを変更する必要がある場合、レジスタ回路94の構成では、周辺デバイスのシステムクロックに同期して、内部レジスタ12のデータを変更することができないため、回路規模は増大するが、レジスタ回路78の構成のように、周辺デバイスのシステムクロックに同期して、内部レジスタ12にデータを書き込むような回路構成にする必要がある。
【0014】
例えば、図9に、従来のレジスタ回路のさらに別の例の構成回路図を示す。
図示例のレジスタ回路98は、CPUによって内部レジスタに書き込まれたデータを初期値として、周辺デバイスのシステムクロックに同期して、CPUによって設定された内部レジスタのデータをカウントアップする場合のレジスタ回路の一例を示したもので、図5に示されるレジスタ回路78において、さらに、インクリメンタ48およびセレクタ50を有する。
【0015】
レジスタ回路98においては、CPUから内部レジスタ12にデータが書き込まれた後、インクリメンタ48によって、内部レジスタ12の値がインクリメント(+1)される。ここで、カウントアップ信号COUNT_UPがハイレベルであれば、インクリメントされた値が、セレクタ50,92を経て、システムクロックSYSTEM_CLOCKの立ち上がりで内部レジスタ12に書き込まれ、内部レジスタ12のデータがカウントアップされる。
【0016】
これに対し、カウントアップ信号COUNT_UPがローレベルのときには、内部レジスタ12に保持されているデータが、セレクタ50,92を経て、再度、システムクロックSYSTEM_CLOCKの立ち上がりで内部レジスタ12に取り込まれる。すなわち、内部レジスタ12のデータは保持される。
なお、周辺デバイスの内部で、内部レジスタ12のデータを変更する必要があるのは、上述するカウントアップに限定されるものではない。
【0017】
ところで、例えばノートブック型のパーソナルコンピュータ等のように、電池駆動の電子機器においては、消費電力を削減して駆動時間を延長するために、例えば電源は投入されているが、所定の一定時間使用されていない等のように、特定の条件を満足したときには、例えばハードディスクのコントローラLSIのシステムクロックを停止させたいというように、周辺デバイスのシステムクロックを停止させたいという要求が多くなっている。
【0018】
しかしながら、レジスタ回路98の構成では、周辺デバイスのシステムクロックSYSTEM_CLOCKに同期して、内部レジスタ12のデータを変更することはできるが、システムクロックSYSTEM_CLOCKを停止すると、CPUからのデータを周辺デバイスの内部レジスタ12に書き込むことができないため、単純には、システムクロックSYSTEM_CLOCKを停止することができず、消費電力を削減するのが困難であるという問題点があった。
【0019】
【発明が解決しようとする課題】
本発明の目的は、前記従来技術に基づく問題点をかえりみて、回路規模を増大させることなく、システムクロックを停止して消費電力を削減することができるレジスタ回路を提供することにある。
【0020】
【課題を解決するための手段】
上記目的を達成するために、本発明は、システムクロックに同期して動作する周辺デバイスの内部レジスタにデータを書き込むためのレジスタ回路であって、CPUからの書込信号を前記システムクロックに同期させることによって、前記CPUからのデータを前記内部レジスタに書き込むためのタイミング信号を発生するタイミング発生回路と、前記タイミング信号に応じて、前記CPUからのデータまたは前記周辺デバイスの内部で発生されたデータのいずれか一方を書込データとして出力する第1のセレクタ回路と、前記タイミング信号に応じて、前記CPUからの書込信号または前記システムクロックのいずれか一方を書込クロックとして出力する第2のセレクタ回路と、前記CPUからの書込信号と前記システムクロックとを切り替えるときに、前記書込クロックにグリッチが発生するのを防止するグリッチ防止回路とを有し、
前記書込クロックによって、前記内部レジスタに前記書込データを書き込むことを特徴とするレジスタ回路を提供するものである。
【0021】
ここで、上記レジスタ回路であって、
さらに、前記システムクロックが停止されたときに、前記第1のセレクタ回路からは、前記CPUからのデータが前記書込データとして出力され、かつ、前記第2のセレクタ回路からは、前記CPUからの書込信号が書込クロックとして出力されるように制御するクロック停止回路を有するのが好ましい。
【0022】
また、本発明は、システムクロックに同期して動作する周辺デバイスの内部レジスタにデータを書き込むためのレジスタ回路であって、
CPUからのデータを保持するデータレジスタと、このデータレジスタに前記CPUからのデータが保持されたことを示す書込フラグを保持するフラグレジスタと、前記書込フラグを前記システムクロックに同期させることによって、前記データレジスタに保持された前記CPUからのデータを前記内部レジスタに書き込むためのタイミング信号を発生し、かつ、前記フラグレジスタに保持された書込フラグをクリアするためのリセット信号を発生するタイミング発生回路と、前記タイミング信号に応じて、前記データレジスタに保持されたデータまたは前記周辺デバイスの内部で発生されたデータのいずれか一方を書込データとして出力するセレクタ回路とを有し、
前記タイミング信号に応じて、前記システムクロックによって、前記内部レジスタに前記書込データを書き込んだ後、前記リセット信号によって、前記フラグレジスタに保持された書込フラグをクリアすることを特徴とするレジスタ回路を提供するものである。
【0023】
【発明の実施の形態】
以下に、添付の図面に示す好適実施例に基づいて、本発明のレジスタ回路を詳細に説明する。
【0024】
図1は、本発明のレジスタ回路の一実施例の構成回路図である。
このレジスタ回路10は、システムクロックに同期して動作する周辺デバイスの内部レジスタにデータを書き込むためのレジスタ回路の一例を示したもので、図示例においては、内部レジスタ12の他、アドレスデコード回路14、タイミング発生回路16、セレクタ回路18、グリッチ防止回路20、クロック停止回路22およびカウントアップ回路24を有する。
【0025】
ここで、アドレスデコード回路14は、CPUからのアドレスCPU_ADDRESSおよびライト信号CPU_WRITEから、内部レジスタ12にCPUからのデータCPU_DATAを書き込むための書込信号となるレジスタライト信号REG_WRITEを発生するもので、CPUからのアドレスCPU_ADDRESSをデコードするアドレスデコーダ26、および、ゲート28を有する。
【0026】
アドレスデコーダ26には、CPUからのアドレスCPU_ADDRESSが入力され、その出力は、ゲート28の一方の入力端子に入力されている。また、ゲート28の他方の反転入力端子には、CPUからのライト信号CPU_WRITEが入力され、その出力は、CPUからのデータCPU_DATAを内部レジスタ12に書き込むための書込信号となるレジスタライト信号REG_WRITEとされている。
【0027】
続いて、タイミング発生回路16は、CPUからの書込信号であるライト信号CPU_WRITEをシステムクロックSYSTEM_CLOCKに同期させることによって、CPUからのデータCPU_DATAを内部レジスタ12に書き込むためのタイミング信号CPU_WR_D1,CPU_WR_D2を発生するもので、図示例においては、直列接続された2つのフリップフロップ30,32を有する。
【0028】
フリップフロップ30のデータ入力端子には、CPUからのライト信号CPU_WRITEが入力され、その出力は、タイミング信号CPU_WR_D1とされている。また、フリップフロップ32のデータ入力端子には、タイミング信号CPU_WR_D1が入力され、その出力は、タイミング信号CPU_WR_D2とされている。また、フリップフロップ30,32のクロック入力端子には、ともにシステムクロックSYSTEM_CLOCKが入力されている。
【0029】
続いて、セレクタ回路18は、図示例においては、タイミング信号REG_CK_SELに応じて、内部レジスタ12への書込データとなるレジスタデータREG_DATA、および、内部レジスタ12の書込クロックとなるレジスタクロックREG_CLOCKを切り替えるもので、第1および第2のセレクタとなる2つのセレクタ34,36を有する。
【0030】
セレクタ34は、CPUからのデータCPU_DATA、または、カウントアップ回路24から出力されるデータのいずれか一方を書込データであるレジスタデータREG_DATAとして出力するもので、その入力端子1,0には、それぞれカウントアップ回路24の出力、および、CPUからのデータCPU_DATAが入力され、その出力であるレジスタデータREG_DATAは、内部レジスタ12のデータ入力端子に入力されている。
【0031】
セレクタ36は、CPUからの書込信号であるレジスタライト信号REG_WRITE、または、システムクロックSYSTEM_CLOCKのいずれか一方を書込クロックであるレジスタクロックREG_CLOCKとして出力するもので、その入力端子1,0には、それぞれシステムクロックSYSTEM_CLOCK、および、クロック停止回路22の出力が入力され、その出力であるレジスタクロックREG_CLOCKは、内部レジスタ12のクロック入力端子に入力されている。
【0032】
続いて、グリッチ防止回路20は、CPUからの書込信号であるレジスタライト信号REG_WRITEとシステムクロックSYSTEM_CLOCKとを切り替えるときに、書込クロックとなるレジスタクロックREG_CLOCKにグリッチが発生するのを防止するもので、図示例においては、ゲート38が用いられている。ゲート38には、レジスタライト信号REG_WRITEおよびタイミング信号CPU_WR_D2が入力されている。
【0033】
続いて、クロック停止回路22は、システムクロックSYSTEM_CLOCKが停止されたときに、セレクタ回路18のセレクタ34からは、CPUからのデータCPU_DATAが書込データとして出力され、かつ、セレクタ36からは、CPUからの書込信号であるレジスタライト信号REG_WRITEが書込クロックとして出力されるように制御するもので、図示例においては、フリップフロップ40、セレクタ42、および、ゲート46を有する。
【0034】
フリップフロップ40のクロック入力端子には、システムクロックSYSTEM_CLOCKが入力され、その出力は、クロックストップ信号CLOCK_STOPとされている。なお、図示を省略しているが、フリップフロップ40のデータ入力端子には、システムクロックSYSTEM_CLOCKを停止するための条件を満足したときに、システムクロックSYSTEM_CLOCKを停止するための制御信号が与えられる。
【0035】
また、セレクタ42の入力端子1,0には、それぞれレジスタライト信号REG_WRITE、および、グリッチ防止回路20のゲート38出力が入力され、その選択入力端子には、クロックストップ信号CLOCK_STOPが入力され、その出力は、セレクタ回路18のセレクタ36の入力端子0に入力されている。また、ゲート46には、クロックストップ信号CLOCK_STOPおよびタイミング信号CPU_WR_D1が入力され、その出力は、セレクタ回路18のセレクタ34,36の選択入力端子に入力されている。
【0036】
続いて、カウントアップ回路24は、カウントアップ信号COUNT_UPに応じて、システムクロックSYSTEM_CLOCKに同期して、内部レジスタ12のデータをカウントアップするもので、図示例においては、インクリメンタ48およびセレクタ50を有する。インクリメンタ48には、内部レジスタ12の出力が入力されている。セレクタ50の入力端子1,0には、それぞれインクリメンタ48の出力および内部レジスタ12の出力が入力され、その出力は、セレクタ回路18のセレクタ34の入力端子1に入力されている。
【0037】
レジスタ回路10において、システムクロックSYSTEM_CLOCKが動作しているときに、すなわち、図示例においては、クロックストップ信号CLOCK_STOPがローレベルのときに、CPUから内部レジスタ12にデータを書き込もうとした場合、図2(a)のタイミングチャートに示されるように、まず、CPUからのアドレスCPU_ADDRESSが、アドレスデコード回路14のアドレスデコーダ26によってデコードされる。
【0038】
ここで、CPUのアドレスCPU_ADDRESSが、内部レジスタ12を指定するものであれば、アドレスデコーダ26の出力はハイレベルとなり、CPUからのライト信号CPU_WRITEが、ゲート28を経て、レジスタライト信号REG_WRITEとして出力される。一方、CPUのアドレスCPU_ADDRESSが、内部レジスタ12を指定するものでなければ、アドレスデコーダ26の出力はローレベルとなり、レジスタライト信号REG_WRITEはハイレベルの状態に保持される。
【0039】
また、レジスタ回路10においては、CPUからのライト信号CPU_WRITEが、タイミング発生回路16の2つのフリップフロップ30,32によって、システムクロックSYSTEM_CLOCKに同期して順次シフトされ、フリップフロップ30,32からは、それぞれCPUからのデータCPU_DATAを内部レジスタ12に書き込むためのタイミング信号CPU_WR_D1,CPU_WR_D2が出力される。
【0040】
ここでは、クロックストップ信号CLOCK_STOPがローレベルであるため、タイミング信号CPU_WR_D1が、ゲート46を経て、セレクタ回路18の2つのセレクタ34,36の選択入力端子に入力される。
【0041】
これにより、タイミング信号CPU_WR_D1がローレベルの間、セレクタ34からは、CPUからのデータCPU_DATAが、書込データとなるレジスタデータREG_DATAとして出力され、セレクタ36からは、グリッチ防止回路20のゲート38、クロック停止回路22のセレクタ42を経て、書込クロックとなるレジスタライト信号REG_WRITEが出力され、レジスタデータREG_DATAは、レジスタクロックREG_CLOCKの立ち上がりで内部レジスタ12に書き込まれる。
【0042】
なお、グリッチ防止回路20において、ゲート38でレジスタライト信号REG_WRITEとタイミング信号CPU_WR_D2の論理和を取っていることにより、タイミング信号CPU_WR_D1によって、レジスタライト信号REG_WRITEとシステムクロックSYSTEM_CLOCKを切り替えるときの両者のレベルがいずれもハイレベルとなるため、レジスタクロックREG_CLOCKにグリッチが発生するのを防止することができ、回路の誤動作を防止することができる。
【0043】
続いて、CPUから内部レジスタ12にデータが書き込まれ、CPUからのライト信号CPU_WRITEがハイレベルになると、システムクロックSYSTEM_CLOCKに同期して、タイミング信号CPU_WR_D1,CPU_WR_D2はいずれもハイレベルとなり、セレクタ回路18のセレクタ34からは、レジスタデータREG_DATAとして、カウントアップ回路24の出力が出力され、セレクタ36からは、レジスタクロックREG_CLOCKとして、システムクロックSYSTEM_CLOCKが出力される。
【0044】
従来技術の説明において既に述べたように、カウントアップ回路24においては、インクリメンタ48によって、内部レジスタ12のデータがインクリメント(+1)される。ここで、カウントアップ信号COUNT_UPがハイレベルであれば、インクリメントされたデータが、セレクタ50,34を経て、システムクロックSYSTEM_CLOCKの立ち上がりで内部レジスタ12に再度書き込まれ、内部レジスタ12のデータがカウントアップされる。
【0045】
ここで、システムクロックSYSTEM_CLOCKを停止する条件を満足したときに、クロック停止回路22のフリップフロップ40のデータ入力端子に、システムクロックSYSTEM_CLOCKを停止するための制御信号が入力されると、図2(b)のタイミングチャートに示されるように、フリップフロップ40からは、システムクロックSYSTEM_CLOCKに同期して、クロックストップ信号CLOCK_STOPが出力される。
【0046】
システムクロックSYSTEM_CLOCKが停止された後、すなわち、図示例においては、クロックストップ信号CLOCK_STOPがハイレベルとされた後、CPUから内部レジスタ12にデータを書き込もうとした場合、クロックストップ信号CLOCK_STOPがハイレベルであるため、ゲート46によって、セレクタ回路18の2つのセレクタ34,36の選択入力端子はローレベルとされる。
【0047】
これにより、セレクタ34からは、CPUからのデータCPU_DATAが、書込データとなるレジスタデータREG_DATAとして出力され、セレクタ36からは、クロック停止回路22のセレクタ42を経て、レジスタライト信号REG_WRITEが、書込クロックとなるレジスタクロックREG_CLOCKとして出力される。このレジスタデータREG_DATAは、レジスタクロックREG_CLOCKの立ち上がりで内部レジスタ12に書き込まれる。
【0048】
次いで、図3に、本発明のレジスタ回路の別の実施例の構成回路図を示す。
レジスタ回路52は、システムクロックに同期して動作する周辺デバイスの内部レジスタにデータを書き込むためのレジスタ回路の別の例を示したもので、図示例においては、内部レジスタ12の他、アドレスデコード回路14、データレジスタ54、フラグレジスタ58、タイミング発生回路62、セレクタ回路74、および、カウントアップ回路24を有する。
【0049】
ここで、データレジスタ54は、CPUからのデータCPU_DATAを一時的に保持するためのもので、図示例においては、フリップフロップ56が用いられている。フリップフロップ56のデータ入力端子には、CPUからのデータCPU_DATAが入力され、そのクロック入力端子には、アドレスデコード回路14によって発生される、CPUからの書込信号となるレジスタライト信号REG_WRITEが入力されている。
【0050】
続いて、フラグレジスタ58は、CPUからのライト信号CPU_WRITEによって、データレジスタ54にCPUからのデータCPU_DATAが保持されたことを示す書込フラグを保持するもので、図示例においては、フリップフロップ60が用いられている。フリップフロップ60のデータ入力端子は電源に接続され、そのクロック入力端子には、レジスタライト信号REG_WRITEが入力され、その出力は、ライトフラグ信号WR_FLAGとされている。
【0051】
続いて、タイミング発生回路62は、書込フラグとなるライトフラグ信号WR_FLAGをシステムクロックSYSTEM_CLOCKに同期させることによって、データレジスタ54に保持されたCPUからのデータCPU_DATAを内部レジスタ12に書き込むためのタイミング信号である同期ライト信号SYNC_WRITEを発生し、かつ、フラグレジスタ58のフリップフロップ60に保持されたライトフラグ信号WR_FLAGをクリアするためのリセット信号となるフラグリセット信号FLAG_RSTを発生するものである。
【0052】
図示例のタイミング発生回路62は、フリップフロップ64,66、ゲート68、フリップフロップ70、および、インバータ72を有する。フリップフロップ64のデータ入力端子には、ライトフラグ信号WR_FLAGが入力され、その出力は、フリップフロップ66のデータ入力端子に入力されている。ゲート68には、フリップフロップ64,66の出力が入力され、その出力は、同期ライト信号SYNC_WRITEとされている。
【0053】
また、フリップフロップ70のデータ入力端子には、同期ライト信号SYNC_WRITEが入力され、その出力は、インバータ72に入力されている。インバータ72の出力は、フラグリセット信号FLAG_RSTとされ、フラグレジスタ58のフリップフロップ60のリセット入力端子に入力されている。また、フリップフロップ64,66,70のクロック入力端子には、ともにシステムクロックSYSTEM_CLOCKが入力されている。
【0054】
続いて、セレクタ回路74は、タイミング信号である同期ライト信号SYNC_WRITEに応じて、データレジスタ54のフリップフロップ56に保持されたCPUからのデータCPU_DATA、または、カウントアップ回路24から出力されるデータのいずれか一方を書込データとして出力するもので、図示例においては、セレクタ76が用いられている。セレクタ76の入力端子1,0には、それぞれデータレジスタ54のフリップフロップ56に保持されたCPUからのデータCPU_DATA、および、カウントアップ回路24の出力が入力され、その選択入力端子には、同期ライト信号SYNC_WRITEが入力されている。
【0055】
また、内部レジスタ12のデータ入力端子には、セレクタ回路74のセレクタ76の出力が入力され、そのクロック入力端子には、システムクロックSYSTEM_CLOCKが入力されている。なお、アドレスデコード回路14およびカウントアップ回路24は、図1に示される本発明のレジスタ回路10において使用されているものと全く同じものであるから、同一の構成要素には同一符号を付し、ここでは、その詳細な説明を省略する。
【0056】
レジスタ回路52において、例えばシステムクロックSYSTEM_CLOCKが停止された後、CPUから内部レジスタ12にデータを書き込もうとした場合、図4のタイミングチャートに示されるように、CPUのアドレスCPU_ADDRESSが、内部レジスタ12を指定するものであれば、CPUからのライト信号CPU_WRITEが、ゲート28を経て、レジスタライト信号REG_WRITEとして出力される。
【0057】
これにより、CPUからのデータCPU_DATAが、レジスタライト信号REG_WRITEの立ち上がりで、データレジスタ54のフリップフロップ56に保持されるのと同時に、フラグレジスタ58のフリップフロップ60が、レジスタライト信号REG_WRITEの立ち上がりで、電源に接続されたデータ入力端子のハイレベルを保持することにより、書込フラグとなるライトフラグ信号WR_FLAGがハイレベルとなる。
【0058】
その後、システムクロックSYSTEM_CLOCKが動作を開始すると、フラグレジスタ58のフリップフロップ60のライトフラグ信号WR_FLAGが、タイミング発生回路62の2つのフリップフロップ64,66によって、システムクロックSYSTEM_CLOCKに同期して順次シフトされ、ゲート68によって、ライトフラグ信号WR_FLAGがハイレベルにセットされていることが検出され、同期ライト信号SYNC_WRITEが出力される。
【0059】
これにより、同期ライト信号SYNC_WRITEがハイレベルの間、セレクタ回路74のセレクタ76からは、書込データとして、データレジスタ54のフリップフロップ56に保持されているCPUからのデータCPU_DATAが出力され、システムクロックSYSTEM_CLOCKの立ち上がりで、内部レジスタ12に書き込まれるのと同時に、同期ライト信号SYNC_WRITEのハイレベルが、フリップフロップ70に保持される。
【0060】
続いて、フリップフロップ70に保持された同期ライト信号SYNC_WRITEのハイレベルは、インバータ72によって反転され、リセット信号となるフラグリセット信号FLAG_RSTとして、フラグレジスタ58のフリップフロップ60のリセット入力端子に入力される。フリップフロップ60は、このフラグリセット信号FLAG_RSTによってリセットされ、ライトフラグ信号WR_FLAGがローレベルとなる。
【0061】
その後、図示例のレジスタ回路52においては、カウントアップ回路24によって、カウントアップ信号COUNT_UPに応じて、内部レジスタ12のデータが適宜カウントアップされる。
なお、レジスタ回路52においては、システムクロックSYSTEM_CLOCKが動作中の場合であっても、同じように、CPUから内部レジスタ12へデータを書き込むことができるのは言うまでもないことである。
【0062】
このように、本発明のレジスタ回路においては、図1に示されるレジスタ回路10、および、図3に示されるレジスタ回路52のいずれの構成の場合であっても、システムクロックが動作中にはもちろん、システムクロックが停止されていたとしても、CPUから周辺デバイスの内部レジスタにデータを書き込むことができるし、かつ、内部レジスタのデータをシステムクロックに同期させて変更することもできる。
【0063】
また、本発明のレジスタ回路は、例えば図9に示される従来のレジスタ回路98と比較して、CPUからのアドレスやデータを保持するための数十個のフリップフロップが必要ないため、回路規模を削減することができるという利点もある。また、従来のレジスタ回路では、システムクロックを停止することはできなかったが、本発明のレジスタ回路においては、システムクロックを停止することができるため、消費電力を削減することができる。
【0064】
例えば、パーソナルコンピュータ等の補助記憶装置として使用されるハードディスクの標準インターフェースであるIDE(Intelligent Drive Electronics )インターフェースのコントローラLSIにおいては、CPUから、転送セクタ数、セクタ番号、シリンダ番号、ヘッド番号を所定のレジスタに設定した後、読み出しまたは書き込みのコマンドを所定のレジスタに書き込むことによって、データの読み出しまたは書き込みが行われる。
【0065】
また、コマンドの実行時には、1セクタのデータの読み出しまたは書き込みが終了する毎に、例えば転送セクタ数がデクリメント(−1)され、セクタ番号がインクリメント(+1)される。このように、IDEインターフェースのコントローラLSIにおいては、まず、CPUによって各レジスタに初期値が設定された後、コントローラLSIの内部で、CPUによって設定された各レジスタの値が変更されて使用される。
【0066】
ここで、IDEインターフェースのコントローラLSIにおいては、例えば消費電力を削減するために、コントローラLSIのシステムクロックを停止した場合であっても、CPUからコントローラLSIの各内部レジスタへのデータの書き込みは可能でなければならない。また、読み出しまたは書き込みのコマンドが所定のレジスタに書き込まれると、システムクロックが再起動され、コントローラLSIの動作が再開されなければならない。
【0067】
しかしながら、既に述べたように、図9に示される従来のレジスタ回路98の構成では、システムクロックを停止すると、CPUからのデータを内部レジスタ12に書き込むことができないため、単純にシステムクロックを停止することはできないが、本発明のレジスタ回路10,52の構成であれば、システムクロックを停止しても、内部レジスタ12にデータを書き込むことができるため、システムクロックを停止して消費電力を削減することができる。
【0068】
このように、本発明のレジスタ回路は、例えばCPUおよび周辺デバイスの両方からデータが書き込まれる内部レジスタを有する周辺デバイスにおいて、システムクロックを停止する必要のある場合に好適に用いることができる。
なお、上記実施例においては、周辺デバイスの内部で、内部レジスタの値が変更される場合の一例として、カウントアップ回路を例示しているが、これに限定されるものではない。
【0069】
以上、本発明のレジスタ回路について詳細に説明したが、本発明は上記実施例に限定されず、本発明の主旨を逸脱しない範囲において、種々の改良や変更をしてもよいのはもちろんである。
【0070】
【発明の効果】
以上詳細に説明したように、本発明のレジスタ回路においては、周辺デバイスのシステムクロックが動作しているときはもちろん、停止されているときでも、CPUから周辺デバイスの内部レジスタにデータを書き込むことができるし、周辺デバイスの内部で、システムクロックに同期して内部レジスタの値を変更することもできる。このため、本発明のレジスタ回路によれば、特定の条件を満足したときに、周辺デバイスのシステムクロックを停止して消費電力を削減することができる。また、本発明のレジスタ回路によれば、従来のレジスタ回路のように、CPUからのアドレスやデータを一旦保持しておく必要がないため、回路規模を大幅に削減することができるという効果もある。
【図面の簡単な説明】
【図1】本発明のレジスタ回路の一実施例の構成回路図である。
【図2】(a)および(b)は、ともに図1に示される本発明のレジスタ回路の動作を表す一実施例のタイミングチャートである。
【図3】本発明のレジスタ回路の別の実施例の構成回路図である。
【図4】図3に示される本発明のレジスタ回路の動作を表す一実施例のタイミングチャートである。
【図5】従来のレジスタ回路の一例の構成回路図である。
【図6】図5に示される従来のレジスタ回路の動作を表す一例のタイミングチャートである。
【図7】従来のレジスタ回路の別の例の構成回路図である。
【図8】図7に示される従来のレジスタ回路の動作を表す一例のタイミングチャートである。
【図9】従来のレジスタ回路のさらに別の例の構成回路図である。
【符号の説明】
10,52,78,94,98 レジスタ回路
12 内部レジスタ
14 アドレスデコード回路
16,62 タイミング発生回路
18,74 セレクタ回路
20 グリッチ防止回路
22 クロック停止回路
24 カウントアップ回路
26 アドレスデコーダ
30,32,40,56,60,64,66,70,80,82,84,86フリップフロップ
34,36,42,50,76,92 セレクタ
48 インクリメンタ
54 データレジスタ
58 フラグレジスタ
90 ANDゲート
72 インバータ
28,38,46,68,88,96 ゲート
CPU_ADDRESS CPUアドレス
CPU_DATA CPUデータ
CPU_WRITE ライト信号
SYSTEM_CLOCK システムクロック
CPU_WR_D1,CPU_WR_D2,REG_CK_SEL タイミング信号
CLOCK_STOP クロックストップ信号
REG_WRITE レジスタライト信号
REG_DATA レジスタデータ
REG_CLOCK レジスタクロック
COUNT_UP カウントアップ信号
SYNC_WRITE 同期ライト信号
WR_FLAG ライトフラグ信号
FLAG_RST フラグリセット信号
LATCH_ADDRESS ラッチアドレス
LATCH_DATA ラッチデータ
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a register circuit for writing data to an internal register of a peripheral device that operates in synchronization with a system clock.
[0002]
[Prior art]
For example, various internal registers for controlling the operation of the peripheral device such as a hard disk controller are provided inside the peripheral device. When data is set in the internal register of the peripheral device from the CPU, the system of the peripheral device is used. In synchronization with the clock, CPU data is written to an internal register of a peripheral device, or CPU data is directly written to an internal register of a peripheral device by a write signal of the CPU.
[0003]
Here, FIG. 5 shows a configuration circuit diagram of an example of a conventional register circuit.
The register circuit 78 is an example of a register circuit for writing data from a CPU to an internal register of a peripheral device in synchronization with a system clock of the peripheral device. In the illustrated example, flip-flops 80 and 82 are shown. , Address decoder 26, flip-flops 84 and 86, gate 88, AND gate 90, selector 92 and internal register 12.
[0004]
In general, when data is written from the CPU to the internal register 12 of the peripheral device, the write signal CPU_WRITE, which is a strobe signal for writing data to the internal register 12, falls from the CPU. Are output, and when the write signal CPU_WRITE rises, these values become valid (Valid).
[0005]
As shown in the timing chart of FIG. 6, at the rise of the CPU write signal CPU_WRITE, the valid address CPU_ADDRESS and data CPU_DATA output from the CPU are held in the respective flip-flops 80 and 82, and the latch addresses LATCH_ADDRESS and After being output as the latch data LATCH_DATA, the latch address LATCH_ADDRESS is decoded by the address decoder 26.
[0006]
Further, the CPU write signal CPU_WRITE is sequentially shifted to the flip-flops 84 and 86 by the system clock SYSTEM_CLOCK of the peripheral device. Thereafter, the rise of the write signal CPU_WRITE is detected by the gate 88, and a one-clock cycle high-level timing signal for writing the latch data LATCH_DATA held in the flip-flop 82 to the internal register 12 is generated.
[0007]
Here, if the latch address LATCH_ADDRESS designates the internal register 12, the output of the address decoder 26 goes high, and the above-mentioned timing signal passes through the AND gate 90 and is selected by the selector 92 as the synchronous write signal SYNC_WRITE. Input to the input terminal. As a result, the latch data LATCH_DATA is output from the selector 92 for one clock cycle, and is written to the internal register 12 at the rise of the system clock SYSTEM_CLOCK.
[0008]
On the other hand, if the latch address LATCH_ADDRESS does not specify the internal register 12, the output of the address decoder 26 goes low, and the AND gate 90 holds the synchronous write signal SYNC_WRITE low. As a result, the data held in the internal register 12 is output from the selector 92, and is taken into the internal register 12 again at the rise of the system clock SYSTEM_CLOCK.
[0009]
Next, FIG. 7 shows a configuration circuit diagram of another example of the conventional register circuit.
The register circuit 94 is an example of a register circuit for directly writing data of the CPU to an internal register of a peripheral device by a write signal of the CPU. In the illustrated example, the address circuit 26, the gate 96 and the internal register It has 12.
[0010]
As shown in the timing chart of FIG. 8, if the address CPU_ADDRESS of the CPU is decoded by the address decoder 26 and the address CPU_ADDRESS specifies the internal register 12, the write signal CPU_WRITE is sent to the register write through the gate 96. The signal is output as the signal REG_WRITE, and the data CPU_DATA of the CPU is written to the internal register 12 at the rise of the register write signal REG_WRITE.
[0011]
On the other hand, if the address CPU_ADDRESS does not specify the internal register 12, the output of the address decoder 26 goes low, and the gate 96 holds the register write signal REG_WRITE at the high level. That is, since the register write signal REG_WRITE does not change, the data CPU_DATA of the CPU is not written in the internal register 12, and the data in the internal register 12 is retained.
[0012]
By the way, after data is set in the internal register of the peripheral device by the CPU, if the data set in the internal register is only referred to inside the peripheral device, that is, the system If there is no need to change and use the data in the internal register in synchronization with the clock, any of the above-described register circuits 78 and 94 may be used, but the register circuit 94 has a larger circuit size. Has the advantage of being small.
[0013]
On the other hand, when it is necessary to change the data in the internal register set by the CPU inside the peripheral device, the configuration of the register circuit 94 causes the data in the internal register 12 to be synchronized with the system clock of the peripheral device. Since it cannot be changed, the circuit scale increases, but it is necessary to adopt a circuit configuration such as the configuration of the register circuit 78 that writes data to the internal register 12 in synchronization with the system clock of the peripheral device.
[0014]
For example, FIG. 9 shows a configuration circuit diagram of still another example of the conventional register circuit.
The register circuit 98 in the illustrated example is a register circuit for counting up the data of the internal register set by the CPU in synchronization with the system clock of the peripheral device using the data written to the internal register by the CPU as an initial value. An example is shown. In the register circuit 78 shown in FIG. 5, an incrementer 48 and a selector 50 are further provided.
[0015]
In the register circuit 98, after data is written from the CPU to the internal register 12, the value of the internal register 12 is incremented (+1) by the incrementer 48. Here, if the count-up signal COUNT_UP is at a high level, the incremented value is written to the internal register 12 at the rising edge of the system clock SYSTEM_CLOCK via the selectors 50 and 92, and the data in the internal register 12 is counted up. .
[0016]
On the other hand, when the count-up signal COUNT_UP is at the low level, the data held in the internal register 12 is taken into the internal register 12 again at the rising edge of the system clock SYSTEM_CLOCK via the selectors 50 and 92. That is, the data of the internal register 12 is held.
The need to change the data in the internal register 12 inside the peripheral device is not limited to the above-described count-up.
[0017]
By the way, in a battery-powered electronic device such as a notebook-type personal computer, for example, the power is turned on to reduce power consumption and extend the driving time. When a specific condition is satisfied, such as when the system clock is not performed, there is an increasing demand to stop the system clock of the peripheral device, for example, to stop the system clock of the controller LSI of the hard disk.
[0018]
However, in the configuration of the register circuit 98, although the data of the internal register 12 can be changed in synchronization with the system clock SYSTEM_CLOCK of the peripheral device, when the system clock SYSTEM_CLOCK is stopped, the data from the CPU is transferred to the internal register of the peripheral device. 12, the system clock SYSTEM_CLOCK simply cannot be stopped, and there is a problem that it is difficult to reduce power consumption.
[0019]
[Problems to be solved by the invention]
SUMMARY OF THE INVENTION An object of the present invention is to provide a register circuit capable of stopping a system clock and reducing power consumption without increasing the circuit scale, in view of the problems based on the conventional technology.
[0020]
[Means for Solving the Problems]
To achieve the above object, the present invention is a register circuit for writing data to an internal register of a peripheral device that operates in synchronization with a system clock, and synchronizes a write signal from a CPU with the system clock. A timing generation circuit for generating a timing signal for writing data from the CPU to the internal register; and a data generator for generating data from the CPU or data generated inside the peripheral device in response to the timing signal. A first selector circuit for outputting one of the write data as a write data, and a second selector for outputting either a write signal from the CPU or the system clock as a write clock in accordance with the timing signal Circuit, a write signal from the CPU, and the system clock. When obtaining, and a glitch prevention circuit for preventing the glitch occurs in the write clock,
It is another object of the present invention to provide a register circuit, wherein the write data is written to the internal register by the write clock.
[0021]
Here, in the register circuit,
Further, when the system clock is stopped, the data from the CPU is output as the write data from the first selector circuit, and the data from the CPU is output from the second selector circuit. It is preferable to have a clock stop circuit for controlling a write signal to be output as a write clock.
[0022]
Further, the present invention is a register circuit for writing data to an internal register of a peripheral device operating in synchronization with a system clock,
A data register for holding data from the CPU, a flag register for holding a write flag indicating that data from the CPU is held in the data register, and synchronizing the write flag with the system clock. Generating a timing signal for writing the data from the CPU held in the data register to the internal register, and generating a reset signal for clearing the write flag held in the flag register A generation circuit, and a selector circuit that outputs one of data held in the data register or data generated inside the peripheral device as write data in accordance with the timing signal,
A register circuit for writing the write data to the internal register by the system clock in response to the timing signal, and then clearing the write flag held in the flag register by the reset signal; Is provided.
[0023]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, the register circuit of the present invention will be described in detail based on a preferred embodiment shown in the accompanying drawings.
[0024]
FIG. 1 is a configuration circuit diagram of an embodiment of the register circuit of the present invention.
The register circuit 10 is an example of a register circuit for writing data to an internal register of a peripheral device operating in synchronization with a system clock. In the illustrated example, in addition to the internal register 12, an address decode circuit 14 , A timing generation circuit 16, a selector circuit 18, a glitch prevention circuit 20, a clock stop circuit 22, and a count-up circuit 24.
[0025]
Here, the address decode circuit 14 generates a register write signal REG_WRITE as a write signal for writing the data CPU_DATA from the CPU into the internal register 12 from the address CPU_ADDRESS and the write signal CPU_WRITE from the CPU. Address decoder 26 for decoding the address CPU_ADDRESS, and a gate 28.
[0026]
The address CPU_ADDRESS from the CPU is input to the address decoder 26, and the output is input to one input terminal of the gate 28. A write signal CPU_WRITE from the CPU is input to the other inverting input terminal of the gate 28, and its output is a register write signal REG_WRITE which is a write signal for writing data CPU_DATA from the CPU to the internal register 12. Have been.
[0027]
Subsequently, the timing generation circuit 16 generates timing signals CPU_WR_D1 and CPU_WR_D2 for writing data CPU_DATA from the CPU to the internal register 12 by synchronizing the write signal CPU_WRITE, which is a write signal from the CPU, with the system clock SYSTEM_CLOCK. In the illustrated example, two flip-flops 30 and 32 are connected in series.
[0028]
A write signal CPU_WRITE from the CPU is input to a data input terminal of the flip-flop 30, and the output is a timing signal CPU_WR_D1. A timing signal CPU_WR_D1 is input to a data input terminal of the flip-flop 32, and an output thereof is a timing signal CPU_WR_D2. The system clock SYSTEM_CLOCK is input to both clock input terminals of the flip-flops 30 and 32.
[0029]
Subsequently, in the illustrated example, the selector circuit 18 switches the register data REG_DATA serving as write data to the internal register 12 and the register clock REG_CLOCK serving as a write clock for the internal register 12 according to the timing signal REG_CK_SEL. And has two selectors 34 and 36 serving as first and second selectors.
[0030]
The selector 34 outputs one of the data CPU_DATA from the CPU and the data output from the count-up circuit 24 as register data REG_DATA which is write data. The output of the count-up circuit 24 and the data CPU_DATA from the CPU are input, and the output register data REG_DATA is input to the data input terminal of the internal register 12.
[0031]
The selector 36 outputs one of a register write signal REG_WRITE as a write signal from the CPU and a system clock SYSTEM_CLOCK as a register clock REG_CLOCK as a write clock. The system clock SYSTEM_CLOCK and the output of the clock stop circuit 22 are input, and the register clock REG_CLOCK, which is the output, is input to the clock input terminal of the internal register 12.
[0032]
Subsequently, the glitch prevention circuit 20 prevents a glitch from occurring in the register clock REG_CLOCK serving as a write clock when switching between the register write signal REG_WRITE, which is a write signal from the CPU, and the system clock SYSTEM_CLOCK. In the illustrated example, a gate 38 is used. The gate 38 receives the register write signal REG_WRITE and the timing signal CPU_WR_D2.
[0033]
Subsequently, when the system clock SYSTEM_CLOCK is stopped, the clock stop circuit 22 outputs the data CPU_DATA from the CPU as write data from the selector 34 of the selector circuit 18, and outputs the data from the CPU to the selector 36. And a register write signal REG_WRITE, which is a write signal of the control circuit, is output as a write clock. In the illustrated example, the register write signal REG_WRITE includes a flip-flop 40, a selector 42, and a gate 46.
[0034]
The clock input terminal of the flip-flop 40 receives the system clock SYSTEM_CLOCK, and outputs the clock stop signal CLOCK_STOP. Although not shown, a control signal for stopping the system clock SYSTEM_CLOCK is provided to the data input terminal of the flip-flop 40 when a condition for stopping the system clock SYSTEM_CLOCK is satisfied.
[0035]
The register write signal REG_WRITE and the output of the gate 38 of the glitch prevention circuit 20 are input to the input terminals 1 and 0 of the selector 42, respectively, and the clock stop signal CLOCK_STOP is input to the selection input terminal thereof and the output thereof. Is input to the input terminal 0 of the selector 36 of the selector circuit 18. Further, the clock stop signal CLOCK_STOP and the timing signal CPU_WR_D1 are input to the gate 46, and the output thereof is input to the selection input terminals of the selectors 34 and 36 of the selector circuit 18.
[0036]
Subsequently, the count-up circuit 24 counts up data in the internal register 12 in synchronization with the system clock SYSTEM_CLOCK in response to the count-up signal COUNT_UP, and has an incrementer 48 and a selector 50 in the illustrated example. . The output of the internal register 12 is input to the incrementer 48. The output of the incrementer 48 and the output of the internal register 12 are input to the input terminals 1 and 0 of the selector 50, respectively, and the output is input to the input terminal 1 of the selector 34 of the selector circuit 18.
[0037]
In the register circuit 10, when data is written from the CPU to the internal register 12 when the system clock SYSTEM_CLOCK is operating, that is, in the illustrated example, when the clock stop signal CLOCK_STOP is at a low level, FIG. As shown in the timing chart of a), first, the address CPU_ADDRESS from the CPU is decoded by the address decoder 26 of the address decoding circuit 14.
[0038]
Here, if the address CPU_ADDRESS of the CPU specifies the internal register 12, the output of the address decoder 26 becomes high level, and the write signal CPU_WRITE from the CPU is output as the register write signal REG_WRITE via the gate 28. You. On the other hand, if the address CPU_ADDRESS of the CPU does not designate the internal register 12, the output of the address decoder 26 goes low, and the register write signal REG_WRITE is held at the high level.
[0039]
In the register circuit 10, the write signal CPU_WRITE from the CPU is sequentially shifted by the two flip-flops 30 and 32 of the timing generation circuit 16 in synchronization with the system clock SYSTEM_CLOCK, and from the flip-flops 30 and 32, respectively. Timing signals CPU_WR_D1 and CPU_WR_D2 for writing data CPU_DATA from the CPU to the internal register 12 are output.
[0040]
Here, since the clock stop signal CLOCK_STOP is at the low level, the timing signal CPU_WR_D1 is input to the selection input terminals of the two selectors 34 and 36 of the selector circuit 18 via the gate 46.
[0041]
Accordingly, while the timing signal CPU_WR_D1 is at the low level, the data CPU_DATA from the CPU is output from the selector 34 as the register data REG_DATA serving as write data, and the gate 36 of the glitch prevention circuit 20 and the clock A register write signal REG_WRITE serving as a write clock is output via the selector 42 of the stop circuit 22, and the register data REG_DATA is written to the internal register 12 at the rise of the register clock REG_CLOCK.
[0042]
In the glitch prevention circuit 20, the gate 38 takes the logical sum of the register write signal REG_WRITE and the timing signal CPU_WR_D2. Since both become high level, it is possible to prevent a glitch from occurring in the register clock REG_CLOCK, and to prevent a malfunction of the circuit.
[0043]
Subsequently, when data is written from the CPU to the internal register 12 and the write signal CPU_WRITE from the CPU goes high, the timing signals CPU_WR_D1 and CPU_WR_D2 both go high in synchronization with the system clock SYSTEM_CLOCK. The selector 34 outputs the output of the count-up circuit 24 as register data REG_DATA, and the selector 36 outputs the system clock SYSTEM_CLOCK as the register clock REG_CLOCK.
[0044]
As described above, in the count-up circuit 24, the data of the internal register 12 is incremented (+1) by the incrementer 48 in the count-up circuit 24. Here, if the count-up signal COUNT_UP is at a high level, the incremented data is rewritten into the internal register 12 at the rise of the system clock SYSTEM_CLOCK via the selectors 50 and 34, and the data in the internal register 12 is counted up. You.
[0045]
Here, when a condition for stopping the system clock SYSTEM_CLOCK is satisfied and a control signal for stopping the system clock SYSTEM_CLOCK is input to the data input terminal of the flip-flop 40 of the clock stop circuit 22, FIG. As shown in the timing chart of), the flip-flop 40 outputs a clock stop signal CLOCK_STOP in synchronization with the system clock SYSTEM_CLOCK.
[0046]
After the system clock SYSTEM_CLOCK is stopped, that is, in the illustrated example, after the clock stop signal CLOCK_STOP is set to the high level and then the CPU attempts to write data to the internal register 12, the clock stop signal CLOCK_STOP is at the high level. Therefore, the gate 46 sets the selection input terminals of the two selectors 34 and 36 of the selector circuit 18 to low level.
[0047]
As a result, the data CPU_DATA from the CPU is output from the selector 34 as the register data REG_DATA serving as write data, and the register write signal REG_WRITE is written from the selector 36 via the selector 42 of the clock stop circuit 22. It is output as a register clock REG_CLOCK serving as a clock. This register data REG_DATA is written to the internal register 12 at the rising edge of the register clock REG_CLOCK.
[0048]
Next, FIG. 3 shows a configuration circuit diagram of another embodiment of the register circuit of the present invention.
The register circuit 52 is another example of a register circuit for writing data to an internal register of a peripheral device operating in synchronization with a system clock. In the illustrated example, the register circuit 52 includes an address decode circuit in addition to the internal register 12. 14, a data register 54, a flag register 58, a timing generation circuit 62, a selector circuit 74, and a count-up circuit 24.
[0049]
Here, the data register 54 temporarily holds data CPU_DATA from the CPU, and in the illustrated example, a flip-flop 56 is used. The data input terminal of the flip-flop 56 receives data CPU_DATA from the CPU, and its clock input terminal receives a register write signal REG_WRITE generated by the address decode circuit 14 and serving as a write signal from the CPU. ing.
[0050]
Subsequently, the flag register 58 holds a write flag indicating that the data CPU_DATA from the CPU is held in the data register 54 in response to the write signal CPU_WRITE from the CPU. Used. A data input terminal of the flip-flop 60 is connected to a power supply, a clock input terminal of the flip-flop 60 is supplied with a register write signal REG_WRITE, and an output thereof is a write flag signal WR_FLAG.
[0051]
Subsequently, the timing generation circuit 62 synchronizes the write flag signal WR_FLAG serving as a write flag with the system clock SYSTEM_CLOCK to write the data CPU_DATA from the CPU held in the data register 54 into the internal register 12. And generates a flag reset signal FLAG_RST which is a reset signal for clearing the write flag signal WR_FLAG held in the flip-flop 60 of the flag register 58.
[0052]
The illustrated timing generation circuit 62 includes flip-flops 64 and 66, a gate 68, a flip-flop 70, and an inverter 72. A write flag signal WR_FLAG is input to a data input terminal of the flip-flop 64, and an output thereof is input to a data input terminal of the flip-flop 66. The output of the flip-flops 64 and 66 is input to the gate 68, and the output is the synchronous write signal SYNC_WRITE.
[0053]
Further, a synchronous write signal SYNC_WRITE is input to a data input terminal of the flip-flop 70, and an output thereof is input to the inverter 72. The output of the inverter 72 is a flag reset signal FLAG_RST, which is input to the reset input terminal of the flip-flop 60 of the flag register 58. The clock input terminals of the flip-flops 64, 66, and 70 are all supplied with the system clock SYSTEM_CLOCK.
[0054]
Subsequently, in response to the synchronous write signal SYNC_WRITE, which is a timing signal, the selector circuit 74 selects one of the data CPU_DATA from the CPU held in the flip-flop 56 of the data register 54 and the data output from the count-up circuit 24. One of them is output as write data, and a selector 76 is used in the illustrated example. Data CPU_DATA from the CPU held in the flip-flop 56 of the data register 54 and the output of the count-up circuit 24 are input to input terminals 1 and 0 of the selector 76, respectively. The signal SYNC_WRITE is input.
[0055]
The output of the selector 76 of the selector circuit 74 is input to the data input terminal of the internal register 12, and the system clock SYSTEM_CLOCK is input to its clock input terminal. It should be noted that the address decode circuit 14 and the count-up circuit 24 are exactly the same as those used in the register circuit 10 of the present invention shown in FIG. Here, the detailed description is omitted.
[0056]
In the register circuit 52, for example, when data is written from the CPU to the internal register 12 after the system clock SYSTEM_CLOCK is stopped, the address CPU_ADDRESS of the CPU specifies the internal register 12 as shown in the timing chart of FIG. If so, a write signal CPU_WRITE from the CPU is output as the register write signal REG_WRITE via the gate 28.
[0057]
Accordingly, the data CPU_DATA from the CPU is held in the flip-flop 56 of the data register 54 at the rising edge of the register write signal REG_WRITE, and at the same time, the flip-flop 60 of the flag register 58 is held at the rising edge of the register write signal REG_WRITE. By holding the high level of the data input terminal connected to the power supply, the write flag signal WR_FLAG serving as a write flag becomes high level.
[0058]
Thereafter, when the system clock SYSTEM_CLOCK starts operating, the write flag signal WR_FLAG of the flip-flop 60 of the flag register 58 is sequentially shifted by the two flip-flops 64 and 66 of the timing generation circuit 62 in synchronization with the system clock SYSTEM_CLOCK. The gate 68 detects that the write flag signal WR_FLAG is set to the high level, and outputs the synchronous write signal SYNC_WRITE.
[0059]
Thereby, while the synchronous write signal SYNC_WRITE is at the high level, the data CPU_DATA from the CPU held in the flip-flop 56 of the data register 54 is output from the selector 76 of the selector circuit 74 as write data, and the system clock At the rising edge of SYSTEM_CLOCK, the high level of the synchronous write signal SYNC_WRITE is held in the flip-flop 70 at the same time as the data is written to the internal register 12.
[0060]
Subsequently, the high level of the synchronous write signal SYNC_WRITE held in the flip-flop 70 is inverted by the inverter 72 and is input to the reset input terminal of the flip-flop 60 of the flag register 58 as the flag reset signal FLAG_RST serving as a reset signal. . The flip-flop 60 is reset by the flag reset signal FLAG_RST, and the write flag signal WR_FLAG becomes low level.
[0061]
Thereafter, in the register circuit 52 of the illustrated example, the data of the internal register 12 is appropriately counted up by the count-up circuit 24 in accordance with the count-up signal COUNT_UP.
In the register circuit 52, it is needless to say that data can be written from the CPU to the internal register 12 in the same manner even when the system clock SYSTEM_CLOCK is operating.
[0062]
As described above, in the register circuit of the present invention, in any case of the configuration of the register circuit 10 shown in FIG. 1 and the configuration of the register circuit 52 shown in FIG. Even if the system clock is stopped, data can be written from the CPU to the internal register of the peripheral device, and the data in the internal register can be changed in synchronization with the system clock.
[0063]
In addition, the register circuit of the present invention does not require several tens of flip-flops for holding addresses and data from the CPU as compared with the conventional register circuit 98 shown in FIG. There is also an advantage that it can be reduced. Further, in the conventional register circuit, the system clock cannot be stopped, but in the register circuit of the present invention, the system clock can be stopped, so that power consumption can be reduced.
[0064]
For example, in a controller LSI of an IDE (Intelligent Drive Electronics) interface which is a standard interface of a hard disk used as an auxiliary storage device of a personal computer or the like, a transfer sector number, a sector number, a cylinder number, and a head number are determined by a CPU from a predetermined number. After setting in the register, data is read or written by writing a read or write command to a predetermined register.
[0065]
When the command is executed, every time reading or writing of one sector of data is completed, for example, the number of transfer sectors is decremented (-1) and the sector number is incremented (+1). As described above, in the controller LSI having the IDE interface, first, the initial values are set in the registers by the CPU, and then the values of the registers set by the CPU are changed and used inside the controller LSI.
[0066]
Here, in the controller LSI of the IDE interface, data can be written from the CPU to each internal register of the controller LSI even when the system clock of the controller LSI is stopped in order to reduce power consumption, for example. There must be. When a read or write command is written to a predetermined register, the system clock must be restarted, and the operation of the controller LSI must be restarted.
[0067]
However, as described above, in the configuration of the conventional register circuit 98 shown in FIG. 9, if the system clock is stopped, data from the CPU cannot be written to the internal register 12, so that the system clock is simply stopped. However, with the configuration of the register circuits 10 and 52 of the present invention, even if the system clock is stopped, data can be written to the internal register 12, so that the system clock is stopped to reduce power consumption. be able to.
[0068]
As described above, the register circuit of the present invention can be suitably used, for example, in a peripheral device having an internal register into which data is written from both the CPU and the peripheral device when the system clock needs to be stopped.
In the above embodiment, the count-up circuit is exemplified as an example of the case where the value of the internal register is changed inside the peripheral device, but the present invention is not limited to this.
[0069]
As described above, the register circuit of the present invention has been described in detail. However, the present invention is not limited to the above-described embodiment, and various modifications and changes may be made without departing from the gist of the present invention. .
[0070]
【The invention's effect】
As described in detail above, in the register circuit of the present invention, data can be written from the CPU to the internal register of the peripheral device even when the system clock of the peripheral device is operating or stopped. Alternatively, the value of the internal register can be changed in the peripheral device in synchronization with the system clock. Therefore, according to the register circuit of the present invention, when a specific condition is satisfied, the system clock of the peripheral device can be stopped to reduce power consumption. Further, according to the register circuit of the present invention, unlike the conventional register circuit, it is not necessary to temporarily hold the address and data from the CPU, so that the circuit size can be greatly reduced. .
[Brief description of the drawings]
FIG. 1 is a configuration circuit diagram of an embodiment of a register circuit of the present invention.
FIGS. 2A and 2B are timing charts of one embodiment showing the operation of the register circuit of the present invention shown in FIG. 1;
FIG. 3 is a configuration circuit diagram of another embodiment of the register circuit of the present invention.
FIG. 4 is a timing chart of one embodiment showing the operation of the register circuit of the present invention shown in FIG. 3;
FIG. 5 is a configuration circuit diagram of an example of a conventional register circuit.
FIG. 6 is a timing chart showing an example of the operation of the conventional register circuit shown in FIG.
FIG. 7 is a configuration circuit diagram of another example of a conventional register circuit.
FIG. 8 is a timing chart showing an example of the operation of the conventional register circuit shown in FIG. 7;
FIG. 9 is a configuration circuit diagram of still another example of the conventional register circuit.
[Explanation of symbols]
10, 52, 78, 94, 98 register circuit
12 Internal register
14. Address decode circuit
16,62 timing generation circuit
18,74 selector circuit
20 Glitch prevention circuit
22 Clock stop circuit
24 count-up circuit
26 Address decoder
30, 32, 40, 56, 60, 64, 66, 70, 80, 82, 84, 86 flip-flops
34, 36, 42, 50, 76, 92 selector
48 Incremental
54 Data Register
58 Flag Register
90 AND gate
72 Inverter
28, 38, 46, 68, 88, 96 gates
CPU_ADDRESS CPU address
CPU_DATA CPU data
CPU_WRITE write signal
SYSTEM_CLOCK System clock
CPU_WR_D1, CPU_WR_D2, REG_CK_SEL timing signal
CLOCK_STOP Clock stop signal
REG_WRITE register write signal
REG_DATA register data
REG_CLOCK register clock
COUNT_UP count up signal
SYNC_WRITE Synchronous write signal
WR_FLAG write flag signal
FLAG_RST flag reset signal
LATCH_ADDRESS Latch address
LATCH_DATA Latch data

Claims (3)

システムクロックに同期して動作する周辺デバイスの内部レジスタにデータを書き込むためのレジスタ回路であって、
CPUからの書込信号を前記システムクロックに同期させることによって、前記CPUからのデータを前記内部レジスタに書き込むためのタイミング信号を発生するタイミング発生回路と、前記タイミング信号に応じて、前記CPUからのデータまたは前記周辺デバイスの内部で発生されたデータのいずれか一方を書込データとして出力する第1のセレクタ回路と、前記タイミング信号に応じて、前記CPUからの書込信号または前記システムクロックのいずれか一方を書込クロックとして出力する第2のセレクタ回路と、前記CPUからの書込信号と前記システムクロックとを切り替えるときに、前記書込クロックにグリッチが発生するのを防止するグリッチ防止回路とを有し、
前記書込クロックによって、前記内部レジスタに前記書込データを書き込むことを特徴とするレジスタ回路。
A register circuit for writing data to an internal register of a peripheral device that operates in synchronization with a system clock,
A timing generation circuit for generating a timing signal for writing data from the CPU to the internal register by synchronizing a write signal from the CPU with the system clock; and A first selector circuit that outputs either data or data generated inside the peripheral device as write data; and a write signal from the CPU or the system clock according to the timing signal. A second selector circuit that outputs one of them as a write clock, and a glitch prevention circuit that prevents a glitch from occurring in the write clock when switching between a write signal from the CPU and the system clock. Has,
A register circuit, wherein the write data is written to the internal register by the write clock.
請求項1に記載のレジスタ回路であって、
さらに、前記システムクロックが停止されたときに、前記第1のセレクタ回路からは、前記CPUからのデータが前記書込データとして出力され、かつ、前記第2のセレクタ回路からは、前記CPUからの書込信号が書込クロックとして出力されるように制御するクロック停止回路を有することを特徴とするレジスタ回路。
The register circuit according to claim 1, wherein
Further, when the system clock is stopped, the data from the CPU is output as the write data from the first selector circuit, and the data from the CPU is output from the second selector circuit. A register circuit having a clock stop circuit for controlling a write signal to be output as a write clock.
システムクロックに同期して動作する周辺デバイスの内部レジスタにデータを書き込むためのレジスタ回路であって、
CPUからのデータを保持するデータレジスタと、このデータレジスタに前記CPUからのデータが保持されたことを示す書込フラグを保持するフラグレジスタと、前記書込フラグを前記システムクロックに同期させることによって、前記データレジスタに保持された前記CPUからのデータを前記内部レジスタに書き込むためのタイミング信号を発生し、かつ、前記フラグレジスタに保持された書込フラグをクリアするためのリセット信号を発生するタイミング発生回路と、前記タイミング信号に応じて、前記データレジスタに保持されたデータまたは前記周辺デバイスの内部で発生されたデータのいずれか一方を書込データとして出力するセレクタ回路とを有し、
前記タイミング信号に応じて、前記システムクロックによって、前記内部レジスタに前記書込データを書き込んだ後、前記リセット信号によって、前記フラグレジスタに保持された書込フラグをクリアすることを特徴とするレジスタ回路。
A register circuit for writing data to an internal register of a peripheral device that operates in synchronization with a system clock,
A data register for holding data from the CPU, a flag register for holding a write flag indicating that data from the CPU is held in the data register, and synchronizing the write flag with the system clock. Generating a timing signal for writing the data from the CPU held in the data register to the internal register, and generating a reset signal for clearing the write flag held in the flag register A generation circuit, and a selector circuit that outputs one of data held in the data register or data generated inside the peripheral device as write data in accordance with the timing signal,
A register circuit for writing the write data to the internal register by the system clock in response to the timing signal, and then clearing the write flag held in the flag register by the reset signal; .
JP04060897A 1997-02-25 1997-02-25 Register circuit Expired - Fee Related JP3563223B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP04060897A JP3563223B2 (en) 1997-02-25 1997-02-25 Register circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP04060897A JP3563223B2 (en) 1997-02-25 1997-02-25 Register circuit

Publications (2)

Publication Number Publication Date
JPH10240496A JPH10240496A (en) 1998-09-11
JP3563223B2 true JP3563223B2 (en) 2004-09-08

Family

ID=12585245

Family Applications (1)

Application Number Title Priority Date Filing Date
JP04060897A Expired - Fee Related JP3563223B2 (en) 1997-02-25 1997-02-25 Register circuit

Country Status (1)

Country Link
JP (1) JP3563223B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4826403B2 (en) * 2006-09-15 2011-11-30 ヤマハ株式会社 Synchronization circuit
CN108052483B (en) * 2017-12-29 2021-10-22 南京地平线机器人技术有限公司 Circuit unit, circuit module and device for data statistics

Also Published As

Publication number Publication date
JPH10240496A (en) 1998-09-11

Similar Documents

Publication Publication Date Title
JP2002323995A (en) Trace circuit
KR100238869B1 (en) Semiconductor memory device for providing bust mode control signal
JP2006139879A (en) Semiconductor memory
JP3563223B2 (en) Register circuit
US7782682B2 (en) Semiconductor device with circuitry for efficient information exchange
JP3001475B2 (en) Semiconductor storage device
EP0462622B1 (en) Microprocessor capable of ensuring flexible recovery time for I/O device
JP3701100B2 (en) Clock generation circuit and clock generation method
JP2004087027A (en) Access circuit
JP2697772B2 (en) Information processing device
JP3487116B2 (en) Semiconductor device and electronic equipment including the same
JP4064516B2 (en) Integrated circuit device with built-in memory
JP2716284B2 (en) Semiconductor integrated circuit
JP2626112B2 (en) Microprocessor
JP2000305895A (en) Asynchronous interface
JPH04241622A (en) Microprocessor
JPH0955723A (en) Clock replacing circuit
JP3216200B2 (en) Data memory write control circuit
JP2000010850A (en) Memory access system
JPH08335162A (en) Input interface circuit
JP2003085124A (en) Integrated circuit device having circuit for reading out data of internal register in response to readout signal from external part and system having this device
JPH03214252A (en) Microprocessor
JPH11126480A (en) Semiconductor device
JPH05242013A (en) Input buffer
JPH03276346A (en) Memory card

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040518

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: 20040525

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040602

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090611

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090611

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100611

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110611

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110611

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120611

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120611

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130611

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130611

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140611

Year of fee payment: 10

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R360 Written notification for declining of transfer of rights

Free format text: JAPANESE INTERMEDIATE CODE: R360

R360 Written notification for declining of transfer of rights

Free format text: JAPANESE INTERMEDIATE CODE: R360

R371 Transfer withdrawn

Free format text: JAPANESE INTERMEDIATE CODE: R371

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees