JP2006092522A - Bus control method and circuit - Google Patents
Bus control method and circuit Download PDFInfo
- Publication number
- JP2006092522A JP2006092522A JP2005196296A JP2005196296A JP2006092522A JP 2006092522 A JP2006092522 A JP 2006092522A JP 2005196296 A JP2005196296 A JP 2005196296A JP 2005196296 A JP2005196296 A JP 2005196296A JP 2006092522 A JP2006092522 A JP 2006092522A
- Authority
- JP
- Japan
- Prior art keywords
- circuit
- bus
- read
- signal
- access
- 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.)
- Withdrawn
Links
Images
Abstract
Description
本発明は、外部回路との間でデータをやりとりするバス制御方法および回路に係り、特に何らかの理由でレディ信号が有効にならずアクセス状態から復帰できなくなった場合に、非アクセス状態に強制的に復帰させ、その後再度同一アクセスを行うようにしたバス制御方法および回路に関するものである。 The present invention relates to a bus control method and circuit for exchanging data with an external circuit, and particularly forcibly to a non-access state when a ready signal is not valid and cannot be restored from an access state for some reason. The present invention relates to a bus control method and a circuit that are restored and then accessed again.
特許文献1に見られるように、読出動作や書込動作を始めたマイクロコントローラは、内蔵するバス制御回路において、バス制御信号を構成するハンドシエーク信号の1信号であるレディ信号が有効になるのを待ち、その処理を完了させる都合上、レディ信号が何らかの理由により有効にならない場合は永遠に処理を完了させることができず、ハングアップしてしまう。マイクロコントローラおよびその中心であるCPUがハングアップしてしまうということは、システム全体がハングアップしてしまうということに他ならない。
As seen in
そこで、この不具合を回避するために、前記特許文献1では、一定時間を超えてもレディ信号が有効にならない場合にはCPUを初期化することで、ハングアップが長時間継続することを回避している。
しかしながら、CPUを初期化するということは、それまで実行した処理のすべてを放棄することであり、言ってみれば最後の手段である。レディ信号が有効にならなかったことが、仮に偶発的理由(例えばノイズの混入等)による場合、再度同一処理を実行すれば問題が生じない可能性がある。また、同一処理を再度実行してもアクセスが成功しない場合において、そのアクセス対象を特定し、その対象モジュールのみをリセットし、初期設定を行うことは困難であった。 However, initializing the CPU means giving up all of the processing executed so far, and it is a last resort. If the ready signal is not valid due to an accidental reason (for example, noise mixing), there is a possibility that no problem will occur if the same processing is executed again. Further, when access is not successful even if the same processing is executed again, it is difficult to specify the access target, reset only the target module, and perform initial setting.
本発明はこの点に着目してなされたものであり、レディ信号が有効にならなかった場合でも、直ちには初期化せずに再度前回と同一アクセス処理を実行させるようにして、できるだけハングアップに陥ることを防止できるようにし、また、再度前回と同一アクセス処理を複数回実行させてもそれが不調に終わった場合にはそのアクセス対象のみのリセットが可能になるようにして、その後の処理続行の可能性を高めたバス制御方法および回路を提供することである。 The present invention has been made paying attention to this point, and even if the ready signal is not valid, the same access processing as the previous time is executed again without being initialized immediately, so as to hang up as much as possible. In addition, if the same access process is executed again and again multiple times, it will be possible to reset only the access target and continue the subsequent processing. It is an object of the present invention to provide a bus control method and a circuit that increase the possibility of such a problem.
バス制御方法の発明は、CPUを使用して、外部回路に対して読出動作あるいは書込動作を行う際に、前記外部回路から入力するレディ信号が有効になることに基づき当該読出あるいは書込アクセスのバスサイクルの処理を完了するバス制御方法において、前記レディ信号が規定時間を超えても有効にならないとき、現バスサイクルを中止することにより非アクセス状態に復帰させ、該非アクセス状態になった後再度前回と同一アクセスのバスサイクルを実行することを特徴とする。 In the invention of the bus control method, when a read operation or a write operation is performed on an external circuit using a CPU, the read or write access is performed based on a ready signal input from the external circuit being valid. In the bus control method that completes the processing of the bus cycle, when the ready signal does not become effective even after a specified time, the current bus cycle is stopped to return to the non-access state, and after entering the non-access state The bus cycle of the same access as the previous time is executed again.
ここで、前記同一アクセスのバスサイクルの実行回数が規定数に達することにより、前記バスサイクルの処理を終了すると共に割り込みあるいはリセットとして使用できる信号を出力することが望ましい。 Here, when the number of executions of the bus cycle of the same access reaches a specified number, it is desirable to end the processing of the bus cycle and output a signal that can be used as an interrupt or reset.
また、前記同一アクセスのバスサイクルの実行回数が規定数に達することにより、前記バスサイクルの処理を終了すると共に当該アクセスに関する情報を記憶することも望ましい。 It is also desirable that when the number of executions of the same access bus cycle reaches a specified number, the processing of the bus cycle is terminated and information related to the access is stored.
さらに、前記記憶したアクセスに関する情報を前記CPUに読ませるためのデータ処理を行うことも望ましい。 Further, it is desirable to perform data processing for causing the CPU to read the stored access information.
バス制御回路の発明は、外部回路に対してバスおよび制御線を介して接続され、CPUからの読み出しあるいは書込みの指令に基づき前記外部回路に対して読出制御信号あるいは書込制御信号を出力して読み出しあるいは書込みを行う際、前記外部回路から入力するレディ信号が有効になることに基づき当該アクセスのバスサイクルの処理を完了するバス制御回路において、前記CPUからの読み出しあるいは書込みの指令に基づき前記外部回路に対して前記読出制御信号あるいは前記書込制御信号を生成して出力する読出/書込回路と、該読出/書込回路から前記読出制御信号あるいは前記書込制御信号を前記外部回路に出力した後に前記レディ信号が有効になることなく規定時間が経過するとリトライ信号を出力するバスサイクル計測回路とを具備し、前記読出/書込回路は、前記バスサイクル計測回路から前記リトライ信号が出力されることにより前記読出制御信号あるいは前記書込制御信号を一旦解除するとともに再度生成して、前回と同一アクセスのバスサイクルが実行されるようにしたことを特徴とする。 The invention of the bus control circuit is connected to an external circuit via a bus and a control line, and outputs a read control signal or a write control signal to the external circuit based on a read or write command from the CPU. When reading or writing, in the bus control circuit that completes the processing of the bus cycle of the access based on the ready signal input from the external circuit becoming valid, the external control is performed based on a read or write command from the CPU. A read / write circuit that generates and outputs the read control signal or the write control signal to the circuit, and outputs the read control signal or the write control signal from the read / write circuit to the external circuit Bus cycle measurement circuit that outputs a retry signal when the specified time has passed without the ready signal being valid. And the read / write circuit temporarily cancels the read control signal or the write control signal and generates it again when the retry signal is output from the bus cycle measuring circuit. A bus cycle of the same access is executed.
ここで、前記バスサイクル計測回路は、前記読出制御信号あるいは前記書込制御信号が生成されると時間の計測動作を一旦解除してから該計測動作を再開し、前記リトライ信号が出力された後は前記読出制御信号及び前記書込制御信号が解除されると前記計測動作を解除することことが望ましい。 Here, when the read control signal or the write control signal is generated, the bus cycle measuring circuit once cancels the time measuring operation and then restarts the measuring operation, and after the retry signal is output. Preferably, the measurement operation is canceled when the read control signal and the write control signal are canceled.
また、前記バスサイクル計測回路で生成される前記リトライ信号の回数を計測して規定回数に達すると、割り込みあるいはリセットとして使用できる信号を出力するリトライ回数計測回路を具備することも望ましい。 It is also desirable to provide a retry count measurement circuit that outputs a signal that can be used as an interrupt or reset when the number of retry signals generated by the bus cycle measurement circuit is measured and reaches a specified number.
さらに、前記リトライ回数計測回路は、前記リトライ回数の計測値が前記規定回数に達する前に前記レディ信号が有効になると前記リトライ回数の計測動作を解除することも望ましい。 Furthermore, it is preferable that the retry count measurement circuit cancels the retry count measurement operation when the ready signal becomes valid before the measured value of the retry count reaches the specified count.
さらに、前記リトライ回数計測回路が計測する前記リトライ回数の計測値が前記規定回数に達することにより前記アクセスに関する情報を記憶するアクセス内容記憶回路を具備することも望ましい。 Furthermore, it is desirable to further include an access content storage circuit that stores information related to the access when the measured value of the retry count measured by the retry count measurement circuit reaches the specified count.
さらに、前記アクセス内容記憶回路に記憶された前記アクセスに関する情報を前記CPUに読ませるためのデータ処理を行うデータ処理回路を具備することも望ましい。 Further, it is desirable to further include a data processing circuit that performs data processing for causing the CPU to read information related to the access stored in the access content storage circuit.
本発明によれば、レディ信号が何らかの理由により有効にならない場合に再度前回と同一アクセスのバスサイクルを実行させて、バスアクセスを正常に完了する機会を増大させるので、ハングアップしてしまう状況を回避することが可能となる。また、そのバスアクセスが不調に終わった場合でも、その対象デバイスへのアクセス内容を記憶しておくことで、割込み等を利用して対象デバイスへのリセット、設定処理を行うことにより、その後の処理続行の可能性が高まる。その結果として、システム全体のリセット(再起動)機会を削減することができる。 According to the present invention, when the ready signal is not valid for some reason, the same access bus cycle as the previous time is executed again to increase the chance of normal completion of the bus access. It can be avoided. In addition, even if the bus access ends abnormally, by storing the access contents to the target device, resetting and setting the target device using an interrupt etc., the subsequent processing The possibility of continuing increases. As a result, the opportunity for resetting (restarting) the entire system can be reduced.
本実施例では、マイクロコントローラの外部に接続されたメモリやI/Oデバイスといった外部回路に対して読出動作や書込動作を行う際に使用するレディ信号が有効になるのを待ち、当該アクセスのバスサイクルの処理の完了をCPUに通知するバス制御回路において、長時間そのレディ信号が有効にならない場合に、強制的に対外的な(=I/Oデバイスやメモリに接続される外部バスから見た)現バスサイクルを中止し、非アクセス状態に強制的に復帰させ、復帰後再び前回と同一のアクセスのバスサイクルを実行する。そして、この同一バスサイクルの再実行を規定回数行ってもレディ信号が有効にならない場合には、CPUに向けて割り込み要求やリセットとして利用可能な信号を出力したり、あるいは、さらに進めてそのときの対象デバイスへのアクセス内容を記憶しておくことで、割り込み等を利用してCPU等から対象デバイスへのリセット、設定処理を行うことを容易に実現可能とする。 In this embodiment, the access waits until a ready signal used when performing a read operation or a write operation on an external circuit such as a memory or an I / O device connected to the outside of the microcontroller becomes valid. In the bus control circuit that notifies the CPU of the completion of processing of the bus cycle, when the ready signal is not valid for a long time, it is forcibly viewed from the external bus (= external bus connected to the I / O device or memory). A) Stop the current bus cycle, forcibly return to the non-access state, and execute the same access bus cycle as the previous time after returning. If the ready signal does not become effective even if the same bus cycle is re-executed a specified number of times, a signal that can be used as an interrupt request or reset is output to the CPU, or the signal is further advanced and By storing the access contents to the target device, it is possible to easily perform reset and setting processing from the CPU or the like to the target device using an interrupt or the like.
図1は本発明の実施例1のバス制御回路およびその周辺の回路部分を示すブロック図である。図1において、A[15:0]は16ビットのアドレスバスであり、マイクロコントローラ10から外部I/Oデバイス20へ接続されている。また、D[7:0]は8ビットのデータバスであり、マイクロコントローラ10と外部I/Oデバイス20とに双方向に接続されている。
FIG. 1 is a block diagram showing a bus control circuit and its peripheral circuit portion according to the first embodiment of the present invention. In FIG. 1, A [15: 0] is a 16-bit address bus, and is connected from the
CPU_RDN、CPU_WRNは、各々図示しないCPUからの外部への読み出し、書込みを行う際に“L”となる読出制御信号および書込制御信号(Low Active)である。CPUはバス制御回路11からの読出終了信号RD_END、書込終了信号WR_ENDの“H”を受けて、リードサイクル、ライトサイクル、すなわちバスサイクルを終了する。この読出終了信号RD_END、書込終了信号WR_ENDは、バス制御回路11が外部I/Oデバイス20からの有効データ取り込みが完了した時点、又は外部I/Oデバイスへ20の有効データ書き込みが完了した時点で“H”となる信号(High Active)である。
CPU_RDN and CPU_WRN are a read control signal and a write control signal (Low Active) that are set to “L” when reading and writing from a CPU (not shown) to the outside, respectively. The CPU receives the read end signal RD_END and the write end signal WR_END “H” from the
バス制御回路11から外部I/Oデバイス20への読出制御信号RDN、書込制御信号WRNは、それぞれCPUからの読出制御信号CPU_RDN、書込制御信号CPU_WRNに基づき出力する。ただし、これはメモリやI/Oデバイスといった外部回路とのハンドシェークに使用するレディ信号RDYの有効入力とのタイミング等を考慮したバスタイミングを提供するためのものである。このバス制御回路11の存在により、様々な外部I/Oデバイスやメモリ等と接続する必要がある場合に、複雑になりがちなバス制御回路11の部分をCPU自体から分離することにより、CPU自体のリード、ライトに関する仕様及び設計が容易になる利点がある。
A read control signal RDN and a write control signal WRN from the
本実施例1では、バス制御回路11内に読出/書込回路としてのRDN_WRN生成回路111、バスサイクル計測回路112、及びリトライ回数計測回路113を配置する。RDN_WRN生成回路111は文字通り外部I/Oデバイス20に向けて出力する読出制御信号RDN、書込制御信号WRNを生成する回路である。
In the first embodiment, an
バスサイクル計測回路112はバスサイクルがシステムクロック単位で何クロック分継続しているかを計測する回路であり、規定クロック数に達するとリトライ信号RETRYを出力する。
The bus
RDN_WRN生成回路111はこのリトライ信号RETRYを受けると、外部I/Oデバイス20に対する読出サイクルもしくは書き込みサイクルの再実行を要求するために、読出制御信号RDNもしくは書込制御信号WRNを一旦解消してから再度生成する。
Upon receiving the retry signal RETRY, the
リトライ回数計測回路113は、バスサイクル計測回路112からのリトライ信号RETRYを受け、前回と同一アクセスのバスサイクルが何回実行されたかを計測する内部カウンタを備え、その計測値RTRY_CNTが規定回数に達した際に、CPUに向けてパルス信号INT_Oを発生する。
The retry
また、このリトライ回数計測回路113は、外部I/Oデバイス20からのレディ信号RDYが有効になりバスサイクルが正常終了した際に、RDN_WRN生成回路111から出力される読出終了信号RD_ENDあるいは書込終了信号WR_ENDを受けて、内部カウンタをリセットする。
In addition, the retry
さらに、このリトライ回数計測回路113は、現在のリトライ回数の計測値RTRY_CNTをRDN_WRN生成回路111に送り、その計測値RTRY_CNTが規定回数に達すると、RDN_WRN生成回路111から読出終了信号RD_ENDあるいは書込終了信号WR_ENDが出力されるので、このときも、RDN_WRN生成回路111から出力される読出終了信号RD_ENDあるいは書込終了信号WR_ENDを受けて、内部カウンタをリセットする。
Further, the retry
図2に外部I/Oデバイス20からのデータ読出動作(正常時)のタイミングチャートを示す。マイクロコントロ−ラ10は、内部レジスタに保持されたアドレス値をアドレスバスA[15:0]に出力する。それと同時に、CPUは読出制御信号CPU_RDNを“L”にする。バス制御回路11は読出制御信号CPU_RDN=“L”を受けて、読出制御信号RDNを“H”→“L”にする。外部I/Oデバイス20は、マイクロコントローラ10からの読出要求に応答するデータの準備が完了した時点で有効出力データをデータバスD[7:0]に出力すると同時に、レディ信号RDYを有効に、つまり“L”→“H”にする。バス制御回路11はこのレディ信号RDYの“L”→“H”を受けて読出終了信号RD_ENDを“H”にし、これを受けてCPUは読出データを内部に取り込むことが可能となる。それと同時にCPUは読出制御信号CPU_RDNを“L”→“H”にすることで、読出サイクルを終了する。
FIG. 2 shows a timing chart of the data read operation (normal time) from the external I /
図3に外部I/Oデバイス20へのデータ書込動作(正常時)のタイミングチャートを示す。マイクロコントローラ10は、内部レジスタに保持されたアドレス値をアドレスバスA[15:0]に出力する。それと同時に書込制御信号CPU_WRNを“L”にする。データバスD[7:0]は書込データを出力し、バス制御回路11は書込制御信号CPU_WRN=“L”を受けて、書込制御信号WRNを“H”→“L”にする。外部I/Oデバイス20はマイクロコントローラ10からの書込要求への対応準備が完了した時点でレディ信号RDYを有効に、つまり“L”→“H”にすると共に、内部へ書込データを取り込む。バス制御回路11はレディ信号RDYの“L”→“H”を受けて書込終了信号WR_ENDを“H”にし、これを受けてCPUは書込制御信号CPU_WRNを“L”→“H”にすることで、書込サイクルを終了する。
FIG. 3 shows a timing chart of a data write operation (normal time) to the external I /
図4はバスサイクル計測回路112の構成例を示すブロック図である。図中では3ビットのバイナリカウンタ1121をシンボル化して表しており、このカウンタ1121は「0」→「7」までのカウントアップを行うものである。カウントするのはシステムクロック信号CLKの立ち上がりであり、イネーブル端子ENABLEが“H”の場合にクロック信号CLKの立ち上がりでカウント値を+1し、イネーブル端子ENABLEが“L”の場合にはカウント値を変更しない。また、リセット端子RESETNが“L”の場合にはクロック信号CLKの立ち上がりでカウンタの値を「0」とし、リセット端子RESETNが“H”の場合には先に説明したイネーブル端子ENABLEによって動作を切り替えるリセット優先のカウンタである。
FIG. 4 is a block diagram illustrating a configuration example of the bus
その他、1122はリトライ信号RETRYによって入力を切り替えるセレクタ、1123はD型フリップフロップ、1124,1125,1126はAND回路、1127はNOR回路、1128はインバータである。D型フリップフロップ1123とAND回路1124により、読出制御信号RDNあるいは書込制御信号WRNの立ち下がりエッジを検出すると、AND回路1124は“H”を出力する。
In addition,
本実施例1では、読出制御信号RDNあるいは書込制御信号WRNが“L”の場合に、カウンタ1121のイネーブル端子ENABLEが“H”となることで、その読出制御信号RDNあるいは書込制御信号WRNがシステムクロック信号CLK単位でどれだけの期間“L”であるかがカウントされる。カウンタ1121のリセットは、システムRESETの他、リトライ信号RETRY=“L”の場合はAND回路1124の出力がセレクタ1122で選択されて読出制御信号RDNあるいは書込制御信号WRNの“H”→“L”のとき実施され、リトライ信号RETRY=“H”の場合はNOR回路1126の出力がセレクタ1122で直接選択されて読出制御信号RDNおよび書込制御信号WRNが共に“H”のときに実施される。
In the first embodiment, when the read control signal RDN or the write control signal WRN is “L”, the enable terminal ENABLE of the
すなわち、カウンタ1121は、例えば読み出し動作の場合では、読出制御信号RDNが“H”→“L”になるとリセットされ、それからクロック信号CLKをカウントし、そのカウント値=「7」未満においてレディ信号RDYが“H”となることにより読出制御信号RDNが“L”→“H”に復帰すればリセットされるが、カウント値=「7」になるとリトライ信号RETRYが“H”となり、バスサイクルが終了しなかったことが示される。そして、リトライ信号RETRYが“H”となると、RDN_WRN生成回路111により読出制御信号RDNが“H”となり、カウンタ1121はリセットされ、リトライ信号RETRYが“L”になる。書込み動作の場合もこれと同様である。
That is, for example, in the case of a read operation, the
図5はリトライ回数計測回路113の構成例を示すブロック図である。図中で使用するカウンタ1131の機能は図4で使用しているカウンタ1121とまったく同じである。1132,1133はD型フリップフロップ、1134〜1136はAND回路、1137はNOR回路である。D型フリップフロップ1132とAND回路1134により、リトライ信号RETRYの立ち上がりエッジを検出すると、AND回路1134は“H”を出力する。D型フリップフロップ1133とAND回路1136により、AND回路1135の立ち上がりエッジを検出すると、アンド回路1136は“H”を出力する。
FIG. 5 is a block diagram illustrating a configuration example of the retry
カウンタ1131はリトライ信号RETRYの立ち上がりエッジの回数を計測し、計測値RTRY_CNTを出力する。このカウンタ1131のリセットはシステムRESET信号、読出終了信号RD_ENDあるいは書込終了信号WR_ENDが“H”の時に行われる。また、このカウンタ1131のカウント値が「7」になると、AND回路1135が1クロック分のパルス信号INT_Oを出力し、CPUへの割り込み要求やリセットとして使用することができる。
The
図6は最初の読出サイクルでレディ信号RDYが有効にならず、リトライを行い2回目の読出サイクルを実施し、レディ信号RDYが有効になった場合のタイミングチャートである。図中のカウント値COUNTはバスサイクル計測回路112内のカウンタ1121の値を10進数で示したものである。カウンタ1121は、読出制御信号RDN=“L”を受けて、カウント値COUNT=「0」にクリアされ、その後も読出制御信号RDNが“L”なので、クロック信号CLKに同期してカウントアップする。
FIG. 6 is a timing chart in the case where the ready signal RDY is not enabled in the first read cycle, the retry is performed and the second read cycle is performed, and the ready signal RDY is enabled. The count value COUNT in the figure indicates the value of the
カウント値COUNTが本実施例1での規定値である「7」になったところでリトライ信号RETRYが“H”となり、これにより読出制御信号RDNが“L”→“H”になり外部I/Oデバイス20からみた見かけ上のバスサイクル(1回目)が終了する。また、これと同時にリトライ回数計測回路113内のカウンタ1131の計測値RTRY_CNTが「0」から「1」にカウントアップされる。加えて、読出制御信号RDNが“H”になったことで、カウンタ1121のカウント値COUNTは「0」にクリアされ、前回と同一アクセスの2回目のバスサイクルが開始される。
When the count value COUNT reaches “7” which is the specified value in the first embodiment, the retry signal RETRY changes to “H”, and the read control signal RDN changes from “L” to “H”, thereby causing the external I / O. The apparent bus cycle (first time) seen from the
本例では2回目のバスサイクルで読出制御信号RDNが“L”の期間に、レディ信号RDYが“H”となるのを受けて読出終了信号RD_ENDが“H”、そして読出制御信号CPU_RDNが“H”となり、この時点で本読み出しのアクセスに関するバスサイクルは終了する。1回目及び2回目のバスサイクル期間中、読出制御信号CPU_RDNは“L”のままであり、読出終了信号RD_ENDが“H”になるまでの間、CPUとしては長めのバスサイクルを1回実行したという捉え方となる。リトライ回数計測回路113内のカウンタ1131は読出終了信号RD_ENDが“H”になることでリセットされる。
In this example, in the period when the read control signal RDN is “L” in the second bus cycle, the read end signal RD_END is “H” in response to the ready signal RDY becoming “H”, and the read control signal CPU_RDN is “ At this time, the bus cycle relating to the read access ends. During the first and second bus cycles, the read control signal CPU_RDN remains “L”, and the CPU executes one long bus cycle until the read end signal RD_END becomes “H”. It will be understood. The
図6に対応する書き込み処理に関しては、図2と図3の関係から明らかなように、各信号を、RDN→WRN、CPU_RDN→CPU_WRN、RD_END→WR_ENDに置き換えることで対応可能なため、詳細な説明を省略する(両者でデータバスD[7:0]の波形が異なるが、本質ではない)。 The write processing corresponding to FIG. 6 can be handled by replacing each signal with RDN → WRN, CPU_RDN → CPU_WRN, RD_END → WR_END, as is apparent from the relationship between FIG. 2 and FIG. (The waveform of the data bus D [7: 0] differs between the two, but this is not essential).
図7はリトライ回数、つまりリトライ回数計測回路113内のカウンタ1131の計測値RTRY_CNTが本実施例での規定数である「7」(つまり、リトライ回数が8回目)に到達した際に1クロック幅のパルス信号INT_Oが出力される様子を示したタイミングチャートである。このパルス信号INT_Oを割り込み要求信号として利用することにより、バスサイクルエラーの感知後の処理をソフトウェアで対応することが可能となる。また、このパルス信号INT_Oをリセットとして利用し、システムの初期化に利用することも可能となる。なお、このように、計測値RTRY_CNTが本実施例1での規定数である「7」に到達したときは、この計測値RTRY_CNTに基づき読出終了信号RD_ENDが“H”、そして読出制御信号CPU_RDNが“H”となり、この時点で本読み出しのアクセスに関するバスサイクルは終了する。リトライ回数計測回路113内のカウンタ1131は読出終了信号RD_ENDが“H”になることでリセットされる。
FIG. 7 shows the number of retries, that is, one clock width when the measured value RTRY_CNT of the
図8は本発明の実施例2のバス制御回路およびその周辺の回路部分を示すブロック図である。図1に示したものと同じものには同じ符号を付けた。114はアクセス内容記憶回路であり、リトライ回数が規定値である「7」に達し、アクセスが不調に終わった際に、そのアクセス内容である、アドレスバスA[15:0]、書き込みの場合の書き込みデータDOUT[7:0]、読み出しフラグとしてのCPU_RDN、書き込みフラグとしてのCPU_WRNの内容を、データDO[25:0]として内部レジスタにまとめて記憶する。
FIG. 8 is a block diagram showing a bus control circuit and its peripheral circuit portion according to the second embodiment of the present invention. The same components as those shown in FIG.
115はアクセスが不調に終わった際にCPUに読み込ませるためのデータを生成するデータ処理回路としてのDIN生成回路であり、CPUからの読み出しアクセスがIOデバイス20に対する場合にはIOデバイス20からの読み出しデータバスD[7:0]の内容をDIN[7:0]として出力し、またアクセス内容記憶回路114に対する場合はアクセス内容記憶回路114のレジスタに記憶したデータDO[25:0]を8ビット単位で切り替えてDIN[7:0]として出力する。
図9はアクセス内容記憶回路114の構成例を示すブロック図である。1141は3ビットのD型フリップフロップ、1142は26ビットのD型フリップフロップ、1143〜1145はAND回路、1146はOR回路、1147はセレクタである。
FIG. 9 is a block diagram showing a configuration example of the access
D型フリップフロップ1141は、リトライ回数計測回路113内のカウンタ1131の計測値RTRY_CNTを取り込み、その値が「6」に達すると、AND回路1143の出力が“H”となり、AND回路1144のゲートを開くので、その次の“H”のリトライ信号RETRY(これは、RTRY_CNT=「7」のとき)が入力した時にそのAND回路1144の出力が“H”となり、AND回路1145がゲートを開く。
The D-type flip-
この結果、不調に終わったアクセスの内容であるところのアドレスバスA[15:0]、書き込みの場合の書き込みデータバスDOUT[7:0]、読み出しフラグとしてのCPU_RDN、書き込みフラグとしてのCPU_WRNの内容、つまり合計26ビットが、アンド回路1145を経由してセレクタ1147に入力する。
As a result, the content of the address bus A [15: 0], which is the content of the access that ended abnormally, the write data bus DOUT [7: 0] in the case of writing, the CPU_RDN as the read flag, and the content of the CPU_WRN as the write flag That is, a total of 26 bits are input to the
このとき、計測値RTRY_CNTが「7」になったことに基づき読出終了信号RD_ENDが“H”となっているので、OR回路1146の出力が“H”となり、セレクタ1147はAND回路1145の出力を選択して、前記した不調に終わったアクセスの内容を示すデータDO[25:0]がフリップフロップ1142に記憶される。この後に読出終了信号RD_ENDが“L”になり、セレクタ1147が切り替わるので、クロックCLKが更新しても、このフリップフロップ1142の記憶内容はセレクタ1147経由で自己保持される。
At this time, since the read end signal RD_END is “H” based on the measurement value RTRY_CNT becoming “7”, the output of the
図10はDIN生成回路115の構成例を示すブロック図である。1151はCPUから到来するアドレスバスA[15:0]の内容を3ビットのコードに変換するデコード回路、1152はアクセス内容記憶回路114の26ビットの保持データDO[25:0]およびIOデバイス20の読み出しデータD[7:0]を、デコード回路1151のデコード結果によって選択するセレクタである。アクセス内容記憶回路114の保持データDO[25:0]は、DO[7:0],DO[15:8],DO[22:16],DO[25:23]のように8ビット単位で選択される(8ビットに足りない場合には不足ビットは任意とする)。
FIG. 10 is a block diagram illustrating a configuration example of the
デコード回路1151は、CPUからのアドレスバスA[15:0]の内容がIOデバイス20を示すときは“000”のコードを出力する。すると、セレクタ1152は、IOデバイス20への入力データD[7:0]を選択し、これがCPUに読み込まれる。CPUからのアドレスバスA[15:0]の内容がアクセス内容記憶回路114に割り当てられたIOアドレス#0を示すときは“001”のコードを出力し、アクセス内容記憶回路114に記憶されているデータDO[25:0]の内のデータDO[7:0]を選択し、これがCPUに読み込まれる。以下、アクセス内容記憶回路114に割り当てられたIOアドレス#1,#2,#3を示すときは、それぞれコード“010”,“011”,“100”を出力することで、データDO[25:0]の内のデータDO[15:8],DO[22:16],DO[25:23]を選択し、これらがCPUに読み込まれる。
The
このようにして、CPUからのアドレスバスA[15:0]の内容を切り替えることによって、DIN生成回路115はアクセス内容記憶回路114の記憶データDO[25:0]やIOデバイス20から直接読み出したデータD[7:0]をCPUで読み取り易いように8ビット単位としてそのCPUに送る。
In this way, by switching the contents of the address bus A [15: 0] from the CPU, the
以上のように、INT_O信号による割込み処理により、CPUがソフトウエアでこのアクセス内容記憶回路114内の記憶内容等をDIN生成回路115によってデータ処理してから読み出すことにより、ユーザはどのIOデバイスでアクセスのエラーが発生したのかを知ることが可能となる。仮に、この特定されたIOデバイスがそれまでの処理の履歴を考慮しないIOデバイスの場合であれば、この特定されたIOデバイスのみをリセットし、この後にこのIOデバイスの再度の設定作業を行い、再度先般不調に終わったアクセスを行い、再び処理を続行することが可能となる。このことは、システム全体のリセット(再起動)機会の削減を意味する。
As described above, by the interrupt processing by the INT_O signal, the CPU accesses the contents stored in the access
10:マイクロコントローラ
11:バス制御回路
111:RDN_WRN生成回路(読出/書込回路)
112:バスサイクル計測回路、1121:カウンタ、1122:セレクタ、1123:D型フリップフロップ、1124,1125,1126:AND回路、1127:NOR回路、1128:インバータ
113:リトライ回数計測回路、1131:カウンタ、1132,1133:D型フリップフロップ、1134〜1136:AND回路、1137:NOR回路
114:アクセス内容記憶回路、1141,1142:D型フリップフロップ、1143〜1145:AND回路、1146:OR回路、1147:セレクタ
115:DIN生成回路、1151:デコード回路、1152:セレクタ
20:外部I/Oデバイス
A[15:0]:アドレスバス
D[7:0]:データバス
CLK:クロック信号
CPU_RDN:読出制御信号
CPU_WRN:書込制御信号
RDN:読出制御信号
WRN:書込制御信号
RDY:レディ信号
RETRY:リトライ信号
WR_END:書込終了信号
RD_END:読出終了信号
COUNT:カウンタ1121のカウント値
RTRY_CNT:カウンタ1131のカウント値
10: Microcontroller 11: Bus control circuit 111: RDN_WRN generation circuit (read / write circuit)
112: Bus cycle measurement circuit, 1121: Counter, 1122: Selector, 1123: D-type flip-flop, 1124, 1125, 1126: AND circuit, 1127: NOR circuit, 1128: Inverter 113: Retry count measurement circuit, 1131: Counter, 1132, 1133: D-type flip-flop, 1134 to 1136: AND circuit, 1137: NOR circuit 114: Access content storage circuit, 1141, 1142: D-type flip-flop, 1143 to 1145: AND circuit, 1146: OR circuit, 1147: Selector 115: DIN generation circuit, 1151: decode circuit, 1152: selector 20: external I / O device A [15: 0]: address bus D [7: 0]: data bus CLK: clock signal CPU_RDN: read control signal CPU_WR : Write control signal RDN: read control signal WRN: write control signal RDY: Ready signal RETRY: Retry signal WR_END: write end signal RD_END: read end signal COUNT: count value of the
Claims (10)
前記レディ信号が規定時間を超えても有効にならないとき、現バスサイクルを中止することにより非アクセス状態に復帰させ、該非アクセス状態になった後再度前回と同一アクセスのバスサイクルを実行することを特徴とするバス制御方法。 When a read operation or a write operation is performed on an external circuit using the CPU, processing of the bus cycle for the read or write access is completed based on the ready signal input from the external circuit being valid. In the bus control method to
When the ready signal does not become effective even after a specified time, the current bus cycle is canceled to return to the non-access state, and after entering the non-access state, the same access bus cycle as before is executed again. A characteristic bus control method.
前記同一アクセスのバスサイクルの実行回数が規定数に達することにより、前記バスサイクルの処理を終了すると共に割り込みあるいはリセットとして使用できる信号を出力することを特徴とするバス制御方法。 The bus control method according to claim 1,
When the number of executions of the same access bus cycle reaches a specified number, the bus cycle processing is terminated and a signal that can be used as an interrupt or reset is output.
前記同一アクセスのバスサイクルの実行回数が規定数に達することにより、前記バスサイクルの処理を終了すると共に当該アクセスに関する情報を記憶することを特徴とするバス制御方法。 The bus control method according to claim 1,
A bus control method characterized in that when the number of executions of the bus cycle of the same access reaches a specified number, the processing of the bus cycle is terminated and information relating to the access is stored.
前記記憶したアクセスに関する情報を前記CPUに読ませるためのデータ処理を行うことを特徴とするバス制御回路。 The bus control method according to claim 3,
A bus control circuit that performs data processing for causing the CPU to read information relating to the stored access.
前記CPUからの読み出しあるいは書込みの指令に基づき前記外部回路に対して前記読出制御信号あるいは前記書込制御信号を生成して出力する読出/書込回路と、該読出/書込回路から前記読出制御信号あるいは前記書込制御信号を前記外部回路に出力した後に前記レディ信号が有効になることなく規定時間が経過するとリトライ信号を出力するバスサイクル計測回路とを具備し、
前記読出/書込回路は、前記バスサイクル計測回路から前記リトライ信号が出力されることにより前記読出制御信号あるいは前記書込制御信号を一旦解除するとともに再度生成して、前回と同一アクセスのバスサイクルが実行されるようにしたことを特徴とするバス制御回路。 When connected to an external circuit via a bus and a control line and reading or writing by outputting a read control signal or a write control signal to the external circuit based on a read or write command from the CPU, In the bus control circuit that completes the processing of the bus cycle of the access based on the ready signal input from the external circuit being valid,
A read / write circuit that generates and outputs the read control signal or the write control signal to the external circuit based on a read or write command from the CPU, and the read control from the read / write circuit A bus cycle measuring circuit that outputs a retry signal when a specified time elapses without the ready signal being effective after the signal or the write control signal is output to the external circuit,
The read / write circuit temporarily cancels the read control signal or the write control signal when the retry signal is output from the bus cycle measuring circuit, and generates the bus control cycle in the same access as the previous time. A bus control circuit characterized in that is executed.
前記バスサイクル計測回路は、前記読出制御信号あるいは前記書込制御信号が生成されると時間の計測動作を一旦解除してから該計測動作を再開し、前記リトライ信号が出力された後は前記読出制御信号及び前記書込制御信号が解除されると前記計測動作を解除することを特徴とするバス制御回路。 The bus control circuit according to claim 5.
When the read control signal or the write control signal is generated, the bus cycle measurement circuit once cancels the time measurement operation and restarts the measurement operation. After the retry signal is output, the bus cycle measurement circuit resumes the read operation. A bus control circuit which releases the measurement operation when a control signal and the write control signal are released.
前記バスサイクル計測回路で生成される前記リトライ信号の回数を計測して規定回数に達すると、割り込みあるいはリセットとして使用できる信号を出力するリトライ回数計測回路を具備することを特徴とするバス制御回路。 In the bus control circuit according to claim 5 or 6,
A bus control circuit, comprising: a retry count measuring circuit that outputs a signal that can be used as an interrupt or a reset when the number of retry signals generated by the bus cycle measuring circuit is measured and reaches a specified number.
前記リトライ回数計測回路は、前記リトライ回数の計測値が前記規定回数に達する前に前記レディ信号が有効になると前記リトライ回数の計測動作を解除することを特徴とするバス制御回路。 The bus control circuit according to claim 7,
The retry count measurement circuit releases the retry count measurement operation when the ready signal becomes valid before the measured value of the retry count reaches the specified count.
前記リトライ回数計測回路が計測する前記リトライ回数の計測値が前記規定回数に達することにより前記アクセスに関する情報を記憶するアクセス内容記憶回路を具備することを特徴とするバス制御回路。 The bus control circuit according to claim 7,
A bus control circuit comprising: an access content storage circuit for storing information related to the access when a measured value of the retry count measured by the retry count measurement circuit reaches the specified number of times.
前記アクセス内容記憶回路に記憶された前記アクセスに関する情報を前記CPUに読ませるためのデータ処理を行うデータ処理回路を具備することを特徴とするバス制御回路。
The bus control circuit according to claim 7,
A bus control circuit comprising a data processing circuit for performing data processing for causing the CPU to read information relating to the access stored in the access content storage circuit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005196296A JP2006092522A (en) | 2004-08-25 | 2005-07-05 | Bus control method and circuit |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004245694 | 2004-08-25 | ||
JP2005196296A JP2006092522A (en) | 2004-08-25 | 2005-07-05 | Bus control method and circuit |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2006092522A true JP2006092522A (en) | 2006-04-06 |
Family
ID=36233395
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2005196296A Withdrawn JP2006092522A (en) | 2004-08-25 | 2005-07-05 | Bus control method and circuit |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2006092522A (en) |
-
2005
- 2005-07-05 JP JP2005196296A patent/JP2006092522A/en not_active Withdrawn
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20090210590A1 (en) | Peripheral module register access methods and apparatus | |
JP2002041489A (en) | Synchronizing signal generation circuit, processor system using the same and synchronizing signal generating method | |
US20150234661A1 (en) | Semiconductor integrated circuit device and system using the same | |
JPH05204709A (en) | Processor | |
US10656952B2 (en) | System on chip (SOC) and method for handling interrupts while executing multiple store instructions | |
JP5292706B2 (en) | Computer system | |
JP2016143422A (en) | Configuring serial devices | |
JP2010181990A (en) | Data processor | |
JP2011227730A (en) | Microcomputer | |
JP2006092522A (en) | Bus control method and circuit | |
JP6673021B2 (en) | Memory and information processing device | |
EP2352092B1 (en) | Processor, information processing apparatus, and method of controlling processor | |
JP5549627B2 (en) | Microcomputer | |
JP2008059191A (en) | Microcontroller and its debugging method | |
JP5012562B2 (en) | Microcomputer | |
JP5350049B2 (en) | Interface circuit | |
JP2008021040A (en) | Bus master circuit, bus control method and computer program | |
JP2017073186A (en) | Nonvolatile storage device | |
JPH1049489A (en) | Signal generating device | |
JP2003331587A (en) | Control device for data input of serial eeprom | |
JPS6346460B2 (en) | ||
JP2563204B2 (en) | Dynamic bus size detection circuit | |
JP2010049462A (en) | Data processor | |
JP2010140132A (en) | Memory system and memory controller | |
JP2006221435A (en) | Memory circuit |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20081007 |