JP2009059276A - Data processing apparatus and program - Google Patents
Data processing apparatus and program Download PDFInfo
- Publication number
- JP2009059276A JP2009059276A JP2007227678A JP2007227678A JP2009059276A JP 2009059276 A JP2009059276 A JP 2009059276A JP 2007227678 A JP2007227678 A JP 2007227678A JP 2007227678 A JP2007227678 A JP 2007227678A JP 2009059276 A JP2009059276 A JP 2009059276A
- Authority
- JP
- Japan
- Prior art keywords
- transfer
- dma
- transfer information
- data
- information
- 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 an information processing apparatus and a program.
近年、データの転送を高速に行なうため、中央演算処理装置(CPU)を介さずにデータの転送を行なうダイレクトメモリアクセス(DMA)転送の技術が様々な情報処理装置に広く採用されている。 In recent years, in order to transfer data at high speed, a direct memory access (DMA) transfer technique for transferring data without using a central processing unit (CPU) has been widely adopted in various information processing apparatuses.
DMA転送を効率的に行なうために、画像形成装置において、メモリ上のイメージデータをDMAにより高速に印刷エンジンに転送するために、各ページのイメージデータを複数バンドに分割し、各バンドデータを1回のDMAで転送すると共に、CPUがDMA転送毎に連続DMA転送を行なうか否かを示す転送フラグを設定して連続転送を制御し、連続転送する場合には、DMA動作中に次のバンドのDMAパラメータ(アドレス、サイズ等)を設定することで、複数バンドのDMAがインターバルなく連続的に実行されるような技術が提案されている(例えば、特許文献1参照)。 In order to efficiently perform the DMA transfer, in the image forming apparatus, in order to transfer the image data on the memory to the print engine at a high speed by DMA, the image data of each page is divided into a plurality of bands, and each band data is 1 In addition to transferring data at the same time, the CPU sets a transfer flag indicating whether or not to perform continuous DMA transfer for each DMA transfer and controls continuous transfer. By setting the DMA parameters (address, size, etc.), a technique has been proposed in which DMAs of a plurality of bands are continuously executed without intervals (see, for example, Patent Document 1).
また、画像データを複数に分割し、それぞれの分割部分ごとのディスクリプタを作成し、そのディスクリプタにDMAコントローラの行う動作を指示する指示ビットを含めることで、CPUの介在なしで、分割DMA転送を連続的に行なうことができる装置も提案されている(例えば、特許文献2参照)。
本発明は、転送情報を複数連ねて構成された転送情報群に基づいて転送対象のデータのDMA転送を行なうための情報処理装置およびプログラムであって、転送情報群を構成する転送情報の数を常に一定とする場合に比べて、DMA転送を高速且つ効率よく行なうことができる情報処理装置およびプログラムを提供することを目的とする。 The present invention relates to an information processing apparatus and program for performing DMA transfer of data to be transferred based on a transfer information group configured by connecting a plurality of transfer information, wherein the number of transfer information constituting the transfer information group is determined. It is an object of the present invention to provide an information processing apparatus and program capable of performing DMA transfer at high speed and efficiency as compared with the case where the constant is always maintained.
請求項1の発明の情報処理装置は、中央演算処理装置(CPU)を介在させないダイレクトメモリアクセス(DMA)転送に必要な情報を含む単位転送量毎の転送情報を複数連ねて構成した転送情報群に基づいて転送対象のデータを前記単位転送量毎にDMA転送する転送手段と、データ量が予め定められた基準データを前記転送情報群を構成する転送情報の個数を変化させながら前記転送手段によってDMA転送したときの転送速度に基づいて前記転送情報群を構成する転送情報の数を決定する決定手段と、転送対象のデータをDMA転送するときに、前記決定手段で決定された数の転送情報を連ねて構成した転送情報群を作成する作成手段と、を含んで構成されている。
The information processing apparatus according to
請求項2の発明は、請求項1に記載の情報処理装置において、前記決定手段で決定された転送情報の数を基準データのデータ量に対応付けて記憶した記憶手段を更に備え、前記作成手段は、転送対象のデータをDMA転送するときに、該転送対象のデータ量に応じて前記記憶手段に記憶された数を読み出し、該読み出した数の転送情報を連ねて構成した転送情報群を作成する。
The invention according to
請求項3の発明は、請求項1または2に記載の情報処理装置において、前記作成手段は、前記転送対象のデータをDMA転送するために複数の転送情報群を作成する場合に、先頭の転送情報群または先頭から所定数までの転送情報群については、前記決定手段で決定された数よりも少ない数の転送情報で構成された転送情報群を作成し、それ以降の転送情報群については、前記決定手段で決定された数の転送情報を構成した転送情報群を作成する。 According to a third aspect of the present invention, in the information processing apparatus according to the first or second aspect, when the creation unit creates a plurality of transfer information groups for DMA transfer of the transfer target data, For the information group or the transfer information group from the beginning to a predetermined number, create a transfer information group composed of a smaller number of transfer information than the number determined by the determining means, and for subsequent transfer information groups, A transfer information group comprising the number of transfer information determined by the determining means is created.
請求項4の発明は、請求項1〜3の何れか1項に記載の情報処理装置において、前記作成手段は、前記転送対象のデータをDMA転送するために複数の転送情報群を作成する場合に、前記転送手段で実行中のDMA転送が終了するまでに該実行中のDMA転送以降に行なわれるDMA転送のための転送情報群を作成して作成順に転送情報用記憶手段に記憶し、前記転送手段は、前記転送情報用記憶手段から前記作成順に転送情報群を読み出してDMA転送を行なう。 According to a fourth aspect of the present invention, in the information processing apparatus according to any one of the first to third aspects, the creation unit creates a plurality of transfer information groups in order to DMA transfer the data to be transferred. In addition, a transfer information group for DMA transfer performed after the DMA transfer being executed is completed before the DMA transfer being executed by the transfer means is completed, and stored in the transfer information storage means in the order of creation, The transfer means reads the transfer information group from the transfer information storage means in the order of creation and performs DMA transfer.
請求項5の発明は、請求項4に記載の情報処理装置において、前記作成手段は、前記転送情報群の作成をCPU使用率またはCPU占有時間が所定値を超えていない場合に行なう。 According to a fifth aspect of the present invention, in the information processing apparatus according to the fourth aspect, the creation unit creates the transfer information group when the CPU usage rate or the CPU occupation time does not exceed a predetermined value.
請求項6の発明は、請求項5に記載の情報処理装置において、前記作成手段は、前記転送情報用記憶手段に未読の転送情報群が1つも記憶されていない場合には、前記CPU使用率またはCPU占有時間が所定値を超えている場合であっても実行中のDMA転送以降に行なわれるDMA転送のための転送情報群を作成する。 According to a sixth aspect of the present invention, in the information processing apparatus according to the fifth aspect, when the creation means stores no unread transfer information group in the transfer information storage means, the CPU usage rate Alternatively, even if the CPU occupation time exceeds a predetermined value, a transfer information group for DMA transfer performed after the DMA transfer being executed is created.
請求項7の発明のプログラムは、中央演算処理装置(CPU)を介在させないダイレクトメモリアクセス(DMA)転送に必要な情報を含む単位転送量毎の転送情報を複数連ねて構成した転送情報群に基づいて転送対象のデータを前記単位転送量毎にDMA転送する転送手段が設けられたコンピュータを、データ量が予め定められた基準データを前記転送情報群を構成する転送情報の個数を変化させながら前記転送手段によってDMA転送したときの転送速度に基づいて前記転送情報群を構成する転送情報の数を決定する決定手段、および転送対象のデータをDMA転送するときに、前記決定手段で決定された数の転送情報を連ねて構成した転送情報群を作成する作成手段、として機能させるためのプログラムである。 A program according to a seventh aspect of the invention is based on a transfer information group configured by connecting a plurality of pieces of transfer information for each unit transfer amount including information necessary for direct memory access (DMA) transfer without interposing a central processing unit (CPU). A computer provided with transfer means for DMA-transferring the data to be transferred for each unit transfer amount, while changing the number of transfer information constituting the transfer information group from reference data having a predetermined data amount. A determining unit that determines the number of transfer information constituting the transfer information group based on a transfer rate when the DMA transfer is performed by the transfer unit; and a number determined by the determining unit when the data to be transferred is DMA transferred. It is a program for functioning as a creation means for creating a transfer information group configured by linking the transfer information.
請求項1記載の発明によれば、転送情報群を構成する転送情報の数を常に一定とする場合に比べて、DMA転送を高速且つ効率よく行なうことができる、という効果が得られる。 According to the first aspect of the present invention, it is possible to obtain an effect that the DMA transfer can be performed at high speed and efficiently compared with the case where the number of transfer information constituting the transfer information group is always constant.
請求項2記載の発明によれば、迅速に転送情報群を作成することができる、という効果が得られる。 According to the second aspect of the present invention, there is an effect that a transfer information group can be created quickly.
請求項3記載の発明によれば、転送手段のDMA転送開始を早めることができる、という効果が得られる。 According to the third aspect of the invention, the effect that the DMA transfer start of the transfer means can be accelerated can be obtained.
請求項4記載の発明によれば、DMAの転送開始前に全ての転送情報群を作成する場合に比べてDMA転送にかかる時間を短縮することができる、という効果が得られる。 According to the fourth aspect of the invention, it is possible to reduce the time required for DMA transfer compared to the case where all transfer information groups are created before the start of DMA transfer.
請求項5記載の発明によれば、CPUの負荷がシステム全体でみた場合に集中しないよう効率よくCPUを使用することができ、これにより他のモジュールの性能低下を招くことなくDMA転送できる、という効果が得られる。 According to the fifth aspect of the present invention, the CPU can be used efficiently so that the CPU load is not concentrated when the entire system is viewed, thereby enabling the DMA transfer without causing the performance degradation of other modules. An effect is obtained.
請求項6記載の発明によれば、DMA転送が途切れることを防止することができる、という効果が得られる。 According to the sixth aspect of the invention, it is possible to prevent the DMA transfer from being interrupted.
請求項7記載の発明によれば、転送情報群を構成する転送情報の数を常に一定とする場合に比べて、DMA転送を高速且つ効率よく行なうことができる、という効果が得られる。 According to the seventh aspect of the present invention, it is possible to obtain an effect that the DMA transfer can be performed at high speed and efficiently as compared with the case where the number of transfer information constituting the transfer information group is always constant.
以下、図面を参照して本発明の実施の形態を詳細に説明する。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
図1は、本発明の情報処理装置に係る実施の形態としての情報処理部を含む画像処理システム10の構成例を示す図である。
FIG. 1 is a diagram showing a configuration example of an
画像処理システム10は、マザーボード12及びコントローラボード14を備えた情報処理部13、画像入力部16、画像出力部18、コントローラ20、及びLCD(液晶ディスプレイ)22を備えている。
The
マザーボード12は、CPU(中央演算処理装置)24および主記憶としてのメモリ28を備えている。CPU24及びメモリ28はハブ26を介して専用のバスにより接続されている。このメモリ28には、画像出力部18で出力(印刷)する画像データや画像入力部16で読み取った画像データを格納するための領域があり、該画像データは後述するコントローラボード14に設けられたメモリ44との間でCPU24の介在無しにDMA(ダイレクトメモリアクセス)転送される。
The
また、ハブ26には、マザーボード12の外部に設けられたLCD22が接続されている。LCD22は、表示面にタッチパネルを有する液晶表示装置であり、ユーザインタフェースとして機能する。
The
また、専用のバスを接続するためのハブ26は、汎用バスを接続するためのハブ30と接続されている。ハブ30にはHDD(ハードディスク装置)32とI/Oポート34とが汎用バスを介して接続されている。HDD32には、CPU24が実行するプログラムや各種データが記憶されている。I/Oポート34は、入出力インタフェースとして機能し、画像処理システム10の周辺機器などが接続される。
A
なお、CPU24が実行するプログラムや各種データを記録する記録媒体は、HDDに限定されず、不図示のCD−ROMやDVDディスク、光磁気ディスクやICカード、あるいはROM等であってもよいし、電気通信回線上の搬送波のような伝送媒体であってもよく、特に限定されない。
The recording medium for recording the program executed by the
マザーボード12には汎用バスのインタフェース36が設けられ、同じくコントローラボード14に設けられた汎用バスのインタフェース38と接続されている。
The
コントローラボード14は、バスブリッジ40、メモリ44、論理回路46、CPU48、及び画像処理回路50を備えている。バスブリッジ40、メモリ44、CPU48、及び画像処理回路50は、論理回路46に接続され、論理回路46を介して互いにデータのやりとりを行なう。論理回路46は、データ転送回路としてプログラムされた回路であるが、単にデータを受け渡すのみでありデータ転送の制御を行なうわけではない。画像処理回路50は、入力された画像データに所定の画像処理を施す回路である。
The
バスブリッジ40は、汎用バスを介してインタフェース38に接続されると共に、論理回路46に接続されている。バスブリッジ40は、汎用バス同士のブリッジ機能やバスマスタ機能を備えている。このバスマスタ機能は、コントローラボード14上のCPU48を介さずにメモリ44と画像処理回路50との間でデータのやりとりを行なうための機能である。具体的には、コントローラボード14では、画像出力部18による画像出力時には、画像データがメモリ44から論理回路46を介して画像処理回路50へDMA転送され、画像入力部16によって画像が読み込まれた場合には、該読み込まれて得られた画像データが画像処理回路50から論理回路46を介してメモリ44へDMA転送される。
The
一方、マザーボード12上のCPU24を介さずに、マザーボード12上のメモリ28とコントローラボード14上のメモリ44との間でデータの転送を行なうDMA機能は、上記バスブリッジ40のバスマスタ機能とは別に、バスブリッジ40に設けられたDMAC(DMAコントローラ)42により実現される。DMAC42は、飛び飛びのアドレスに対して、連続してデータを転送できるスキャッタギャザー機能が搭載された回路である。DMAC42の詳細な動作については後述する。
On the other hand, the DMA function for transferring data between the
コントローラボード14に設けられているコネクタ52は、画像入力部16及び画像出力部18を制御する制御機構を備えたコントローラ20に設けられているコネクタ56に接続されている。また、コントローラボード14のコネクタ52は、前述の画像処理回路50に接続されている。画像処理回路50で画像処理が施される画像データは、コネクタ52及びコネクタ56を介して送受信される。
The
また、コントローラボード14にはコネクタ52とは別のコネクタ54が設けられている。このコネクタ54は、論理回路46に直接接続されると共に、コントローラ20に設けられているコネクタ58と接続されている。コントローラ20とコントローラボード14との間で制御データやメッセージの送受信は、これらコネクタ54、コネクタ58を介して行なわれる。
The
ここで、DMAC42の機能について説明する。画像処理システム10では、データ量の多い画像データを取り扱う。従って、システム内で画像データを転送する場合には、CPU24を介在させないDMA転送が用いられる。DMAC42は、CPU24により作成されたディスクリプタに基づいてDMA転送を行なう。
Here, the function of the
なお、ディスクリプタとは、DMA転送のために必要な情報を含む転送情報をいう。CPU24は、ディスクリプタを予め定められた単位転送量毎に作成し、該作成したディスクリプタを複数連ねてディスクリプタリストを作成する。本実施の形態では、ディスクリプタリストはメモリ28に設けられたディスクリプタ格納領域に格納されると共にその格納アドレスはFIFO方式のディスクリプタリスト管理キューに登録される。なお、ディスクリプタリストの格納領域は、メモリ28に限定されず、コントローラボード14のメモリ44であってもよいし特に限定されない。
A descriptor refers to transfer information including information necessary for DMA transfer. The
CPU24は、ディスクリプタリスト管理キューに登録されたアドレスをDMAC42にセットしDMAC42を起動する、これによりDMAC42は、該セットされたアドレスに格納されているディスクリプタリストから1つ1つ順次ディスクリプタを読み込み、読み込んだディスクリプタに従って連続的にDMA転送を実行する。
The
1つのディスクリプタリストに連ねられたディスクリプタの全てについてDMA転送が完了すると、CPU24の割り込みが発生する。このとき、CPU24はディスクリプタリスト管理キューから次のディスクリプタリストのアドレスを読み出してDMAC42にセットする。そして、該セットされたアドレスのディスクリプタリストに連ねられたディスクリプタが順次読み込まれて連続的にDMA転送が行なわれる。この繰り返しにより、最終的に転送対象の画像データの全てがDMA転送される。
When the DMA transfer is completed for all the descriptors linked to one descriptor list, an interrupt of the
図2は、仮想記憶方式を採用したシステムにおいてDMAC42により読み込まれるディスクリプタリストの一例を示す図である。
FIG. 2 is a diagram showing an example of a descriptor list read by the
マザーボード12のメモリ28は仮想記憶方式によりメモリ管理されている。図2(A)に示すように、物理的には不連続な物理アドレス領域が、連続する仮想アドレス領域にマッピングされて管理される。実際に記憶されているデータにアクセスする場合には、仮想アドレス領域の連続したアドレス範囲が、アドレス変換テーブル等に従って対応する物理アドレス範囲に変換されてアクセスされる。仮想アドレスにマッピングできる物理メモリの最小単位をページというが、CPU24は、このページ単位で物理的に分散しているデータのアドレスを調べ、各々についてディスクリプタを作成する。
The
図2(B)に示すように、本実施の形態のディスクリプタは、次ディスクリプタアドレス、転送データ量、転送元アドレス、及び転送先アドレスの情報を含んで構成されている。 As shown in FIG. 2B, the descriptor according to the present embodiment includes information on the next descriptor address, transfer data amount, transfer source address, and transfer destination address.
「次ディスクリプタアドレス」は、ディスクリプタリストに連ねられた複数のディスクリプタの中で、そのディスクリプタの次にDMAC42により読み込まれるべきディスクリプタのアドレスを示すデータである。なお、そのディスクリプタがディスクリプタリストの一番最後に読み込まれるディスクリプタである場合には、次ディスクリプタアドレスの領域には、ディスクリプタリストの最後のディスクリプタであることを示すデータが格納される。この次ディスクリプタアドレスにより、物理的に不連続な領域に格納されたディスクリプタが連続的に読み出されてDMA転送される。
“Next descriptor address” is data indicating an address of a descriptor to be read by the
また、「転送データ量」は、そのディスクリプタによってDMA転送するデータのサイズを示すデータである。「転送元アドレス」は、転送対象のデータが格納されているメモリのアドレスを示すデータである。「転送先アドレス」は、転送元アドレスから転送データ量だけ読み出したデータを書き込むアドレスを示すデータである。 The “transfer data amount” is data indicating the size of data to be DMA transferred by the descriptor. The “transfer source address” is data indicating an address of a memory in which data to be transferred is stored. The “transfer destination address” is data indicating an address at which data read from the transfer source address by the transfer data amount is written.
なお、本実施の形態において、個々のディスクリプタで転送可能なデータ量は、ページサイズを最大とし、各ディスクリプタの「転送データ量」はページサイズ以下の固定値(単位転送量)とする。これにより、ディスクリプタリストを構成するディスクリプタの数と転送時間とが比例関係になる。以下、各ディスクリプタリストを構成するディスクリプタの数を「ブロック数」と呼称する。 In the present embodiment, the data amount that can be transferred by each descriptor has a maximum page size, and the “transfer data amount” of each descriptor is a fixed value (unit transfer amount) equal to or smaller than the page size. As a result, the number of descriptors constituting the descriptor list and the transfer time are in a proportional relationship. Hereinafter, the number of descriptors constituting each descriptor list is referred to as “number of blocks”.
図3は、ディスクリプタリストを管理するディスクリプタリスト管理キューの構造を説明する説明図である。ディスクリプタリスト管理キューは、ディスクリプタリストが格納されたアドレス(より詳述すると、ディスクリプタリストを構成する複数のディスクリプタのうち先頭のディスクリプタが格納されたアドレス。)を示すディスクリプタリストポインタをリスト構造にして連ねて構成したバッファである。また、CPU24の所定のレジスタ(あるいはメモリの所定領域等)には、ディスクリプタリスト管理キューにおける先頭のディスクリプタリストポインタを指すディスクリプタリスト管理キューポインタが格納される。ディスクリプタリスト管理キューはFIFO方式であるため、CPU24が先頭のディスクリプタリストポインタを読み出したときには、ディスクリプタリスト管理キューポインタが次のディスクリプタリストポインタを指すように書き変えられる。
FIG. 3 is an explanatory diagram for explaining the structure of the descriptor list management queue for managing the descriptor list. In the descriptor list management queue, descriptor list pointers indicating addresses where descriptor lists are stored (more specifically, addresses where the first descriptor among the plurality of descriptors constituting the descriptor list are stored) are linked in a list structure. This is a buffer configured. Further, a predetermined register (or a predetermined area of the memory) of the
また、CPU24は、新たにディスクリプタリストを作成して所定の格納領域に格納すると、ディスクリプタリスト管理キューの最後尾に該作成したディスクリプタリストのアドレスを示すディスクリプタリストポインタを追加する。これにより、各ディスクリプタリストのアドレスが作成順に登録される。
In addition, when a new descriptor list is created and stored in a predetermined storage area, the
なお、ディスクリプタリスト管理キューにディスクリプタリストが1つも登録されていない場合には、ディスクリプタリスト管理キューポインタはNULLとなる。 When no descriptor list is registered in the descriptor list management queue, the descriptor list management queue pointer is NULL.
DMA転送を実行する場合には、CPU24は、ディスクリプタリスト管理キューポインタが指す先頭のディスクリプタリストポインタをDMAC42にセットしてDMAC42にDMA転送を開始させ、該ディスクリプタリストポインタが示すディスクリプタリストに基づいてDMA転送を行なわせる。DMA転送は、1つのディスクリプタリストのDMA転送が終了するまでCPU24の割り込み無しで連続的に行なわれる。一方、CPU24は、DMAC42によるDMA転送中、所定の作成条件を満たす範囲内で、次のディスクリプタリストやそれ以降のディスクリプタリストを先行して作成してディスクリプタリスト管理キューに登録する。
When executing the DMA transfer, the
1つのディスクリプタリストによるDMA転送が終了すると、その時点でCPU24の割り込みが発生する。CPU24は、ディスクリプタリスト管理キューポインタが指す次のディスクリプタリストポインタをDMAC42にセットしてDMA転送させる。これにより、ディスクリプタリスト管理キューに登録された順にディスクリプタリストが読み出されてDMA転送が行なわれる。
When DMA transfer by one descriptor list is completed, an interrupt of the
本実施の形態では、データ量が予め定められたテスト用の基準データをDMA転送してDMA転送レートを測定し、該測定結果からディスクリプタリストの最適なブロック数を決定する。 In this embodiment, test reference data having a predetermined amount of data is DMA transferred, the DMA transfer rate is measured, and the optimum number of blocks in the descriptor list is determined from the measurement result.
図4は、ブロック数を決定するためのプログラムのフローを示すフローチャートである。このプログラムは、CPU24により所定のタイミングで実行される。
FIG. 4 is a flowchart showing the flow of a program for determining the number of blocks. This program is executed by the
ステップ100では、j及びkに0をセットする。ここで、jは、基本データのデータ量を複数種類定義する配列size_tableの添字を示す。すなわち、配列size_tableの各要素には、異なるデータ量を示すデータが格納されている。また、kは、ブロック数を複数種類定義する配列block_tableの添字を示す。すなわち、配列block_tableの各要素には、異なるブロック数を示すデータが格納されている。
In
ステップ102では、配列size_tableの添字jをカウントアップし、該カウントアップした添字の要素に格納されている基準データのデータ量を変数data_sizeにセットする。
In
ステップ104では、配列block_tableの添字kをカウントアップし、該カウントアップした添字の要素に格納されているブロック数を変数block_countにセットする。なお、本実施の形態では、添字kが大きくなるほど配列block_tableに格納されているブロック数も大きくなる。
In
ステップ106では、変数block_countの値が各ディスクリプタリストのブロック数となるように設定する。
In
ステップ108では、DMA転送レートの測定を開始する。
In
ステップ110では、CPU24が変数block_countの数だけディスクリプタが連ねられたディスクリプタリストを作成し、DMAC42に変数data_sizeが示すデータ量の基準データをDMA転送させ、DMA転送レートの測定処理を行う。ここでは、DMA Write(書き込み)及びDMA read(読み出し)のいずれか一方を行なうようにしてもよいし、双方を行なうようにしてもよい。
In
ステップ112では、測定終了後に、DMA転送にかかった時間と変数data_sizeが示すデータ量とに基づいてDMA転送レートを求め、該求めたDMA転送レートを変数block_countの値(ブロック数)及び変数data_sizeの値(データ量)を対応付けて測定データとして保存する。
In
ステップ114では、所定ブロック数全ての測定を終了したか、すなわち、設定可能なブロック数は変数data_sizeに応じて当然上限があるため、変数data_sizeに応じて設定可能なブロック数の全てについて測定を終了したかを判定する。ここで、否定判定された場合には、ステップ104に戻ってkをカウントアップし、配列block_tableの次の要素に格納されているブロック数を変数block_countにセットして、上記と同様に再度測定を行なう。
In
一方、ステップ114で肯定判定された場合には、ステップ116に移行し、測定結果より、データ量が変数data_sizeの場合の最適なブロック数を決定し、変数data_sizeに対応付けて所定のテーブルに登録する。ここで、ブロック数の決定方法の具体例を説明する。
On the other hand, if an affirmative determination is made in
図5は、4Mバイトの基準データをDMA転送した場合のDMA転送レートの測定結果を示すグラフの一例であり、図6は、32Mバイトの基準データをDMA転送した場合のDMA転送レートの測定結果を示すグラフの一例であり、図7は、63Mバイトの基準データをDMA転送した場合のDMA転送レートの測定結果を示すグラフの一例である。 FIG. 5 is an example of a graph showing the measurement result of the DMA transfer rate when the 4 Mbyte reference data is DMA-transferred, and FIG. 6 is the DMA transfer rate measurement result when the 32 Mbyte reference data is DMA-transferred. FIG. 7 is an example of a graph showing a measurement result of the DMA transfer rate when 63 Mbytes of reference data is DMA-transferred.
ここで、グラフ中のダブルディスクリプタ方式とは、CPUの割り込み時とDMA転送中の双方でディスクリプタリストを作成する方式であり、シングルディスクリプタ方式とは、CPUの割り込み時のみでディスクリプタリストを作成する方式をいう。また、グラフ中、「目安」として示しているのは、通常、ページ単位でディスクリプタが作成されDMA転送されるが、データの先頭部分や最後尾の部分がメモリ28上、物理的にページ単位の境界に無い場合には、CPU24の割り込み回数や1回のDMA転送サイズに若干の変動が生じる場合がある。従って、ここでは目安と記載している。しかしながら、この変動は大きなものではなく、無視できる程度であるため、ここでは測定結果をそのまま用いて最適なブロック数を決定する。
Here, the double descriptor method in the graph is a method for creating a descriptor list both at the time of CPU interrupt and during DMA transfer, and the single descriptor method is a method for creating a descriptor list only at the time of CPU interrupt. Say. In the graph, “guideline” generally indicates that a descriptor is created and DMA-transferred in units of pages, but the beginning and end of data are physically stored in units of pages on the
各グラフから明らかなように、どの方式の場合でもブロック数が少なすぎると転送レートが低く、ブロック数を多くするにつれて転送レートがだんだんと上がっていくが、ある程度転送レートが上がるとそこで安定し、ブロック数をいくら多くしてもあまり転送レートが上がらなくなる。従って、ステップ116では、CPU24は、転送レートが安定したときのブロック数を、そのデータ量における最適なブロック数として決定する。なお、安定したときのブロック数を、例えば、ブロック数の変化に対する転送レートの変化率が所定範囲内に収まったときのブロック数としてもよい。図5〜図7に示す例では、○で囲ったブロック数を最適なブロック数として決定している。
As is clear from each graph, the transfer rate is low if the number of blocks is too small in any method, and the transfer rate gradually increases as the number of blocks increases, but if the transfer rate increases to some extent, it stabilizes there. Even if the number of blocks is increased, the transfer rate does not increase much. Therefore, in step 116, the
ところで、各グラフから明らかなように、転送レートが高いブロック数は、○で囲ったブロック数以外にもあるが、本実施の形態でこれらのブロック数を最適なブロック数としないのは、以下の理由による。 As is clear from each graph, the number of blocks with a high transfer rate is other than the number of blocks surrounded by circles. However, in the present embodiment, the number of blocks is not the optimum number of blocks as follows. Because of the reason.
ブロック数が多すぎると、1つのディスクリプタリストを作成する時間が長くなる。これにより、最初のDMA転送開始時間が遅れるだけでなく、DMA転送期間中だけでは次のディスクリプタリストの作成が間に合わずに、待ち時間が発生して次のディスクリプタリストによるDMA転送の実行が遅れることもある。そこで、本実施の形態では、上記のように1つのディスクリプタリストを構成する最適なブロック数を求めるようにしている。 If the number of blocks is too large, it takes a long time to create one descriptor list. As a result, not only the first DMA transfer start time is delayed, but the creation of the next descriptor list is not in time only during the DMA transfer period, and a waiting time is generated and the execution of the DMA transfer by the next descriptor list is delayed. There is also. Therefore, in this embodiment, the optimum number of blocks constituting one descriptor list is obtained as described above.
こうしてブロック数を決定した後、前述したように、そのブロック数を変数data_sizeに対応付けて所定のテーブルに登録する。図8は、基準データのデータ量(転送サイズ)に対応付けて最適なブロック数を登録したテーブルの一例である。このようなテーブルを、後述するDMA転送時にCPU24が参照できるよう、メモリ28やHDD32に格納しておく。以下、このように最適なブロック数を登録したテーブルをブロック数テーブルと呼称する。
After determining the number of blocks in this manner, as described above, the number of blocks is registered in a predetermined table in association with the variable data_size. FIG. 8 is an example of a table in which the optimum number of blocks is registered in association with the data amount (transfer size) of the reference data. Such a table is stored in the
ステップ118では、配列size_tableの全ての要素に格納されたデータ量についてDMA転送測定が終了したか否かを判定する。ここで否定判定した場合には、kをリセットしてステップ102に戻り、jをカウントアップして、配列size_tableの次の要素に格納されているデータ量を変数data_sizeにセットして、上記と同様に測定を行なう。
In
このように、基準データ毎にブロック数を変動させながらDMA転送して転送レートを測定し、該転送レートに基づいて転送データ量毎に最適なブロック数を決定する。 As described above, DMA transfer is performed while varying the number of blocks for each reference data, the transfer rate is measured, and the optimum number of blocks is determined for each transfer data amount based on the transfer rate.
なお、最適なブロック数を測定して決定するタイミングであるが、転送レートは、DMA転送を行なうシステム(ここでは情報処理部13)の転送性能によって変化するため、システム開発段階でこうした測定を行なって、最適なブロック数を決定するようにしてもよい。 Although it is the timing for measuring and determining the optimum number of blocks, the transfer rate varies depending on the transfer performance of the DMA transfer system (in this case, the information processing unit 13), so such measurement is performed at the system development stage. Thus, the optimum number of blocks may be determined.
また、同じシステムであっても、例えば、システム上で動作するモジュールの種類や数等が異なればCPU24の負荷も変動して転送レートが変動することもあるため、システムの開発段階だけでなく、システム起動時や所定時間毎にこうした測定を行なって、最適なブロック数を決定しておき、ブロック数テーブルを更新するようにしてもよい。
Also, even in the same system, for example, if the type and number of modules operating on the system are different, the load of the
また、LCD22を介してユーザが任意のタイミングで上記ブロック数の決定のためのプログラムを起動して、ブロック数テーブルを更新するようにしてもよい。
Further, the user may activate the program for determining the number of blocks at an arbitrary timing via the
CPU24は、このように決定されテーブルに格納されたブロック数に従ってディスクリプタリストを作成してDMAC42にDMA転送を行なわせる。
The
図9は、DMA転送時に実行されるプログラムのフローを示すフローチャートである。このプログラムは、CPU24により実行される。
FIG. 9 is a flowchart showing a flow of a program executed at the time of DMA transfer. This program is executed by the
ステップ200では、変数remain_sizeに転送対象のデータの量を示すdata_sizeをセットする。変数remain_sizeは未転送のデータ量を示す変数であり、後述するように、1つのディスクリプタリストによるデータ転送が終了する毎に変数remain_sizeから転送済データ量(TransferSize)が減算される。また、ステップ200では、転送対象のデータを転送するためのディスクリプタリストが全て作成されたか否かを示すフラグDL_end_flagに0をセットする。
In
ステップ202では、転送対象のデータ全てが転送終了したか否かを判定する。ここでは、変数remain_sizeが0になり且つフラグDL_end_flagが1になった場合に全データの転送が終了したと判定し、それ以外の場合には、転送は終了していないと判定する。
In
ステップ202で否定判定された場合には、ステップ204で、最初のディスクリプタリストを作成するか否かを判定する。
If the determination in
ステップ204で肯定判定した場合には、ステップ206に移行する。
If an affirmative determination is made in
ステップ206では、ブロック数テーブルからdata_sizeに応じたブロック数を読み出し、該ブロック数を2で除算した数を最初のディスクリプタリストのブロック数として設定する。
In
なお、ここで、ブロック数テーブルから読み出したブロック数を2で除算して最初のディスクリプタリストのブロック数としたのは、最初のディスクリプタリストの作成時間を短縮し、DMAC42を起動するまでの時間を早くして、最初のDMA転送の開始タイミングを早めるためである。なお、逆に最初のディスクリプタリストのブロック数が少なすぎると、最初のディスクリプタリストによるDMA転送期間中に次のディスクリプタリストの作成が間に合わなくなる可能性があるため、ここでは2で除算して最初のディスクリプタリストのブロック数を求めている。なお、転送対象のデータの量(data_size)が極端に小さい場合には、ディスクリプタリストを構成する最適なブロック数も小さくなるため、読み出したブロック数をそのまま用いてもDMA転送の開始にあまり影響しないことが多い。従って、そのような場合には、読み出したブロック数を2で除算せずにそのまま用いるようにしてもよい。
Here, the number of blocks read from the block number table is divided by 2 to obtain the number of blocks in the first descriptor list. This shortens the creation time of the first descriptor list and increases the time until the
また、ここでは2で除算して最初のディスクリプタリストのブロック数を求めたが、これに限定されず、データ量によっては3で除算してもよいし、所定数を減算する等、他の求め方で求めてもよい。 Here, the number of blocks in the first descriptor list is obtained by dividing by 2. However, the present invention is not limited to this. Depending on the amount of data, it may be divided by 3, or by subtracting a predetermined number. You may ask for it.
ステップ208では、ステップ206で設定したブロック数で最初のディスクリプタリストを作成してディスクリプタリスト管理キューに登録し、ディスクリプタ管理キューポインタが該作成したディスクリプタリストのアドレスを示す先頭のディスクリプタリストポインタを指すように設定する。そして、該ディスクリプタリスト管理キューポインタが指す先頭のディスクリプタリストポインタをDMAC42にセットした後、DMAC42を起動する。これにより、DMAC42がDMA転送を開始する。
In
一方、ステップ204で否定判定した場合には、ステップ210に移行し、ブロック数テーブルからdata_sizeに応じた最適なブロック数を読み出し、該ブロック数をこれから作成するディスクリプタリストのブロック数として設定する。
On the other hand, if a negative determination is made in
ステップ208またはステップ210の処理後は、ステップ212で、現在のCPU24の使用率またはCPU24の占有時間を取得する。本システムでは、このプログラムの実行中は、常にバックグラウンドでCPU24の使用率またはCPU24の占有時間をモニタしている。なお、CPU24の占有時間は、個々のディスクリプタリストによるDMA転送開始から累積的に計時され、DMA転送終了時(CPU24割り込み時)にリセットされる。
After the processing of
ステップ214では、ディスクリプタリスト作成条件を満たしているか否かを判定する。ディスクリプタリスト作成条件は、予め本プログラム実行中に参照可能なHDD32などの記憶装置に記憶され設定されている。本実施の形態では、
1,CPU24の使用率または占有時間が所定値を超えておらず、且つ直前のCPU24の割り込みから現時点までに作成したディスクリプタリストの数が、次の割り込みまで(実行中のDMA転送が終了するまで)に作成可能なディスクリプタリストの数を超えていないこと、
2,ディスクリプタリスト管理キューにディスクリプタリストが1つも登録されていないこと(すなわち、ディスクリプタリスト管理キューポインタがNULLであること)、
の2つの条件がディスクリプタリスト作成条件として設定されている。
In
1. The usage rate or occupation time of the
2. No descriptor list is registered in the descriptor list management queue (that is, the descriptor list management queue pointer is NULL),
These two conditions are set as descriptor list creation conditions.
本実施の形態では、この2つの作成条件うち、少なくとも一方が満たされれば、CPU24はステップ214で肯定判定する。
In the present embodiment, if at least one of the two creation conditions is satisfied, the
なお、実行中のDMA転送に係るディスクリプタリストのブロック数によって、CPU24の割り込みが発生するまでの時間が変動するため、その時間内で作成可能なディスクリプタリストの数も変動する。そこで、本実施の形態では、ディスクリプタリストのブロック数に応じて、DMA転送中に作成可能なディスクリプタリストの数を予めHDD32などの記憶装置に記憶して設定しておき、CPU24はこれを参照することにより(或いは、予め記憶しておくことはせずその都度演算することにより、)、次の割り込みまでに作成可能なディスクリプタリストの数を取得し、該作成可能なディスクリプタの数を上限としてディスクリプタリストを作成するようにしている(上記作成条件の1を参照)。
Note that since the time until the interrupt of the
ステップ214で肯定判定した場合には、ステップ216で、CPU24は、上記ステップ210で読み出したブロック数のディスクリプタリストを1つ作成し、ディスクリプタリスト管理キューに登録する。
If an affirmative determination is made in
ステップ218では、転送対象のデータを転送するためのディスクリプタリストを全て作成したか否かを判定する。ここで否定判定した場合には、ステップ202に戻って、上記処理を繰り返す。一方、ステップ218で肯定判定した場合には、ステップ220でフラグDL_end_flagに1をセットしてステップ202に戻る。
In
また、ステップ214で、ディスクリプタリスト作成条件を満たしていないと判定した場合には、CPU24はディスクリプタリストの作成をこれ以上行なわずにステップ222に移行し、現在実行中のDMA転送が終了するのを待つ。DMAC42においてDMA転送が終了して割り込みハンドラからシグナルが来ると、ステップ224に移行し、変数remain_sizeから今回のDMA転送により転送されたデータ量(TransferSize)を減算する。
If it is determined in
ステップ226では、CPU24は、ディスクリプタリスト管理キューポインタに基づいてディスクリプタリスト管理キューから次のディスクリプタリストポインタを取り出す。
In
ステップ228では、上記取り出したディスクリプタリストポインタをDMAC42にセットした後、DMAC42を起動する。これにより、DMAC42が次のディスクリプタリストによるDMA転送を開始する。ステップ228の後は、ステップ202に戻り、上記と同様に処理を行なう。
In
ステップ224で変数remain_sizeから転送済データ量が徐徐に減算されて0になり、且つステップ220でフラグDL_end_flagが1になると、ステップ202で転送対象のデータが全て転送終了したと判定し、本プログラムを終了する。
When the transferred data amount is gradually subtracted from the variable maintain_size in
次に、ディスクリプタリストの作成方法をタイミングチャートを参照しながら更に具体的に説明する。 Next, a method for creating a descriptor list will be described more specifically with reference to a timing chart.
図10は、ディスクリプタリストのブロック数を最初のディスクリプタリストとそれ以外のディスクリプタリストとで異ならせる場合のタイミングチャートの一例を示す図である。 FIG. 10 is a diagram illustrating an example of a timing chart when the number of blocks in the descriptor list is different between the first descriptor list and the other descriptor lists.
図10において、「全画像データ転送区間」で示される期間は、転送対象のデータの全てをDMA転送するための期間であって、具体的には、DMA転送機能(上記説明したDMA転送のプログラム)をコールしてから該プログラムが終了するまでの期間を示す。 In FIG. 10, the period indicated by “all image data transfer section” is a period for DMA transfer of all the data to be transferred, and more specifically, the DMA transfer function (the DMA transfer program described above). ) Is called and the program is terminated.
また、図10において、DMA転送区間T1〜Tnで示される複数の期間の各々は、1つのディスクリプタリストに基づくDMA転送の開始から終了までの期間(すなわち、CPU24の割り込みが終了してから次の割り込みが発生するまでの期間)をいう。
In FIG. 10, each of a plurality of periods indicated by DMA transfer sections T1 to Tn is a period from the start to the end of DMA transfer based on one descriptor list (that is, the next period after the interruption of the
また、ディスクリプタリスト構築区間D1〜Dnで示される複数の期間の各々は、1つのディスクリプタリストを作成する期間を示す(1つの構築区間で1つのディスクリプタリストが作成される)。なお、この例では、DMA転送区間T1に対応するディスクリプタリストは、該DMA転送区間T1の開始前の構築区間D1で作成され、DMA転送区間T2に対応するディスクリプタリストは、その1つ前のDMA転送区間T1内の構築区間D2で作成され、DMA転送区間T3に対応するディスクリプタリストは、その1つ前のDMA転送区間T2内の構築区間D3で作成され、、、、というように、1番目のディスクリプタリストを除く各ディスクリプタリストは、1つ前のDMA転送区間で作成される。 Each of the plurality of periods indicated by the descriptor list construction sections D1 to Dn represents a period for creating one descriptor list (one descriptor list is created in one construction section). In this example, the descriptor list corresponding to the DMA transfer interval T1 is created in the construction interval D1 before the start of the DMA transfer interval T1, and the descriptor list corresponding to the DMA transfer interval T2 is the previous DMA. The descriptor list corresponding to the DMA transfer period T3 created in the construction period D2 in the transfer period T1 is created in the construction period D3 in the previous DMA transfer period T2, and so on. Each descriptor list except the descriptor list is created in the previous DMA transfer section.
また、前述したように、本実施の形態では、1番目のディスクリプタリストのブロック数は、2番目以降のディスクリプタリストのブロック数よりも少なく設定される。従って、図10に示すように構築区間D1は、構築区間D2〜Dnに比べて短くなる。従って、1番目のディスクリプタリストに基づいて行なわれるDMA転送の開始タイミングが早まる。なお、2番目以降のディスクリプタリストは、前述したように、ブロック数決定プログラムで決定された最適なブロック数(ここでは、ブロック数テーブルに登録されているブロック数)で作成される。 As described above, in the present embodiment, the number of blocks in the first descriptor list is set to be smaller than the number of blocks in the second and subsequent descriptor lists. Therefore, as shown in FIG. 10, the construction section D1 is shorter than the construction sections D2 to Dn. Therefore, the start timing of the DMA transfer performed based on the first descriptor list is advanced. As described above, the second and subsequent descriptor lists are created with the optimum number of blocks determined by the block number determination program (here, the number of blocks registered in the block number table).
次に、上述の実施の形態のDMA転送プログラムと同様に、DMA転送実行中に(DMA転送区間内で)ディスクリプタリスト作成条件を満たした場合に、該実行中のDMA転送以降に行なわれるDMA転送のためのディスクリプタリストを作成可能な範囲内で作成する場合についての具体例を、図9,図10を参照して説明する。 Next, as in the DMA transfer program of the above-described embodiment, when the descriptor list creation condition is satisfied during the DMA transfer (in the DMA transfer interval), the DMA transfer performed after the DMA transfer being executed A specific example of the case where the descriptor list is created within a range in which the descriptor list can be created will be described with reference to FIGS.
図11は、CPU24の使用率をモニタしながらディスクリプタリストを作成する場合のタイミングチャートの一例を示す図である。
FIG. 11 is a diagram illustrating an example of a timing chart when a descriptor list is created while monitoring the usage rate of the
図11では、図10に示す「全画像データ転送区間」、「DMA転送区間」、及び「ディスクリプタリスト構築区間」に加えて、「システムのCPU使用率」が示されている。CPU使用率は、モジュール等がCPU24を占有する時間の割合を%で示したものである。
FIG. 11 shows “system CPU usage rate” in addition to “all image data transfer period”, “DMA transfer period”, and “descriptor list construction period” shown in FIG. The CPU usage rate is the percentage of the time that a module or the like occupies the
この例では、ディスクリプタリスト管理キューにディスクリプタリストが1つも登録されていなければ、CPU使用率に拘わらずディスクリプタリストを作成するが、そうでなければ、CPU使用率を参照し、CPU使用率が予め定められた上限値を超えていなければ、そのDMA転送区間で作成可能な数以内で先行してディスクリプタリストを作成する。一方、CPU使用率の上限値を超えた、或いはそのDMA転送区間で作成したディスクリプタリストの数がそのDMA転送区間で作成可能な数に到達した場合には、ディスクリプタリストの作成は行なわずに、次のDMA転送区間に作成処理を繰り越す。 In this example, if no descriptor list is registered in the descriptor list management queue, a descriptor list is created regardless of the CPU usage rate. Otherwise, the CPU usage rate is referred to and the CPU usage rate is set in advance. If the predetermined upper limit value is not exceeded, the descriptor list is created in advance within the number that can be created in the DMA transfer section. On the other hand, when the upper limit of the CPU usage rate is exceeded or the number of descriptor lists created in the DMA transfer section reaches the number that can be created in the DMA transfer section, the descriptor list is not created. The creation process is carried forward to the next DMA transfer section.
図11に示すように、DMA転送区間T1の前の構築区間D1でブロック数の少ないディスクリプタリストを1つ作成した後、DMA転送区間T1において、最適なブロック数のディスクリプタリストを2つ作成している(構築区間D2、D3で合計2つ)。また、次のDMA転送区間T2では、3つの構築区間D4、D5、D6で3つのディスクリプタリストを作成している。DMA転送区間T1,T2では、CPU使用率が上限値よりも低いため、DMA転送区間の長さに応じて作成可能な数だけディスクリプタリストが作成されている。 As shown in FIG. 11, after one descriptor list with a small number of blocks is created in the construction section D1 before the DMA transfer section T1, two descriptor lists with the optimum number of blocks are created in the DMA transfer section T1. (Two in total in construction sections D2 and D3). In the next DMA transfer section T2, three descriptor lists are created in the three construction sections D4, D5, and D6. In the DMA transfer sections T1 and T2, since the CPU usage rate is lower than the upper limit value, as many descriptor lists as possible can be created according to the length of the DMA transfer section.
ところが、DMA転送区間T3ではCPU使用率は上限値を超えている。また、既にDMA転送区間T1,T2で、DMA転送区間T6に対応するディスクリプタリストまで先行して作成済みである。従って、DMA転送区間T3ではディスクリプタリスト作成条件を満たさないため、ディスクリプタリストが1つも作成されない。また、DMA転送区間T4では、途中からCPU使用率が上限値以下となるため、その時点でディスクリプタリストが作成されている(構築区間D7)。 However, the CPU usage rate exceeds the upper limit in the DMA transfer period T3. In addition, the descriptor list corresponding to the DMA transfer section T6 has already been created in the DMA transfer sections T1 and T2. Accordingly, since no descriptor list creation condition is satisfied in the DMA transfer period T3, no descriptor list is created. Further, in the DMA transfer section T4, since the CPU usage rate becomes equal to or less than the upper limit value from the middle, the descriptor list is created at that time (construction section D7).
このようにCPU使用率をモニタしながらディスクリプタリストを作成する方法は、例えば、実行モジュールの切替えが強制的に行なわれるプリエンプティブなモジュールでディスクリプタリストを作成するシステム等、様々なシステムに好適である。 The method of creating the descriptor list while monitoring the CPU usage rate in this way is suitable for various systems such as a system that creates a descriptor list with a preemptive module in which execution modules are forcibly switched.
図12は、CPU24の占有時間をモニタしながらディスクリプタリストを作成する場合のタイミングチャートの一例を示す図である。
FIG. 12 is a diagram illustrating an example of a timing chart when a descriptor list is created while monitoring the occupation time of the
図12では、図8に示す「全画像データ転送区間」、「DMA転送区間」、及び「ディスクリプタリスト構築区間」に加えて、「CPU占有時間」が示されている。CPU占有時間は、ディスクリプタリストを作成するモジュールがCPU24を占有する時間の累計を示したものであり、予め画像処理システム10に組み込まれたCPU24の占有時間を計時するモジュールによって得られる。なお、このCPU占有時間は、CPU24の割り込みが発生する度に、0にリセットされる。
In FIG. 12, “CPU occupation time” is shown in addition to “all image data transfer section”, “DMA transfer section”, and “descriptor list construction section” shown in FIG. The CPU occupation time indicates the total amount of time that the module that creates the descriptor list occupies the
この例では、ディスクリプタリスト管理キューにディスクリプタリストが1つも登録されていなければ、CPU占有時間に拘わらずディスクリプタリストを作成するが、そうでなければ、CPU占有時間を参照し、CPU占有時間が予め定められた上限値を超えていなければ、そのDMA転送区間で作成可能な数以内で先行してディスクリプタリストを作成する。一方、CPU占有時間の上限値を超えた、或いはそのDMA転送区間で作成したディスクリプタリストの数がそのDMA転送区間で作成可能な数に到達した場合には、ディスクリプタリストの作成は行なわずに、次のDMA転送区間に作成処理を繰り越す。 In this example, if no descriptor list is registered in the descriptor list management queue, a descriptor list is created regardless of the CPU occupation time. Otherwise, the CPU occupation time is referred to and the CPU occupation time is determined in advance. If the predetermined upper limit value is not exceeded, the descriptor list is created in advance within the number that can be created in the DMA transfer section. On the other hand, when the upper limit of the CPU occupation time is exceeded or the number of descriptor lists created in the DMA transfer section reaches the number that can be created in the DMA transfer section, the descriptor list is not created. The creation process is carried forward to the next DMA transfer section.
図12に示すように、DMA転送区間T1の前の構築区間D1でブロック数の少ないディスクリプタリストを1つ作成した後、DMA転送区間T1において、最適なブロック数のディスクリプタリストを2つ作成している(構築区間D2、D3)。構築区間D3でディスクリプタリスト作成が終了した時点でCPU占有時間が上限値に到達しているため、このDMA転送区間T1ではこれ以上のディスクリプタリストの作成は行なわれていない。 As shown in FIG. 12, after one descriptor list with a small number of blocks is created in the construction section D1 before the DMA transfer section T1, two descriptor lists with the optimum number of blocks are created in the DMA transfer section T1. (Construction sections D2, D3). Since the CPU occupation time has reached the upper limit when the descriptor list creation is completed in the construction section D3, no further descriptor list is created in this DMA transfer section T1.
次のDMA転送区間T2でも、ディスクリプタリストを2つ作成した時点でCPU占有時間が上限値に到達しているため、それ以上のディスクリプタリストの作成は行なわれていない。続くDMA転送区間T3、T4でも同様である。 Even in the next DMA transfer section T2, the CPU occupation time has reached the upper limit when two descriptor lists are created, so no further descriptor list is created. The same applies to the subsequent DMA transfer sections T3 and T4.
このようにCPU占有時間をモニタしながらディスクリプタリストを作成する方法は、例えば、実行モジュールの切替えが強制的に行なわれないノンプリエンプティブな組込型モジュールでディスクリプタリストを作成するシステム等、様々なシステムに好適である。 In this way, the method for creating the descriptor list while monitoring the CPU occupation time is, for example, various systems such as a system for creating a descriptor list with a non-preemptive embedded module in which execution module switching is not forcibly performed. It is suitable for.
以上、様々な例について説明したが、本発明は、上述した実施の形態に限定されるものではなく、特許請求の範囲に記載された発明の範囲内で様々な設計上の変更を行うようにしてもよい。 Although various examples have been described above, the present invention is not limited to the above-described embodiments, and various design changes are made within the scope of the invention described in the claims. May be.
例えば、上記実施の形態では、DMA転送の開始時に最初のディスクリプタリストのブロック数を演算で求めたが、これに限定されず、予め最初のディスクリプタリストのブロック数を求めておき、図13に示すように、ブロック数テーブルに予め登録しておくようにしてもよい。 For example, in the above embodiment, the number of blocks in the first descriptor list is obtained by calculation at the start of DMA transfer. However, the present invention is not limited to this, and the number of blocks in the first descriptor list is obtained in advance, as shown in FIG. In this way, it may be registered in advance in the block number table.
また、本実施の形態では最初のディスクリプタリストのブロック数のみを少なくする例について説明したが、これに限定されず、例えば、最初のディスクリプタリストを最も少ないブロック数にして、2番目、3番目と段階的にブロック数を増やすようにしてもよい。このように段階的にブロック数を増やす場合であっても、なるべく早い段階で最適なブロック数のディスクリプタリストが作成されるようにして、転送効率が下がらないようにするとよい。 In the present embodiment, an example in which only the number of blocks in the first descriptor list is reduced has been described. However, the present invention is not limited to this example. The number of blocks may be increased step by step. Even when the number of blocks is increased step by step, a descriptor list having the optimum number of blocks is created at the earliest possible stage so that transfer efficiency does not decrease.
10 画像処理システム
12 マザーボード
13 情報処理部
14 コントローラボード
24 CPU
26 ハブ
28 メモリ
30 ハブ
32 HDD
40 バスブリッジ
42 DMAコントローラ
44 メモリ
DESCRIPTION OF
26
40
Claims (7)
データ量が予め定められた基準データを前記転送情報群を構成する転送情報の個数を変化させながら前記転送手段によってDMA転送したときの転送速度に基づいて前記転送情報群を構成する転送情報の数を決定する決定手段と、
転送対象のデータをDMA転送するときに、前記決定手段で決定された数の転送情報を連ねて構成した転送情報群を作成する作成手段と、
を含む情報処理装置。 The unit transfer of the data to be transferred based on a transfer information group composed of a plurality of transfer information for each unit transfer amount including information necessary for direct memory access (DMA) transfer without intervention of a central processing unit (CPU) Transfer means for DMA transfer for each quantity;
The number of transfer information constituting the transfer information group based on the transfer speed when the transfer means performs DMA transfer by changing the number of transfer information constituting the transfer information group with reference data having a predetermined data amount A determination means for determining
Creating means for creating a transfer information group composed of a plurality of pieces of transfer information determined by the determining means when transferring data to be transferred by DMA;
An information processing apparatus including:
前記作成手段は、転送対象のデータをDMA転送するときに、該転送対象のデータ量に応じて前記記憶手段に記憶された数を読み出し、該読み出した数の転送情報を連ねて構成した転送情報群を作成する請求項1に記載の情報処理装置。 A storage unit that stores the number of pieces of transfer information determined by the determination unit in association with the data amount of the reference data;
The creation unit reads the number stored in the storage unit according to the amount of data to be transferred when the transfer target data is DMA-transferred, and transfer information configured by connecting the read number of transfer information. The information processing apparatus according to claim 1, which creates a group.
前記転送手段は、前記転送情報用記憶手段から前記作成順に転送情報群を読み出してDMA転送を行なう請求項1〜3の何れか1項に記載の情報処理装置。 The creating means performs the DMA transfer after the DMA transfer being executed until the DMA transfer being executed by the transfer means is completed when creating a plurality of transfer information groups for DMA transfer of the data to be transferred. A transfer information group for DMA transfer to be stored in the transfer information storage means in the order of creation,
The information processing apparatus according to claim 1, wherein the transfer unit performs DMA transfer by reading transfer information groups from the transfer information storage unit in the order of creation.
データ量が予め定められた基準データを前記転送情報群を構成する転送情報の個数を変化させながら前記転送手段によってDMA転送したときの転送速度に基づいて前記転送情報群を構成する転送情報の数を決定する決定手段、および
転送対象のデータをDMA転送するときに、前記決定手段で決定された数の転送情報を連ねて構成した転送情報群を作成する作成手段、
として機能させるためのプログラム。 The unit transfer of the data to be transferred based on a transfer information group composed of a plurality of transfer information for each unit transfer amount including information necessary for direct memory access (DMA) transfer without intervention of a central processing unit (CPU) A computer provided with a transfer means for performing DMA transfer for each quantity,
The number of transfer information constituting the transfer information group based on the transfer speed when the transfer means performs DMA transfer by changing the number of transfer information constituting the transfer information group with reference data having a predetermined data amount Determining means for determining the transfer information, and creating means for creating a transfer information group configured by linking the number of transfer information determined by the determining means when the transfer target data is DMA-transferred,
Program to function as.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007227678A JP2009059276A (en) | 2007-09-03 | 2007-09-03 | Data processing apparatus and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007227678A JP2009059276A (en) | 2007-09-03 | 2007-09-03 | Data processing apparatus and program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2009059276A true JP2009059276A (en) | 2009-03-19 |
Family
ID=40554926
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007227678A Pending JP2009059276A (en) | 2007-09-03 | 2007-09-03 | Data processing apparatus and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2009059276A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2011189509A (en) * | 2010-03-11 | 2011-09-29 | Ricoh Co Ltd | Image forming apparatus and method for transmission processing of image data therefor |
JP2013246778A (en) * | 2012-05-29 | 2013-12-09 | Nec Corp | Dma transfer device, dma transfer method and dma transfer program |
JP5638124B2 (en) * | 2011-03-29 | 2014-12-10 | 三菱電機株式会社 | Navigation device |
-
2007
- 2007-09-03 JP JP2007227678A patent/JP2009059276A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2011189509A (en) * | 2010-03-11 | 2011-09-29 | Ricoh Co Ltd | Image forming apparatus and method for transmission processing of image data therefor |
JP5638124B2 (en) * | 2011-03-29 | 2014-12-10 | 三菱電機株式会社 | Navigation device |
JP2013246778A (en) * | 2012-05-29 | 2013-12-09 | Nec Corp | Dma transfer device, dma transfer method and dma transfer program |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP7313381B2 (en) | Embedded scheduling of hardware resources for hardware acceleration | |
US8683093B2 (en) | Memory system having high data transfer efficiency and host controller | |
CN102414671B (en) | Hierarchical memory arbitration technique for disparate sources | |
JP5270077B2 (en) | Arbitration circuit, crossbar, request selection method, and information processing apparatus | |
CN103034454B (en) | Flexible flash command | |
US20070076246A1 (en) | Image processing apparatus | |
JP2010027032A (en) | Fifo device and method of storing data in fifo buffer | |
CN102646446A (en) | Hardware dynamic cache power management | |
JP2009277096A (en) | Dma control system, printer, and transfer instruction program | |
US11010094B2 (en) | Task management method and host for electronic storage device | |
KR20080105390A (en) | Apparatus and method for controlling commands used in flash memory | |
CN101504567B (en) | CPU, CPU instruction system and method for reducing CPU power consumption | |
JP2009059276A (en) | Data processing apparatus and program | |
US20030172229A1 (en) | Systems and methods for detecting and compensating for runt block data transfers | |
US20060179172A1 (en) | Method and system for reducing power consumption of a direct memory access controller | |
JP2008040650A (en) | Bus arbitration device | |
CN112214095A (en) | Method and equipment for controlling power consumption of hard disk | |
KR101135313B1 (en) | Nand flash memory apparatus and method for scheduling requested operations | |
CN112767978B (en) | DDR command scheduling method, device, equipment and medium | |
US8769167B2 (en) | Channel device, information processing system and data transfer method | |
CN101276315B (en) | Direct memory access controller for dynamically regulating transmission data width and method thereof | |
KR102334473B1 (en) | Adaptive Deep Learning Accelerator and Method thereof | |
CN102385555A (en) | Caching system and method of data caching | |
US20090276553A1 (en) | Controller, hard disk drive and control method | |
WO2024114728A1 (en) | Heterogeneous processor and related scheduling method |