JP2009271610A - Buffer control circuit, buffer circuit and data processor - Google Patents
Buffer control circuit, buffer circuit and data processor Download PDFInfo
- Publication number
- JP2009271610A JP2009271610A JP2008119403A JP2008119403A JP2009271610A JP 2009271610 A JP2009271610 A JP 2009271610A JP 2008119403 A JP2008119403 A JP 2008119403A JP 2008119403 A JP2008119403 A JP 2008119403A JP 2009271610 A JP2009271610 A JP 2009271610A
- Authority
- JP
- Japan
- Prior art keywords
- data
- circuit
- buffer
- time
- transfer
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Bus Control (AREA)
Abstract
Description
本発明は、バッファ制御回路に関し、特にメモリから転送されたデータをバッファ回路に保持して処理回路に供給するバッファ制御回路、バッファ回路およびデータ処理装置に関する。 The present invention relates to a buffer control circuit, and more particularly to a buffer control circuit, a buffer circuit, and a data processing apparatus that hold data transferred from a memory in a buffer circuit and supply the data to a processing circuit.
可変長符号の復号などの際には、メモリから転送されたデータを一旦バッファに保持し、そのバッファから処理に必要な量のデータをビット単位でシーケンシャルに読み出すという処理が行われる。具体的には、ストリーム処理装置をCPU(Central Processing Unit)のコプロセッサとして実現し、DMA(Direct Memory Access)制御部とコプロセッサとの間にストリームを管理するFIFO(First-In First-Out)バッファを設ける。ストリーム処理を行うコプロセッサは、ストリーム要求を出力して、ストリームとして参照したいビット数を読み出すまで待つ。これにより、自動的にストリームが入力されるため、ストリーム入力に関するソフトウェアを記述する手間を解消することができる。 When decoding a variable length code, the data transferred from the memory is temporarily held in a buffer, and the amount of data necessary for the processing is sequentially read from the buffer in bit units. Specifically, a stream processing apparatus is realized as a coprocessor of a CPU (Central Processing Unit), and a FIFO (First-In First-Out) that manages a stream between a DMA (Direct Memory Access) control unit and the coprocessor Provide a buffer. The coprocessor that performs stream processing outputs a stream request and waits until the number of bits to be referred to as a stream is read. Thereby, since the stream is automatically input, it is possible to eliminate the trouble of writing software related to the stream input.
このとき、DMA制御部の起動前にストリームを使用する命令が実行されてしまうと、デッドロックを生じるおそれがある。FIFOバッファに自動的にストリームデータが補充されることを前提としているため、ストリーム入力が止まってしまうと、コプロセッサが入力を待ち続けてしまうからである。DMA制御部の起動前にストリーム要求が発生するのは、命令の記述ミス、コンパイラによる命令の最適化、プロセッサによるアウトオブオーダ(out-of-order)実行によって順番が入れ替わっている場合や、DMA制御部の制御レジスタの更新に時間を要したためにその起動よりも先にストリーム要求が発生した場合などが考えられる。 At this time, if an instruction that uses a stream is executed before the DMA control unit is activated, there is a risk of deadlock. This is because it is premised on that the FIFO buffer is automatically refilled with stream data, so if the stream input stops, the coprocessor will continue to wait for input. The stream request occurs before the DMA control unit is activated when the order is changed due to an instruction description mistake, instruction optimization by the compiler, or out-of-order execution by the processor. There may be a case where a stream request is generated prior to activation because it takes time to update the control register of the control unit.
メモリからのデータ転送処理を中断させる技術として、タイマーを用いることによりタイムアウト時にDMA転送を強制的に中断させるDMA要求制御装置が提案されている(例えば、特許文献1参照。)。
上述の従来技術では、DMA転送が起動された後にバスを長時間に亘り専有することを防止することができる。しかしながら、DMA転送を中断しても、コプロセッサはFIFOバッファにストリームデータが補充されるまで待ち続けることになり、デッドロックは解消しない。 In the above-described prior art, it is possible to prevent the bus from being occupied for a long time after the DMA transfer is activated. However, even if the DMA transfer is interrupted, the coprocessor keeps waiting until the FIFO buffer is filled with stream data, and the deadlock is not resolved.
本発明はこのような状況に鑑みてなされたものであり、ストリームデータなどのデータ処理を行う際に、バッファにデータが保持されるまで待ち続けてしまうことによるデッドロックを解消することを目的とする。 The present invention has been made in view of such a situation, and an object of the present invention is to eliminate a deadlock caused by waiting until data is held in a buffer when processing data such as stream data. To do.
本発明は、上記課題を解決するためになされたものであり、その第1の側面は、バッファへのデータの転送をデータ転送回路に対して要求するデータ転送要求回路と、上記バッファへのデータの転送を上記データ転送回路に対して連続して要求している時間を計数するタイマー回路と、上記タイマー回路によって計数された時間が所定の時間に達したか否かを判断して上記所定の時間に達するとタイムアウトを検出するタイムアウト検出回路と、上記タイムアウトが検出された場合には上記データ転送回路からのデータに代えてダミーデータを上記バッファへ供給するダミーデータ供給回路とを具備するバッファ制御回路である。これにより、タイマー回路によって計数された時間が所定の時間に達するとデータ転送回路からのデータに代えてダミーデータをバッファへ供給させるという作用をもたらす。 The present invention has been made to solve the above problems, and a first aspect thereof is a data transfer request circuit for requesting a data transfer circuit to transfer data to a buffer, and data to the buffer. A timer circuit that counts the time during which the data transfer circuit continuously requests the data transfer circuit, and whether or not the time counted by the timer circuit has reached a predetermined time Buffer control comprising a time-out detection circuit for detecting a time-out when the time is reached, and a dummy data supply circuit for supplying dummy data to the buffer instead of data from the data transfer circuit when the time-out is detected Circuit. Thus, when the time counted by the timer circuit reaches a predetermined time, dummy data is supplied to the buffer instead of the data from the data transfer circuit.
また、この第1の側面において、上記タイムアウト検出回路は、上記データ転送回路が上記要求に対してデータ転送完了状態にある場合には上記データ転送回路が上記要求に対してデータ転送完了状態にない場合と比べてより短い時間を上記所定の時間として当該所定の時間に達したか否かを判断してもよい。これにより、データ転送完了状態にある場合には、より短い時間によりダミーデータをバッファへ供給させるという作用をもたらす。 In the first aspect, the time-out detection circuit may be configured such that when the data transfer circuit is in a data transfer completion state with respect to the request, the data transfer circuit is not in a data transfer completion state with respect to the request. It may be determined whether or not the predetermined time has been reached with a shorter time as compared with the case. As a result, when the data transfer is completed, dummy data is supplied to the buffer in a shorter time.
また、この場合において、上記タイムアウト検出回路は、上記データ転送回路が上記要求に対してデータ転送完了状態にある場合には上記タイマー回路によって計数される時間が非ゼロになると上記タイムアウトを検出してもよい。これにより、データ転送完了状態にある場合には、直ちにダミーデータをバッファへ供給させるという作用をもたらす。 In this case, the time-out detection circuit detects the time-out when the time counted by the timer circuit becomes non-zero when the data transfer circuit is in a data transfer completion state with respect to the request. Also good. As a result, when the data transfer is completed, dummy data is immediately supplied to the buffer.
また、この第1の側面において、上記ダミーデータ供給回路は、上記タイムアウトが検出された場合であっても上記データ転送回路がビジー状態にある間は上記ダミーデータを上記バッファへ供給しないようにしてもよい。これにより、データ転送回路がビジー状態にある間はダミーデータをバッファへ供給させないという作用をもたらす。 Further, in this first aspect, the dummy data supply circuit does not supply the dummy data to the buffer while the data transfer circuit is busy even when the timeout is detected. Also good. Thus, the dummy data is not supplied to the buffer while the data transfer circuit is busy.
また、本発明の第2の側面は、データを保持するバッファと、上記バッファへのデータの転送をデータ転送回路に対して要求するデータ転送要求回路と、上記バッファへのデータの転送を上記データ転送回路に対して連続して要求している時間を計数するタイマー回路と、上記タイマー回路によって計数された時間が所定の時間に達したか否かを判断して上記所定の時間に達するとタイムアウトを検出するタイムアウト検出回路と、上記タイムアウトが検出された場合には上記データ転送回路からのデータに代えてダミーデータを上記バッファへ供給するダミーデータ供給回路とを具備するバッファ回路である。これにより、タイマー回路によって計数された時間が所定の時間に達するとデータ転送回路からのデータに代えてダミーデータをバッファへ供給させるという作用をもたらす。この場合において、上記バッファは、FIFOバッファであってもよい。 According to a second aspect of the present invention, there is provided a buffer for holding data, a data transfer request circuit for requesting the data transfer circuit to transfer data to the buffer, and the data transfer to the buffer. A timer circuit that counts the time continuously requested to the transfer circuit, and a time-out when the time counted by the timer circuit reaches a predetermined time by determining whether or not the predetermined time has been reached And a dummy data supply circuit for supplying dummy data to the buffer in place of data from the data transfer circuit when the timeout is detected. Thus, when the time counted by the timer circuit reaches a predetermined time, dummy data is supplied to the buffer instead of the data from the data transfer circuit. In this case, the buffer may be a FIFO buffer.
また、本発明の第3の側面は、メモリと、データを保持するバッファと、上記バッファからデータを取得して所定のデータ処理を行う処理回路と、上記バッファに対してデータを上記メモリから転送するデータ転送回路と、上記バッファへのデータの転送を上記データ転送回路に対して要求するデータ転送要求回路と、上記バッファへのデータの転送を上記データ転送回路に対して連続して要求している時間を計数するタイマー回路と、上記タイマー回路によって計数された時間が所定の時間に達したか否かを判断して上記所定の時間に達するとタイムアウトを検出するタイムアウト検出回路と、上記タイムアウトが検出された場合には上記データ転送回路からのデータに代えてダミーデータを上記バッファへ供給するダミーデータ供給回路とを具備するデータ処理装置である。これにより、タイマー回路によって計数された時間が所定の時間に達するとデータ転送回路からのデータに代えてダミーデータをバッファへ供給させて、処理回路にデータ処理を行わせるという作用をもたらす。 The third aspect of the present invention provides a memory, a buffer that holds data, a processing circuit that acquires data from the buffer and performs predetermined data processing, and transfers data from the memory to the buffer. A data transfer circuit for requesting the data transfer circuit to transfer data to the buffer, and continuously requesting the data transfer circuit to transfer data to the buffer. A timer circuit that counts a certain time, a time-out detection circuit that detects whether or not the time counted by the timer circuit has reached a predetermined time and reaches the predetermined time, and the time-out A dummy data supply circuit for supplying dummy data to the buffer instead of data from the data transfer circuit when detected A data processing device comprising a. As a result, when the time counted by the timer circuit reaches a predetermined time, dummy data is supplied to the buffer instead of the data from the data transfer circuit, and the processing circuit performs data processing.
本発明によれば、ストリームデータなどのデータ処理を行う際に、バッファにデータが保持されるまで待ち続けてしまうことによるデッドロックを解消することができるという優れた効果を奏し得る。 According to the present invention, when processing data such as stream data, it is possible to achieve an excellent effect that deadlock caused by waiting until data is held in the buffer can be eliminated.
次に本発明の実施の形態について図面を参照して詳細に説明する。 Next, embodiments of the present invention will be described in detail with reference to the drawings.
図1は、本発明の実施の形態におけるデータ処理装置の一例としてのストリーム処理装置の構成例を示す図である。このストリーム処理装置はCPU(Central Processing Unit)10と、メモリ20と、DMA(Direct Memory Access)制御部30と、ストリーム処理コプロセッサ40と、ストリーム管理部100とを備える。CPU10、メモリ20およびDMA制御部30の間はシステムバス50により相互に接続されている。また、CPU10およびDMA制御部30の間はペリフェラルバス60により接続されている。また、DMA制御部30とストリーム処理コプロセッサ40との間は制御線70により接続されている。
FIG. 1 is a diagram illustrating a configuration example of a stream processing apparatus as an example of a data processing apparatus according to an embodiment of the present invention. The stream processing apparatus includes a CPU (Central Processing Unit) 10, a
CPU10は、ストリーム処理装置の全体の処理を行うプロセッサである。このCPU10は、システムバス50を介してメモリ20にアクセスし、また、ペリフェラルバス60を介してDMA制御部30を制御する。また、CPU10は、ストリーム処理コプロセッサ40に接続し、このストリーム処理コプロセッサ40に対してコプロセッサ命令を発行することにより、ストリーム処理を実行させる。
The
メモリ20は、CPU10の作業領域を保持するメモリであり、例えば、SDRAM(Synchronous Dynamic Random Access Memory)などにより実現される。なお、メモリ20は、特許請求の範囲に記載のメモリの一例である。
The
DMA制御部30は、メモリ20との間のDMA転送を制御するコントローラである。このDMA制御部30は、ストリーム処理コプロセッサ40の制御レジスタ42に設定された開始アドレスおよび転送サイズを、制御線70を介して読み出して、その設定に従ってCPU10を介さずにメモリ20との間のDMA転送を行う。DMA制御部30は、内部に制御レジスタ31を備えており、CPU10からストリーム処理コプロセッサ40を介して、制御線70によりDMA転送を起動させるための起動ビットが制御レジスタ31に反映される。本発明の実施の形態では、メモリ20のデータがストリームデータとしてストリーム管理部100に転送されることを想定する。なお、DMA制御部30は、特許請求の範囲に記載のデータ転送回路の一例である。
The
ストリーム処理コプロセッサ40は、CPU10からのコプロセッサ命令に従って、ストリーム処理を行うコプロセッサである。このストリーム処理コプロセッサ40は、内部にシフトレジスタ41を備え、ストリーム管理部100から取得したストリームデータをシフトレジスタ41に保持する。また、このストリーム処理コプロセッサ40は、制御レジスタ42を備え、DMA転送のための開始アドレスおよび転送サイズを制御レジスタ42に保持する。この制御レジスタ42の内容は、制御線70を介してDMA制御部30によって参照できるようになっている。なお、ストリーム処理コプロセッサ40は、特許請求の範囲に記載の処理回路の一例である。
The
ストリーム管理部100は、DMA制御部30によってDMA転送されたストリームデータを一旦保持して、ストリーム処理コプロセッサ40に供給するものである。このストリーム管理部100は、内部にFIFOバッファ110を備え、DMA制御部30から転送されたストリームデータをFIFOバッファ110に保持する。
The
図2は、本発明の実施の形態におけるストリーム処理装置内の制御およびデータの流れを示すである。 FIG. 2 shows the flow of control and data in the stream processing apparatus according to the embodiment of the present invention.
CPU10は、ストリーム処理を行うためにコプロセッサ命令をストリーム処理コプロセッサ40に発行する。CPU10から発行されたコプロセッサ命令がストリームを参照する命令であれば、ストリーム処理コプロセッサ40は信号線193を介してストリーム要求をストリーム管理部100に出力する。ストリーム管理部100は、ストリーム処理コプロセッサ40からのストリーム要求があり、かつ、内部のFIFOバッファ110に空きがあれば、空きがなくなるまで、信号線103を介して転送要求をDMA制御部30に出力する。DMA制御部30は、メモリ20の転送元の開始アドレスおよび転送サイズが設定され、制御レジスタの起動ビットがセットされると転送可能状態となる。
The
DMA制御部30は、転送可能状態において、ストリーム管理部100から転送要求を受けると、信号線101を介してデータをストリーム管理部100にDMA転送する。ストリーム処理コプロセッサ40からのストリーム要求に対して、ストリーム管理部100は信号線191を介してストリーム処理コプロセッサ40にストリームデータを供給する。
When receiving a transfer request from the
図3は、本発明の実施の形態におけるストリーム処理コプロセッサ40内のシフトレジスタ41の動作例を示す図である。シフトレジスタ41は、「2W−1」ビット以上のシフトレジスタであり(Wは整数)、その中の有効なデータはLビットであるとする(Lは整数)。
FIG. 3 is a diagram illustrating an operation example of the
図3(a)のように、ストリーム処理を行う際に「L≧W」であれば、ストリーム処理コプロセッサ40はストリーム要求を出力することなく、シフトレジスタ41の先頭からストリームデータを参照して、ストリーム処理を実行する。シフトレジスタ41は、先頭からWビットのみが参照可能になっている。
As shown in FIG. 3A, if “L ≧ W” when performing stream processing, the
図3(b)のように、ストリーム処理を行う際に「L<W」であれば、ストリーム処理コプロセッサ40はストリーム要求をストリーム管理部100に出力する。そして、ストリーム処理コプロセッサ40は、ストリーム管理部100からWビットのデータを取得して、シフトレジスタ41における有効なデータの直後からWビットの位置に、取得したWビットのデータを書き込む。これにより、有効なデータのビット長Lは、「L+W」ビットに更新される。その後、ストリーム処理コプロセッサ40において、シフトレジスタ41の先頭からストリームデータが参照されて、ストリーム処理が実行される。
As shown in FIG. 3B, if “L <W” when performing stream processing, the
なお、ストリーム処理においてSビット(Sは整数)のシフトが発生した場合、シフトレジスタ41はSビットシフトされ、有効なデータのビット長Lは、「L−S」ビットに更新される。このようにして、ストリームデータはシフトレジスタ41からシーケンシャルに読み進められていく。
When a shift of S bits (S is an integer) occurs in the stream processing, the
図4は、本発明の実施の形態におけるストリーム管理部100の一構成例を示す図である。このストリーム管理部100は、FIFOバッファ110と、論理積回路121および123と、レジスタ122と、タイマー回路130と、タイムアウト検出回路140と、論理和回路151と、ダミーデータ供給回路160とを備えている。
FIG. 4 is a diagram illustrating a configuration example of the
FIFOバッファ110は、DMA制御部30から転送されたデータを保持する先入れ先出し(First-In First-Out)バッファである。このFIFOバッファ110は、Wビット幅のデータを複数語保持することができる。このFIFOバッファ110において、書込可能(WE:Write Enable)端子がアサートされると書込みデータ(WD:Write Data)端子から入力されたデータが保持される。また、読出可能(RE:Read Enable)端子がアサートされると、書込みデータ端子に入力された順に、読出しデータ(RD:Read Data)端子からデータが出力される。このFIFOバッファ110においてデータを保持する領域にデータが全くない場合には、エンプティ(EMPTY)端子がアサートされる。また、FIFOバッファ110においてデータを保持する領域に空きがない場合には、フル(FULL)端子がアサートされる。なお、FIFOバッファ110は、特許請求の範囲に記載のバッファの一例である。
The
論理積回路121は、ストリーム処理コプロセッサ40から信号線193を介してストリーム要求があり(DATA_REQ=1)、かつ、FIFOバッファ110が空でない(FIFO_EMPTY=0)場合、データ読出可能である旨を出力するものである。レジスタ122は、論理積回路121の出力を保持するレジスタであり、直前のサイクルにおいて論理積回路121がデータ読出可能である旨を出力する場合には、信号線192を介して有効なデータが出力される旨を示すとともに、FIFOバッファ110の読出可能端子をアサートしてFIFOバッファ110からのデータ読出しを指示する。これにより、FIFOバッファ110の読出しデータ端子からデータが出力されて信号線191に供給される。論理積回路123は、ストリーム処理コプロセッサ40から信号線193を介してストリーム要求があり(DATA_REQ=1)、かつ、FIFOバッファ110に空きがある(FIFO_FULL=0)場合、信号線103を介してDMA制御部30に対して転送要求を出力する(DMA_REQ=1)。
The AND
タイマー回路130は、DMA制御部30に対して転送要求が連続して出力されている時間を計数するタイマーである。このタイマー回路130は、レジスタ131と、加算器132と、セレクタ133および134とを備える。レジスタ131は、タイマー値を保持するレジスタである。加算器132は、レジスタ131の出力を「1」加算するものである。セレクタ133は、論理積回路123から転送要求が出力されている場合には加算器132の出力を選択し、転送要求が出力されていない場合にはレジスタ131の出力を選択する選択器である。セレクタ134は、タイムアウト検出回路140からタイマーリセット信号TMCNT_RSTがアサートされている場合には「0」を選択し、それ以外の場合にはセレクタ133の出力値を選択する選択器である。なお、タイマー回路130は、特許請求の範囲に記載のタイマー回路の一例である。
The timer circuit 130 is a timer that counts the time during which transfer requests are continuously output to the
タイムアウト検出回路140は、タイマー回路130のタイムアウトを検出するものである。このタイムアウト検出回路140は、比較器141および142と、セレクタ143と、論理積回路144と、レジスタ145と、論理和回路146とを備える。
The
比較器141は、第1のタイムアウト値TM1を基準としてタイマー回路130のタイムアウトを検出するものである。また、比較器142は、第2のタイムアウト値TM2を基準としてタイマー回路130のタイムアウトを検出するものである。本発明の実施の形態では、「TM1>TM2」であることを想定し、例えば、TM1は「0」より大きい値とし、TM2は「0」とする。すなわち、比較器141はタイマー回路130の値がTM1に達したことを検出し、比較器142はタイマー回路130の値が非ゼロになったことを検出することを想定する。
The
セレクタ143は、DMA制御部30からDMA転送終了信号DMA_ENDがアサートされている場合には比較器142の出力を選択し、それ以外の場合には比較器141の出力を選択する選択器である。このセレクタ143の出力は、タイムアウト信号TMOUTとして、論理積回路144および論理和回路146に供給される。
The
論理積回路144は、タイムアウト信号TMOUTがアサートされ、かつ、DMA制御部30からDMA転送中信号DMA_BSYがアサートされていないことを検出するものである。すなわち、セレクタ143の出力がタイムアウトである旨を示していても、DMA転送中信号がビジーを示している場合には、そのタイムアウト信号はマスクされる。レジスタ145は、論理積回路144の出力を保持するレジスタである。このレジスタ145の出力は、有効タイムアウト信号TMOUT_WEとして論理和回路146および論理和回路151に供給される。
The AND
論理和回路146は、タイマー回路130のリセット信号を出力するものであり、セレクタ143から出力されるタイムアウト信号TMOUT、DMA制御部30から出力されるDMA転送中信号DMA_BSY、または、レジスタ145から出力される有効タイムアウト信号TMOUT_WEの論理和を生成する。すなわち、タイムアウト信号TMOUT、DMA転送中信号DMA_BSY、または、有効タイムアウト信号TMOUT_WEの何れかがアサートされている場合にはタイマー回路130のリセット信号がアサートされる。
The OR
なお、タイムアウト検出回路140は、特許請求の範囲に記載のタイムアウト検出回路の一例である。
The
論理和回路151は、FIFOバッファ110に対して書込可能信号を出力するものである。この論理和回路151は、DMA制御部30から出力されるDMA転送有効信号DMA_ACK、または、レジスタ145から出力される有効タイムアウト信号TMOUT_WEの論理和を生成する。すなわち、DMA転送有効信号DMA_ACK、または、有効タイムアウト信号TMOUT_WEの何れかがアサートされている場合には、FIFOバッファ110の書込可能端子がアサートされる。
The OR
ダミーデータ供給回路160は、FIFOバッファ110に対して書込みデータを出力するものである。このダミーデータ供給回路160は、ダミーデータレジスタ161と、セレクタ162とを備える。ダミーデータレジスタ161は、FIFOバッファ110に供給されるダミーデータを保持するレジスタである。このダミーデータレジスタ161に保持されるダミーデータは任意の値とすることができるが、例えばWビットの「0」またはWビットの「1」であることが想定される。Wビットの「1」をダミーデータとすれば、ストリーム処理コプロセッサ40におけるエラー処理により異常を検出することが期待できるため、より望ましい。セレクタ162は、DMA制御部30から出力されるDMA転送有効信号DMA_ACKがアサートされている場合にはDMA制御部30から出力されるデータDMA_DATAを選択し、それ以外の場合にはダミーデータレジスタ161の保持内容を選択する選択器である。なお、ダミーデータ供給回路160は、特許請求の範囲に記載のダミーデータ供給回路の一例である。
The dummy
図5は、本発明の実施の形態におけるストリーム管理部100の信号の真理値表を示す図である。DMA転送中信号DMA_BSYが「0」、すなわちDMA転送中でない場合において、DMA転送終了信号DMA_ENDが「0」、すなわちDMA転送が終了していなければ、転送待ちの状態にあるものとして、第1のタイムアウト値TM1を基準してタイマー回路130のタイムアウトが検出される。つまり、第1のタイムアウト値TM1に達した時点で、ダミーデータレジスタ161に保持されたダミーデータがFIFOバッファ110に補充される。
FIG. 5 is a diagram showing a truth table of signals of the
これに対し、DMA転送中信号DMA_BSYが「0」、すなわちDMA転送中でない場合において、DMA転送終了信号DMA_ENDが「1」、すなわちDMA転送が終了していれば、転送完了後であるものとして、第2のタイムアウト値TM2を基準してタイマー回路130のタイムアウトが検出される。つまり、第1のタイムアウト値TM1よりも短い第2のタイムアウト値TM2を基準して速やかにタイムアウトとなって、ダミーデータレジスタ161に保持されたダミーデータがFIFOバッファ110に補充される。
On the other hand, if the DMA transfer end signal DMA_END is “1”, that is, if the DMA transfer is completed when the DMA transfer in progress signal DMA_BSY is “0”, that is, the DMA transfer is not in progress, A timeout of the timer circuit 130 is detected with reference to the second timeout value TM2. In other words, the
一方、DMA転送中信号DMA_BSYが「1」、すなわちDMA転送中である場合には、タイムアウト信号TMOUTの如何にかかわらず、有効タイムアウト信号TMOUT_WEはアサートされず、ダミーデータレジスタ161に保持されたダミーデータはFIFOバッファ110に補充されない。
On the other hand, when the DMA transfer in-progress signal DMA_BSY is “1”, that is, during the DMA transfer, the valid timeout signal TMOUT_WE is not asserted regardless of the timeout signal TMOUT, and the dummy data held in the dummy data register 161. Are not refilled into the
図6は、本発明の実施の形態におけるストリーム管理部100のタイミングの一例を示す図である。この例では、DMA転送中信号DMA_BSYが「0」であり、かつ、DMA転送終了信号DMA_ENDが「0」である場合を想定している。
FIG. 6 is a diagram illustrating an example of the timing of the
時刻T2においてストリーム処理コプロセッサ40からストリーム要求DATA_REQがされると、タイマー回路130はカウントアップを開始する。時刻Tiにおいてタイマー回路130の値が第1のタイムアウト値TM1に到達すると、タイムアウト信号TMOUTがアサートされ、タイマーリセット信号TMCNT_RSTがアサートされる。これにより、タイマー回路130の値はリセットされる。
When a stream request DATA_REQ is made from the
そして、時刻Ti+1では、有効タイムアウト信号TMOUT_WEがアサートされ、これにより、ダミーデータがFIFOバッファ110に補充される。すなわち、強制的にFIFOバッファ110にダミーデータを挿入することにより、デッドロックが解除される。
At time Ti + 1, the valid timeout signal TMOUT_WE is asserted, whereby dummy data is replenished to the
図7は、本発明の実施の形態におけるストリーム管理部100のタイミングの他の例を示す図である。この例では、DMA転送中信号DMA_BSYが「1」であり、かつ、DMA転送終了信号DMA_ENDが「0」である場合を想定している。
FIG. 7 is a diagram showing another example of the timing of the
時刻T2においてストリーム処理コプロセッサ40からストリーム要求DATA_REQがされると、タイマー回路130はカウントアップを開始する。しかし、DMA転送中信号DMA_BSYが「1」であるため、レジスタ145はマスクされる。そのため、時刻Ti+1においても、有効タイムアウト信号TMOUT_WEはアサートされず、ダミーデータはFIFOバッファ110に補充されない。
When a stream request DATA_REQ is made from the
図8は、本発明の実施の形態におけるストリーム管理部100のタイミングのさらに他の例を示す図である。この例では、DMA転送中信号DMA_BSYが「0」であり、かつ、DMA転送終了信号DMA_ENDが「1」である場合を想定している。
FIG. 8 is a diagram showing still another example of the timing of the
時刻T2においてストリーム処理コプロセッサ40からストリーム要求DATA_REQがされると、タイマー回路130はカウントアップを開始する。DMA転送終了信号DMA_ENDが「1」であるため、セレクタ143において比較器142の出力が選択される。この例では、比較器142はタイマー回路130の値が非ゼロである旨を出力するものとする。したがって、時刻T3ではタイムアウト信号TMOUTがアサートされ、タイマーリセット信号TMCNT_RSTがアサートされる。これにより、タイマー回路130の値はリセットされる。
When a stream request DATA_REQ is made from the
そして、時刻T4では、有効タイムアウト信号TMOUT_WEがアサートされ、これにより、ダミーデータがFIFOバッファ110に補充される。すなわち、DMA転送が完了しており、ストリーム要求によってデータが送られることがないため、直ちにダミーデータが挿入され、余計な待ちを回避することができる。
At time T4, the valid timeout signal TMOUT_WE is asserted, whereby dummy data is replenished to the
図9は、ストリーム処理装置の制御手順を示す図である。従来のストリーム処理装置においては、まず、DMA制御部の制御レジスタに対して起動ビットが設定され(ステップS901)、DMA制御部の起動が確認(910)された後に、ストリーム処理コプロセッサに対してストリーム参照命令が発行される(ステップS904)。すなわち、CPUにおいてDMA制御部の起動を確認(910)するために、DMA制御部の制御レジスタにおける起動ビットが参照され(ステップS902)、その起動ビットが起動済であることを示していなければ、起動済になるまで起動ビットの参照を繰り返す(ステップS903)。この繰り返しにおいて無限ループとなる可能性もあることから、これを回避するためにソフトウェアのカウンタによりタイムアウトを検出する必要もある。 FIG. 9 is a diagram illustrating a control procedure of the stream processing apparatus. In the conventional stream processing apparatus, first, an activation bit is set in the control register of the DMA control unit (step S901), and after activation of the DMA control unit is confirmed (910), the stream processing coprocessor is A stream reference instruction is issued (step S904). That is, in order to confirm (910) the activation of the DMA control unit in the CPU, the activation bit in the control register of the DMA control unit is referred to (step S902), and if the activation bit does not indicate that it has been activated, The reference of the activation bit is repeated until the activation is completed (step S903). Since there is a possibility of an infinite loop in this repetition, it is necessary to detect a timeout by a software counter in order to avoid this.
これに対し、本発明の実施の形態では、DMA制御部の起動の確認(910)は不要であり、DMA制御部30の制御レジスタ31に対して起動ビットが設定された後(ステップS901)、速やかにストリーム処理コプロセッサ40に対してストリーム参照命令を発行することができる(ステップS904)。すなわち、デッドロックの発生はストリーム管理部100により回避される。
On the other hand, in the embodiment of the present invention, confirmation of activation of the DMA control unit (910) is unnecessary, and after the activation bit is set in the control register 31 of the DMA control unit 30 (step S901), A stream reference command can be issued immediately to the stream processing coprocessor 40 (step S904). That is, the occurrence of deadlock is avoided by the
このように、本発明の実施の形態によれば、タイマー回路130におけるタイムアウトをタイムアウト検出回路140により検出することにより、ダミーデータレジスタ161の保持内容をFIFOバッファ110に補充することができ、これによりデッドロックを解消することができる。また、DMA転送完了後(DMA_END=1)には直ちにダミーデータが挿入され、余計な待ちを回避することができる。一方、DMA転送中(DMA_BSY=1)にはタイムアウト信号TMOUTの如何にかかわらず、ダミーデータの挿入を抑止することができる。
As described above, according to the embodiment of the present invention, the timeout content in the dummy data register 161 can be supplemented to the
なお、本発明の実施の形態では、制御線70を介してDMA転送に関する情報が参照されることを想定したが、本発明はこれに限られるものではなく、例えばペリフェラルバス60を介してこれらの情報をやりとりするようにしてもよい。
In the embodiment of the present invention, it is assumed that information related to DMA transfer is referred to via the
また、本発明の実施の形態は本発明を具現化するための一例を示したものであり、以下に示すように特許請求の範囲における発明特定事項とそれぞれ対応関係を有するが、これに限定されるものではなく本発明の要旨を逸脱しない範囲において種々の変形を施すことができる。 Further, the embodiment of the present invention shows an example for embodying the present invention, and has a corresponding relationship with the invention specific matter in the claims as shown below, but is not limited thereto. However, various modifications can be made without departing from the scope of the present invention.
また、本発明の実施の形態において説明した処理手順は、これら一連の手順を有する方法として捉えてもよく、また、これら一連の手順をコンピュータに実行させるためのプログラム乃至そのプログラムを記憶する記録媒体として捉えてもよい。この記録媒体として、例えば、CD(Compact Disc)、MD(MiniDisc)、DVD(Digital Versatile Disk)、メモリカード(memory card)、ブルーレイディスク(Blu-ray Disc(登録商標))等の記録媒体を用いることができる。 The processing procedure described in the embodiment of the present invention may be regarded as a method having a series of these procedures, and a program for causing a computer to execute the series of procedures or a recording medium storing the program May be taken as As this recording medium, for example, a recording medium such as a CD (Compact Disc), an MD (MiniDisc), a DVD (Digital Versatile Disk), a memory card, or a Blu-ray Disc (registered trademark) is used. be able to.
10 CPU
20 メモリ
30 DMA制御部
31 制御レジスタ
40 ストリーム処理コプロセッサ
41 シフトレジスタ
42 制御レジスタ
50 システムバス
60 ペリフェラルバス
100 ストリーム管理部
110 FIFOバッファ
121 論理積回路
122、131、145 レジスタ
123 論理積回路
130 タイマー回路
132 加算器
133、134、143、162 セレクタ
140 タイムアウト検出回路
141、142 比較器
144 論理積回路
146、151 論理和回路
160 ダミーデータ供給回路
161 ダミーデータレジスタ
10 CPU
DESCRIPTION OF
Claims (7)
前記バッファへのデータの転送を前記データ転送回路に対して連続して要求している時間を計数するタイマー回路と、
前記タイマー回路によって計数された時間が所定の時間に達したか否かを判断して前記所定の時間に達するとタイムアウトを検出するタイムアウト検出回路と、
前記タイムアウトが検出された場合には前記データ転送回路からのデータに代えてダミーデータを前記バッファへ供給するダミーデータ供給回路と
を具備するバッファ制御回路。 A data transfer request circuit that requests the data transfer circuit to transfer data to the buffer;
A timer circuit that counts the time for which the data transfer circuit is continuously requested to transfer data to the buffer;
A time-out detection circuit that determines whether a time counted by the timer circuit has reached a predetermined time and detects a time-out when the predetermined time is reached;
A buffer control circuit comprising: a dummy data supply circuit for supplying dummy data to the buffer instead of data from the data transfer circuit when the timeout is detected;
請求項1記載のバッファ制御回路。 The time-out detection circuit has a shorter time when the data transfer circuit is in a data transfer completion state with respect to the request than when the data transfer circuit is not in a data transfer completion state with respect to the request. 2. The buffer control circuit according to claim 1, wherein it is determined whether or not the predetermined time has been reached as the predetermined time.
請求項2記載のバッファ制御回路。 3. The buffer control according to claim 2, wherein the time-out detection circuit detects the time-out when the time counted by the timer circuit becomes non-zero when the data transfer circuit is in a data transfer completion state with respect to the request. circuit.
請求項1記載のバッファ制御回路。 The buffer control circuit according to claim 1, wherein the dummy data supply circuit does not supply the dummy data to the buffer while the data transfer circuit is in a busy state even when the timeout is detected.
前記バッファへのデータの転送をデータ転送回路に対して要求するデータ転送要求回路と、
前記バッファへのデータの転送を前記データ転送回路に対して連続して要求している時間を計数するタイマー回路と、
前記タイマー回路によって計数された時間が所定の時間に達したか否かを判断して前記所定の時間に達するとタイムアウトを検出するタイムアウト検出回路と、
前記タイムアウトが検出された場合には前記データ転送回路からのデータに代えてダミーデータを前記バッファへ供給するダミーデータ供給回路と
を具備するバッファ回路。 A buffer to hold the data,
A data transfer request circuit for requesting the data transfer circuit to transfer data to the buffer;
A timer circuit that counts the time for which the data transfer circuit is continuously requested to transfer data to the buffer;
A time-out detection circuit that determines whether a time counted by the timer circuit has reached a predetermined time and detects a time-out when the predetermined time is reached;
A buffer circuit comprising: a dummy data supply circuit for supplying dummy data to the buffer instead of data from the data transfer circuit when the timeout is detected;
データを保持するバッファと、
前記バッファからデータを取得して所定のデータ処理を行う処理回路と、
前記バッファに対してデータを前記メモリから転送するデータ転送回路と、
前記バッファへのデータの転送を前記データ転送回路に対して要求するデータ転送要求回路と、
前記バッファへのデータの転送を前記データ転送回路に対して連続して要求している時間を計数するタイマー回路と、
前記タイマー回路によって計数された時間が所定の時間に達したか否かを判断して前記所定の時間に達するとタイムアウトを検出するタイムアウト検出回路と、
前記タイムアウトが検出された場合には前記データ転送回路からのデータに代えてダミーデータを前記バッファへ供給するダミーデータ供給回路と
を具備するデータ処理装置。 Memory,
A buffer to hold the data,
A processing circuit for obtaining data from the buffer and performing predetermined data processing;
A data transfer circuit for transferring data from the memory to the buffer;
A data transfer request circuit for requesting the data transfer circuit to transfer data to the buffer;
A timer circuit that counts the time for which the data transfer circuit is continuously requested to transfer data to the buffer;
A time-out detection circuit that determines whether a time counted by the timer circuit has reached a predetermined time and detects a time-out when the predetermined time is reached;
A data processing device comprising: a dummy data supply circuit that supplies dummy data to the buffer instead of data from the data transfer circuit when the timeout is detected.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008119403A JP2009271610A (en) | 2008-04-30 | 2008-04-30 | Buffer control circuit, buffer circuit and data processor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008119403A JP2009271610A (en) | 2008-04-30 | 2008-04-30 | Buffer control circuit, buffer circuit and data processor |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2009271610A true JP2009271610A (en) | 2009-11-19 |
Family
ID=41438129
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008119403A Pending JP2009271610A (en) | 2008-04-30 | 2008-04-30 | Buffer control circuit, buffer circuit and data processor |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2009271610A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120075262A1 (en) * | 2010-09-28 | 2012-03-29 | Kyoung Man Kim | Under-run compensation circuit, method thereof, and apparatuses having the same |
CN102567258A (en) * | 2011-12-29 | 2012-07-11 | 中国科学院自动化研究所 | Multi-dimensional DMA (direct memory access) transmitting device and method |
US9405549B2 (en) | 2011-03-04 | 2016-08-02 | Nec Corporation | Deadlock avoidance method and deadlock avoidance mechanism |
-
2008
- 2008-04-30 JP JP2008119403A patent/JP2009271610A/en active Pending
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120075262A1 (en) * | 2010-09-28 | 2012-03-29 | Kyoung Man Kim | Under-run compensation circuit, method thereof, and apparatuses having the same |
CN102419964A (en) * | 2010-09-28 | 2012-04-18 | 三星电子株式会社 | Under-run compensation circuit, method thereof, and apparatuses having the same |
US9405549B2 (en) | 2011-03-04 | 2016-08-02 | Nec Corporation | Deadlock avoidance method and deadlock avoidance mechanism |
CN102567258A (en) * | 2011-12-29 | 2012-07-11 | 中国科学院自动化研究所 | Multi-dimensional DMA (direct memory access) transmitting device and method |
CN102567258B (en) * | 2011-12-29 | 2014-08-27 | 中国科学院自动化研究所 | Multi-dimensional DMA (direct memory access) transmitting device and method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7263572B2 (en) | Bus bridge and data transfer method | |
JP2004171209A (en) | Shared memory data transfer device | |
JP2010027032A (en) | Fifo device and method of storing data in fifo buffer | |
JP2006195714A (en) | Resource management device | |
JP2010278798A (en) | Asynchronous interface circuit, and asynchronous data transfer method | |
TWI326839B (en) | Transmission device performing dma transmission, semiconductor integrated circuit device and data transmission method | |
JP2009271610A (en) | Buffer control circuit, buffer circuit and data processor | |
KR101022472B1 (en) | Method for using bus efficiently | |
WO2015165055A1 (en) | Data storage method, memory controller and central processing unit | |
JP2005267148A (en) | Memory controller | |
JP2007310735A (en) | Direct memory access controller | |
JP2002024156A (en) | Dma controller and transfer method therefor | |
JP2005165508A (en) | Direct memory access controller | |
JP2007249667A (en) | Data transfer device, and data transfer system | |
JP2008108126A (en) | Data transfer control device and bus access arbitration system therefor | |
JP2010140440A (en) | Bus arbitration device | |
JP2006059303A (en) | Computer system | |
JP5648472B2 (en) | Semiconductor device and control method | |
JP4583981B2 (en) | Image processing device | |
JP2000003332A (en) | Bi-directional bus size conversion circuit | |
JP2007011884A (en) | Data transfer unit | |
JP2009169501A (en) | Data transfer device | |
JP2010049462A (en) | Data processor | |
JP2010262526A (en) | Memory control device | |
JP2008198119A (en) | Data transfer device, data transfer system, and data transfer method |