JP4536189B2 - DMA transfer apparatus and DMA transfer system - Google Patents

DMA transfer apparatus and DMA transfer system Download PDF

Info

Publication number
JP4536189B2
JP4536189B2 JP33962399A JP33962399A JP4536189B2 JP 4536189 B2 JP4536189 B2 JP 4536189B2 JP 33962399 A JP33962399 A JP 33962399A JP 33962399 A JP33962399 A JP 33962399A JP 4536189 B2 JP4536189 B2 JP 4536189B2
Authority
JP
Japan
Prior art keywords
transfer
data
size
area
dma
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP33962399A
Other languages
Japanese (ja)
Other versions
JP2000227897A (en
Inventor
昌明 原田
勉 関部
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Corp
Panasonic Holdings Corp
Original Assignee
Panasonic Corp
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Panasonic Corp, Matsushita Electric Industrial Co Ltd filed Critical Panasonic Corp
Priority to JP33962399A priority Critical patent/JP4536189B2/en
Publication of JP2000227897A publication Critical patent/JP2000227897A/en
Application granted granted Critical
Publication of JP4536189B2 publication Critical patent/JP4536189B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Bus Control (AREA)
  • Dram (AREA)

Description

【0001】
【発明の属する技術分野】
高速ページアクセス可能なメモリに対してページ単位での連続アクセスを保証するDMAデータ転送装置
【0002】
【従来の技術】
従来のDMAデータ転送装置は、メモリ−メモリ間又はメモリ−入出力装置間で、高速にデータ転送を行なう。
同じバスに接続されたメモリ間の転送及び同じメモリの異なる記憶領域間の転送では、DMAデータ転送装置は、転送元の記憶領域から読み出したデータをDMAデータ転送装置内のバッファに一時的に保持しさらにバッファから転送先の記憶領域に書き込むことにより、DMAデータ転送を行なう。このバッファは、メモリに対する1回のアクセスサイズ以上の容量を有する。従来の典型的なDMAデータ転送は、1アクセスサイズのデータ毎に、転送元からの読み出し、バッファへの格納、バッファから転送先記憶領域への書き込みを行っている。これにより必要最小限のバッファサイズにてDMAデータ転送が可能になる。
【0003】
またバッファサイズがアクセスサイズの複数倍の大きさである場合には、DMA転送装置は、転送元からバッファサイズ分になるまでデータを読み出してバッファに格納し、バッファからバッファサイズ分のデータを転送先記憶領域書き込む。この場合は、読み出し、書き込みはバッファサイズを単位になされる。
【0004】
【発明が解決しようとする課題】
ところで、近年高速ページアクセス可能なSDRAMが主記憶として用いられているが、このSDRAMが転送対象である場合に、SDRAMの高速性能が犠牲になり、その有用性が十分に活用できないという問題があった。なぜなら従来のDMA転送装置は、転送元からバッファへの読み出し、バッファから転送先への書き込みにおいてページ境界とは無関係にアクセスするからである。
【0005】
本発明は、高速ページアクセス可能なメモリと相性が良く、その性能を犠牲にすることなく高速なDMA転送を実現する有用なDMA転送装置を提供することを目的する。
【0006】
【課題を解決するための手段】
本発明のDMA転送装置は、高速ページアクセスに対応するメモリを対象とするDMA転送装置であって、転送対象となるメモリ領域を構成する複数の部分領域であって、前記メモリ領域の先頭とページ境界との間、ページ境界間及びページ境界と前記メモリ領域の末尾との間の各部分領域を判別する判別手段と、判別された部分領域毎に高速ページアクセスを行なうアクセス手段とを備える。
【0007】
また、本発明のDMA転送装置は、転送元となる第1メモリ領域を構成する複数の転送元部分領域であって、前記第1メモリ領域の先頭とページ境界との間、ページ境界間及びページ境界と前記第1メモリ領域の末尾との間の各転送元部分領域を判別する第1判別手段と、転送先となる第2メモリ領域を構成する複数の転送先部分領域であって、前記第2メモリ領域の先頭とページ境界との間、ページ境界間及びページ境界と前記第2メモリ領域の末尾との間の各転送先部分領域を判別する第2判別手段と、第1判別手段に判別された転送元部分領域から高速ページアクセスによりデータを読み出してバッファ手段に格納し、バッファ手段に格納されたデータを第2判別手段により判別された転送先部分領域に高速ページアクセスにより書き込むアクセス手段とを備える。
【0008】
また、本発明のDMA転送システムは、優先度が異なる複数のDMAチャネルを有するDMA転送システムであって、DMAチャネル毎に設けられ、対応するDMAチャネルのDMA転送要求を受付け、DMA転送の完了までDMA転送要求を保持する複数の受付手段と、DMAチャネル毎に設けられ、対応するDMAチャネルのDMA転送要求に指定された転送対象のメモリ領域について、当該メモリ領域を構成する複数の部分領域であって、前記メモリ領域の先頭とページ境界との間、ページ境界間及びページ境界と前記メモリ領域の末尾との間の各部分領域を判別する複数の判別手段と、DMAチャネル毎に設けられ、対応するDMAチャネルの判別手段により判別された部分領域毎に高速ページアクセスを指示するアクセス要求を生成する複数のアクセス要求生成手段と、各DMAチャネルに共用され、転送すべきデータを一時的に保持するバッファ手段と、調停手段とを備える。ここで、調停手段は、複数の受付け手段において、ただ1つのDMAチャネルに対するDMA転送要求が保持されている場合には、当該DMAチャネルに対応するアクセス要求に従ってアクセスを行い、DMA転送要求が保持されていて、かつ、優先度の高いDMAチャネルに対するDMA転送要求が受付けられた場合には、先行するDMA転送要求のDMAチャネルに対応する判別手段及びアクセス要求生成手段に対してバッファ手段を空にしてから中断するよう指示し、バッファ手段が空になった時点で優先度の高いDMAチャネルのアクセス要求に従ってアクセスを行い、優先度の高いDMA転送完了後に、先行するDMA転送要求のDMAチャネルに対応する判別手段及びアクセス要求生成手段に対してDMA転送を再開するよう指示する。
【0009】
また、本発明のDMA転送システムは、複数のDMAチャネルを有するDMA転送システムであって、DMAチャネル毎に設けられ、対応するDMAチャネルのDMA転送要求を受付け、DMA転送の完了までDMA転送要求を保持する複数の受付手段と、DMAチャネル毎に設けられ、対応するDMAチャネルのDMA転送要求に指定された転送対象のメモリ領域について、当該メモリ領域を構成する複数の部分領域であって、前記メモリ領域の先頭とページ境界との間、ページ境界間及びページ境界と前記メモリ領域の末尾との間の各部分領域を判別する複数の判別手段と、DMAチャネル毎に設けられ、対応するDMAチャネルの判別手段により判別された部分領域毎に高速ページアクセスを指示するアクセス要求を生成する複数のアクセス要求生成手段と、各DMAチャネルに共用され、2つのバスに接続された2ポートメモリであるバッファ手段と、調停手段とを備える。ここで、調停手段は、複数の受付け手段において、ただ1つのDMAチャネルに対するDMA転送要求が保持されている場合には、当該DMAチャネルに対応するアクセス要求に従ってアクセスを行い、既にDMA転送要求が保持されていて、かつ、他のDMAチャネルに対するDMA転送要求が受付けられ、かつ、先行するDMA転送の転送先と新たなDMA転送の転送元とが異なるバス上のメモリである場合には、転送中の全転送データについての転送元からの読み出しが完了し、かつ、バッファ手段に他のDMAチャネルの最初の部分領域の読み出しサイズ分の空き領域が存在するという状態になった時点で、他のDMAチャネルの最初の部分領域の読み出しを開始する。
【0010】
【発明の実施の形態】
<第1の実施の形態>
<全体構成>
図1は、本発明の第1の実施の形態におけるDMA(Direct Memory Access)転送装置を備える情報処理装置の主要部の構成を示すブロック図である。同図の情報処理装置は、例えばデジタル衛星放送受信装置(以下STB(Set Top Box)と呼ぶ)や、DVD(Digital Video/Versatile Disk)、DVDーRAM等の光ディスク記録再生装置などの装置全体の制御に用いられ、I/O部5、SDRAM4、SDRAM I/F3、CPU2、DMA転送装置1を備える。
【0011】
I/O部5は、MPEGストリームの入出力や、リモコン(図外)からのキーデータの入力を行なう。
SDRAM4は、高速ページアクセスに対応するメモリである。高速ページアクセスとは、予め定められたページと呼ばれる連続する記憶領域に対して高速にアクセスすることである。本実施の形態ではSDRAM4は32ビット(以下、32ビットを1ワードとする)のデータ幅であり、1ページを4ワード(16バイト)毎の連続する記憶領域とする。ここで、1ページの大きさは、2ワード、8ワード等他の大きさにすることもできるが、CPU2のキャッシュフィルサイズ(キャッシュメモリを更新する単位)と同じ大きさにすることが望ましい。SDRAM I/F3の構成を対CPU2と対DMA転送装置1とで共通化でき簡略化できるからである。本実施の形態ではキャッシュフィルサイズも16バイトであるものとする。
【0012】
SDRAM I/F3は、DMA転送装置1、CPU2からバス上に送出されるアクセス信号群(アドレス、データ、各種制御信号)を、SDRAM4の入出力仕様に変換してSDRAM4をアクセスする。
CPU2は、内部にキャッシュメモリを有し、情報処理装置全体の制御を行ない、DMA転送要求をDMA転送装置1に設定する。図1におけるDMA転送は、SDRAM4からSDRAM4への(つまりSDRAM4内の異なる記憶領域間)転送と、SDRAM4とI/O部5との間の転送と、SDRAM4とMPEGデコーダ(図外)との間の転送等がある。
【0013】
DMA転送装置1は、SDRAM4の異なる記憶領域間、SDRAM4とI/O部5間等でDMA転送を行なう。その際、DMA転送装置1は、転送元又は転送先がSDRAM4である場合には、SDRAM4中の転送対象の領域内に存在するページ境界より区切られる部分領域を判別し、部分領域毎に対して高速ページアクセスにより連続的にアクセスを行なう。
<DMA転送装置1の構成>
図2は、DMA転送装置1の構成を示すブロック図である。同図のようにDMA転送装置1は、モード設定部100、読み出し管理部200、読み出し決定部210、書き込み管理部300、書き込み決定部310、アクセス決定部110、アクセス制御部120、バッファ130を備えて構成される。図中の矢線に付与された()内は、当該符号のレジスタ類の内容が入出力されることを意味する。
【0014】
モード設定部100は、CPU2から設定されるDMA転送要求を保持するレジスタ101〜105を備える。ここで、DMA転送要求は、SDRAM4の異なる領域間や、SDRAM4とI/O部5間でCPU2を介さないDMA転送を要求する各種パラメータを含む。各種パラメータは、(1)DMA転送サイズ、(2)読み出し先頭アドレス、(3)書き込み先頭アドレス、(4)アドレッシングモード、(5)アクセスサイズ等を含む。ここで(1)「転送サイズ」はDMA転送すべき全データ長(バイト数とする)を示す。(2)「読み出し先頭アドレス」は転送元(SDRAM4やI/O部5等)に記憶された転送すべきデータの先頭アドレスを指す。(3)「書き込み先頭アドレス」は転送先(SDRAM4やI/O部5等)の先頭アドレスを指す。(4)「アドレッシングモード」は、転送元、転送先のそれぞれについてアドレス昇順にアクセスするかアドレス固定でアクセスするかを示す。(5)「アクセスサイズ」は、転送元、転送先のそれぞれについて1回のアクセスで読み出し又は書き込むべきデータサイズを指す。本実施の形態では、アクセスサイズは32ビットであるものとする。
【0015】
レジスタ101〜105は、順に転送サイズ、読み出し先頭アドレス、書き込み先頭アドレス、アドレッシングモード、アクセスサイズを保持し、DMA転送要求によるDMA転送終了後にクリアされる。以下ではレジスタ101〜103の各保持内容を、TRANSFER_SIZE_101、SRC_A_102、DST_A_103と略記する。
読み出し管理部200は、TRANSFER_SIZE_101とSRC_A_10とで特定される転送元記録領域内における、未読み出しのデータの先頭アドレス(以下REMAIN_R_A_201と略す)と、未読み出しのデータサイズ(以下REMAIN_R_SIZE_202と略す)とを管理する。そのため、読み出し管理部200はアドレスカウンタ201とデータカウンタ202とを備える。
【0016】
アドレスカウンタ201は、DMA転送要求がモード設定部100に発行されたときに、レジスタ102から入力されるSRC_A_102をREMAIN_R_A_201の初期値として保持し、さらに、アドレッシングモードがアドレス昇順である場合には、読み出しを完了した部分領域のバイト数についての通知を読み出し決定部210から受ける毎に、通知されたバイト数をREMAIN_R_A_201に加算することにより、REMAIN_R_A_201が次の部分領域の先頭アドレスを指すように更新する。上記の読み出しを完了した部分領域のバイト数は、アクセス制御部120によって転送元の部分領域のデータが読み出されバッファ130へ格納された時点で、読み出し決定部210から通知される。一方、アドレッシングモードがアドレス固定である場合には、アドレスカウンタ201は、レジスタ102から入力されるSRC_A_102を記憶したままDMA転送中に更新しない。
【0017】
データカウンタ202は、DMA転送要求がモード設定部100に発行されたときに、TRANSFER_SIZE_101をREMAIN_R_SIZE_202の初期値として保持し、さらに、読み出しを完了した部分領域のバイト数が読み出し決定部210から通知される毎に、REMAIN_R_SIZE_202から当該バイト数を減算することにより更新する。その結果、REMAIN_R_SIZE_202は、TRANSFER_SIZE_101の内の未読み出しのデータサイズを表すことになる。
【0018】
読み出し決定部210は、部分領域判定部211、アドレスレジスタ212、サイズレジスタ213とを備え、DMA転送要求がモード設定部100に発行された後、REMAIN_R_A_201及びREMAIN_R_SIZE_202により特定される未読み出しデータの記憶領域内における、ページ境界により区切られる部分領域を判別し、判別した部分領域毎の先頭アドレス(以下PARTIAL_R_A_212と略す。)をアドレスレジスタ212に、判別した部分領域のサイズ(PARTIAL_R_SIZE_213)をサイズレジスタ213に設定する。設定後、読み出し決定部210は、アクセス制御部120から当該部分領域の読み出しおよびバッファ130への格納を完了した旨の通知を受けると、サイズレジスタ213のPARTIAL_R_SIZE_213を、読み出しを完了した部分領域のサイズとして読み出し管理部200に通知し、再度上記と同様にして次の部分領域を判別してアドレスレジスタ212、サイズレジスタ213に設定する。
【0019】
図3に、読み出し決定部210によって判別される部分領域の一例を示す。同図は、SDRAM4中の転送元の記憶領域を示している。この転送元の記憶領域は、500C(16進)番地から始まる28バイト分の記憶領域、つまり、SRC_A_102が500C番地、TRANSFER_SIZE_101が28バイト(7ワード:図中の▲1▼〜▲7▼)であるものとする。SDRAM4のページサイズは16バイト(4ワード)であるので、転送すべきデータ(図中の▲1▼〜▲7▼の7ワード)は3つのページに跨って格納される。
【0020】
この場合、読み出し決定部210は、次の第1〜第3の部分領域を順に判別する。第1の部分領域は(PARTIAL_R_A_212、PARTIAL_R_SIZE_213)=(500C,4)で表されるワード▲1▼の記憶領域である。第2の部分領域は(5010,16)で表されるワード▲2▼〜▲5▼の記憶領域である。第3の部分領域は(5020,8)で表されるワード▲6▼▲7▼の記憶領域である。このように各部分領域は、ページ境界を含まないので高速ページアクセスに適している。
【0021】
書き込み管理部300は、TRANSFER_SIZE_101とDST_A_103とで特定される転送先記録領域内における、未書き込み領域の先頭アドレス(REMAIN_W_A_301と略す)と、未書き込みデータサイズ(REMAIN_W_SIZE_302と略す)とを管理する。そのため、書き込み管理部300はアドレスカウンタ301とデータカウンタ302とを備える。
【0022】
アドレスカウンタ301は、DMA転送要求がモード設定部100に発行されたときに、レジスタ103から入力されるDST_A_103を初期値として保持し、さらに、アドレッシングモードがアドレス昇順である場合には、書き込みを完了した部分領域のバイト数についての通知を書き込み決定部310から受ける毎に、通知されたバイト数をREMAIN_W_A_301に加算することにより、REMAIN_W_A_301が次の部分領域の先頭アドレスを指すように更新する。上記の書き込みを完了した部分領域のバイト数は、アクセス制御部120によって転送先の部分領域にデータが書き込まれた時点で、書き込み決定部310から通知される。一方、アドレッシングモードがアドレス固定である場合には、アドレスカウンタ301は、レジスタ103から入力されるDST_A_103を記憶したままDMA転送中は更新しない。
【0023】
データカウンタ302は、DMA転送要求がモード設定部100に発行されたときに、TRANSFER_SIZE_101をREMAIN_W_SIZE_302の初期値として保持し、さらに、書き込みを完了した部分領域のバイト数が書き込み決定部310から通知される毎に、REMAIN_W_SIZE_302から当該バイト数を減算することにより更新する。その結果、REMAIN_R_SIZE_202は、TRANSFER_SIZE_101の内の未読み出しのデータサイズを表すことになる。
【0024】
書き込み決定部310は、部分領域判定部311、アドレスレジスタ312、サイズレジスタ313を備え、DMA転送要求がモード設定部100に発行された後、REMAIN_W_A_301及びREMAIN_W_SIZE_302により特定される未書き込みの記憶領域内における、ページ境界により区切られる部分領域を判別し、判別した部分領域毎の先頭アドレス(以下PARTIAL_W_A_312と略す)をアドレスレジスタ312に、判別した部分領域のサイズ(以下PARTIAL_W_SIZE_313と略す)をサイズレジスタ313に設定する。設定後、アクセス制御部120から当該部分領域への書き込みを完了した旨の通知を受けると、サイズレジスタ313のPARTIAL_W_SIZE_313を、書き込みを完了したサイズとして書き込み管理部300に通知し、再度上記と同様にして次の部分領域を判別してアドレスレジスタ312、サイズレジスタ313に次の部分領域を設定する。
【0025】
図4に、書き込み決定部310によって判別される部分領域の一例を示す。同図は、SDRAM4中の転送先の記憶領域の一部分を示している。この転送先記憶領域は、6008番地から始まる28バイト分の記憶領域、つまり、DST_A_103が6008(16進)番地、TRANSFER_SIZE_101が28バイト(7ワード:図中の▲1▼〜▲7▼)であるものとする。SDRAM4のページサイズは16バイト(4ワード)であるので、転送先の記憶領域(図中の▲1▼〜▲7▼)は3つのページに跨って格納されている。
【0026】
この場合、書き込み決定部310は、次の第4〜第6の部分領域を順に判別する。第4の部分領域は(PARTIAL_W_A_302、PARTIAL_W_SIZE_303)=(6008,8)で表されるワード▲1▼▲2▼の記憶領域である。第5の部分領域は(6010,16)で表されるワード▲3▼〜▲6▼の記憶領域である。第6の部分領域は(6020,4)で表されるワード▲7▼の記憶領域である。このように各部分領域は、ページ境界を含まないので高速ページアクセスに適している。
【0027】
アクセス決定部110は、バッファ管理部111、リード/ライト決定部112を備え、読み出し決定部210によって決定された転送元の部分領域からの読み出し及びバッファ130への格納(以下リードと略す)と、バッファ130に格納されたデータの読み出し及び書き込み決定部310によって決定された転送先の部分領域への書き込み(以下ライトと略す)のうちどちらをアクセス制御部120に実行させるかを、バッファ130のデータ量に応じて決定する。
【0028】
バッファ管理部111は、REMAIN_R_SIZE_202とREMAIN_W_SIZE_302とが入力され、REMAIN_R_SIZE_202からREMAIN_W_SIZE_302を減算することにより、バッファ130に一時的に保持されているデータ量を算出する。
リード/ライト決定部112は、バッファ管理部111に算出されたデータ量がPARTIAL_W_SIZE_313よりも小さい場合には、アクセス制御部120に読み出しを実行させると決定し、そうでない場合には、ライトをアクセス制御部120に実行させると決定する。
【0029】
アクセス制御部120は、リード/ライト決定部112に決定に従って、読み出し決定部210により転送元の部分領域からデータを読み出してバッファ130への格納し、また、バッファ130に格納されたデータを読み出して書き込み決定部310によって決定された転送先の部分領域への書き込みを行なう。
バッファ130は、転送元から読み出されたデータを一時的に保持し、さらに転送先に書き込まれた時点で消去される。バッファ130のサイズは、32バイト(2ページ分)とする。
<部分領域判定部211の構成例>
図5は、部分領域判定部211の詳細な構成例を示すブロック図である。同図のように部分領域判定部211は、減算器211a、比較器211b、セレクタ211cとからなる。
【0030】
減算器211aは、ページサイズに相当する定数(10H)から、REMAIN_R_A_201の下位4ビットを減算する。この減算結果は、REMAIN_R_A_201から直近のページ境界までのバイト数を意味し、本実施の形態では図6に示すように4種類の値の何れかになる。
比較器211bは、減算結果のバイト数(図中のA)と、REMAIN_R_SIZE_202(図中のB)との大小関係を比較する。
【0031】
セレクタ211cは、REMAIN_R_SIZE_202の方が減算結果よりも大きい場合には減算結果を選択し、そうでない場合(つまり未読み出しのデータが直近のページ境界より手前までしか存在しない場合)にはREMAIN_R_SIZE_202を選択し、選択結果を次に読み出すべき部分領域のデータサイズPARTIAL_R_SIZE_213としてサイズレジスタ213に出力する。
【0032】
このようにして1つの部分領域のデータサイズが決定される。また部分領域の先頭アドレスは、REMAIN_R_A_201(アドレスカウンタ201によって更新される)がそのものである。REMAIN_R_A_201は、セレクタ211cの出力がサイズレジスタ213に設定されるのと同時に、PARTIAL_R_A_212としてアドレスレジスタ212に設定される。
<部分領域判定部311>
部分領域判定部311も図7、8に示すような構成により転送先の部分領域を順次判別する。図7、8は、図5、図6に示した部分領域判定部211とほぼ同様の構成であるので、説明を省略する。
<動作説明>
以上のように構成された本発明の第1の実施の形態におけるDMA転送装置1について、その動作を説明する。
【0033】
図9は、図3、4に示した転送元、転送先の記憶領域間において、DMA転送する様子を示す説明図である。この場合、CPU2は、モード設定部100にTDMA転送要求として、TRANSFER_SIZE_101=28(バイト、10進)、SRC_A_102=500C(16進)、DST_A_103=6008(16進)を設定し、レジスタ104にはアドレッシングモードとして転送元、転送先ともにアドレス昇順を、レジスタ105にはアクセスサイズとして4バイト)を設定する。
【0034】
この設定を受けて、DMA転送装置1は、転送元の記憶領域からの読み出し(SDRAM4→バッファ130)を同図の(1)(2)(4)の部分領域毎に、転送先の記憶領域への書き込み(バッファ130→SDRAM4)を同図の(3)(5)(6)の部分領域毎に、数字の順に行なう。
図10は、図9のDMA転送のタイミングを示すタイムチャートである。同図において、XBRDはリード信号(負論理)、XBWTはライト信号(負論理)、ADRはアドレス、SIZEはアクセスサイズ、DATAはリード/ライトデータ、XACKはアクノリッジ信号を意味する。これらの信号は、アクセス制御部120とSDRAM I/F3との間で入出力される。以下、順を追って説明する。
【0035】
(1) DMA転送要求の設定により読み出し管理部200は、REMAIN_R_A_201=500C(16進)、REMAIN_R_SIZE_202=28(10進)を初期値として保持する。また、書き込み管理部300は、REMAIN_W_A_301=6008、REMAIN_W_SIZE_302=28を初期値として保持する。
読み出し決定部210は、読み出し管理部200のREMAIN_R_A_201、REMAIN_R_SIZE_202及びアドレッシングモード(アドレス昇順)、アクセスサイズに基づいて、最初の部分領域のサイズを判別する。最初の部分領域は、図5の転送元のワード▲1▼を記憶する領域と判別され、その結果、アドレスレジスタ212、サイズレジスタ213は、PARTIAL_R_A_212=500C(16進)、PARTIAL_R_SIZE_213=4(10進)に設定される。
【0036】
これと並行して、書き込み決定部310は、同様に、転送先のワード▲1▼▲2▼の記憶領域を最初の部分領域と判別し、アドレスレジスタ312にPARTIAL_W_A_312=6008を、サイズレジスタ313にPARTIAL_W_SIZE_313=8を設定する。
このようにして転送元の部分領域と転送先の部分領域とが設定された後、アクセス決定部110は、バッファ管理部111により管理されているバッファ130のデータ量が0なので、読み出し決定部210により設定された転送元の部分領域の読み出しをアクセス制御部120に指示する。
【0037】
この指示を受けてアクセス制御部120は、転送元の最初の部分領域(図中のワード▲1▼を記憶する領域)からデータを読み出しバッファ130に書き込む(図9、図10の(1))。
(2) 転送元の最初の部分領域(ワード▲1▼)の読み出し完了後、アクセス制御部120は、読み出し決定部210に読み出しを完了した旨を通知し、さらに読み出し決定部210は、PARTIAL_R_SIZE_213を読み出しを完了したサイズとして読み出し管理部200に通知する。
【0038】
この通知により、読み出し管理部200は、REMAIN_R_A_201、REMAIN_R_SIZE_202を、5010h、24(バイト)に更新する。一方書き込み決定部310は、アクセス制御部120から書き込みを完了した旨の通知を受けていないので、更新することなくPARTIAL_W_A_312=6008、PARTIAL_W_SIZE_313=8のままである。
【0039】
この時点でアクセス決定部110は、バッファ130に1ワードしか格納されていないので、読み出し決定部210により設定された転送元の部分領域の読み出しをすると決定し、その旨をアクセス制御部120に指示する。
この指示を受けてアクセス制御部120は、転送元の2番目の部分領域(ワード▲2▼〜▲5▼)からデータを高速ページアクセスにより読み出してバッファ130に書き込む(図9、図10の(2))。
【0040】
(3)転送元の2番目の部分領域の読み出し完了後、読み出し管理部200、読み出し決定部210は、REMAIN_R_A_201=5020(16進)、REMAIN_R_SIZE_202=8(10進)、PARTIAL_R_A_212=5020(16進)、PARTIAL_R_SIZE_213 サイズレジスタ213=8に更新する。
この時点でアクセス決定部110は、バッファ130に5ワード格納されているので、書き込み決定部310により設定された転送先の最初の部分領域の読み出しをすると決定し、その旨をアクセス制御部120に指示する。
【0041】
この指示を受けてアクセス制御部120は、バッファ130からデータを読み出し転送先の最初の部分領域(ワード▲1▼▲2▼)に連続アクセスにより書き込む(図9、図10の(3))。
(4)〜(6)以下、同様にDMA転送装置1は図9、図10の(4)の部分領域の読み出し、(5)の部分領域の書き込み、(6)の部分領域の書き込みを順次行なう。
【0042】
このように、DMA転送装置1は図9の(2)の読み出し、(3)の書き込み(4)の読み出し、(5)の書き込みでは、高速ページアクセスを行なう。
つまり、DMA転送装置1転送元、転送先それぞれについて、最初と最後の部分領域以外の部分領域に対しては1ページを単位として高速ページアクセスを行い、また、最初と最後の部分領域でも2ワード以上の場合に高速ページアクセスを行なう。これにより、DMA転送装置1は高速にDMA転送を完了することができる。また、バッファ130の記憶容量は少なくとも2ページ分(より正確には(2ページのサイズ)−(1ワード))だけでよい。
【0043】
なお、上記実施の形態では、転送元及び転送先の両者がSDRAM4である場合を説明したが、いれか一方がSDRAM4である場合には、SDRAM4に対して部分領域毎にアクセスすればよい。
<第2の実施の形態>
本実施の形態のDMA転送システムは、バッファ130を共用する複数のDMAチャネルを有し、異なるDMAチャネルのDMA転送要求が競合していない場合には、各DMAチャネルともに第1の実施の形態と同様に部分領域毎にアクセスし、DMA転送要求が競合する場合(DMA転送中により優先度の高い他のDMAチャネルのDMA転送要求が発行された場合)には、DMA転送を中断して、優先度の高いDMA転送を実行してから、元のDMA転送を再開する。この中断については、DMA転送システムは、優先度の低い実行中のDMA転送のバッファに残されたデータを、部分領域毎のアクセスではなくページ境界とは無関係に順次転送先に書き込んでバッファを空にしてから、DMA転送を中断する。
【0044】
図11は、本発明の第2の実施の形態におけるDMA転送システムの構成を示すブロック図である。このDMA転送システムは、DMAチャネル0に対応するDMA転送装置6、DMAチャネル1に対応するDMA転送装置7、バッファ130、アクセス要求調停部1400から構成される。DMAチャネル1の優先度はDMAチャネル0の優先度よりも高いものとする。
【0045】
アクセス要求調停部1400は、DMA転送装置6からのDMAチャネル0のアクセス要求と、DMA転送装置7からのDMAチャネル1のアクセス要求とが入力され、両者が競合する場合にはそれらを調停する。ここでアクセス要求とは、上記部分領域又はページ境界を含むメモリ領域に対するリード又はライトの要求をいう。
【0046】
具体的には、アクセス要求調停部1400は、DMA転送装置6、7にDMAチャネル0、1の未完了のDMA転送要求が設定されているか否かを判定する。この判定は、例えば、書き込み管理部1300、書き込み管理部2300にそれぞれ保持されている未書き込みデータサイズ(REMAIN_W_SIZE_1302、REMAIN_W_SIZE_2302)が0であるか否かによる。
【0047】
判定の結果、一方のDMAチャネルのDMA転送要求が設定されている場合には、アクセス要求調停部1400は、そのチャネルのアクセス要求を受け付け、SDRAM I/F3に出力する。
DMAチャネル1のDMA転送中により優先度の低いDMAチャネル0のDMA転送要求が設定された場合、アクセス要求調停部1400は、DMAチャネル1のDMA転送が完了してから、DMAチャネル0のアクセス要求を受け付け、SDRAM I/F3に出力する。
【0048】
DMAチャネル0のDMA転送中により優先度の高いDMAチャネル1のDMA転送要求が設定された場合、アクセス要求調停部1400は、DMA転送装置6に中断指示を出力し、中断指示に応じてDMA転送装置6からバッファ130が空になった旨の通知を受けると、DMA転送装置7からDMAチャンネル1のアクセス要求を受け付けSDRAM I/F3に出力する。これによりDMAチャネル1のD間転送が完了すると、DMA転送装置6に再開指示を出力する。
【0049】
DMA転送装置6は、モード設定部1100、アクセス決定部1110、アクセス制御部1120、読み出し管理部1200、読み出し決定部1210、書き込み管理部1300、書き込み決定部1310から構成される。
このうちモード設定部1100、読み出し管理部1200、読み出し決定部1210、書き込み管理部1300は、図2に示したモード設定部100、読み出し管理部200、読み出し決定部210、書き込み管理部300と同じ構成要素である。以下同じ構成要素については説明を省略し、異なる点を中心に説明する。
【0050】
アクセス決定部1110は、図2に示したアクセス決定部110と同じ機能を有し、加えて、アクセス要求調停部1400からアクセス制御部1120を介してDMA転送の中断指示、再開指示により転送中のDMAを中断、再開するよう構成される。図12に示すようにアクセス決定部1110は、バッファ管理部1111、リード/ライト決定部1112から構成される。
【0051】
バッファ管理部1111は、図2に示したバッファ管理部111と同様にバッファ130のデータ量を管理する。
リード/ライト決定部1112は、図2に示したリード/ライト決定部112と比べて次の機能が追加されている。
すなわち、リード/ライト決定部1112は、アクセス制御部1120から中断指示を受けた場合に、以後リードを行なうという決定を行なわず、部分領域判定部1311の動作を一時的に禁止し、バッファ管理部1111に算出されたデータ量を書き込み決定部1310に通知し、サイズレジスタ1313に当該データ量を設定する。さらに、バッファ管理部1111に算出されたデータ量が”0”になったとき、バッファ130が空になった旨をアクセス制御部1120を介してアクセス要求調停部1400に通知する。
【0052】
また、リード/ライト決定部1112は、DMA転送中にアクセス制御部1120から再開指示を受けた場合に、部分領域判定部1311の動作禁止を解除し、図2に示したリード/ライト決定部112と同様の判定を行なう。
書き込み決定部1310は、図12に示すように部分領域判定部1311、アドレスレジスタ1312、サイズレジスタ1313とからなる。
【0053】
アドレスレジスタ1312、サイズレジスタ1313は、図2に示したアドレスレジスタ312、サイズレジスタ313と同じである。ただし、PARTIAL_W_SIZE_313 サイズレジスタ1313は、リード/ライト決定部1112が中断指示を受けたときは、リード/ライト決定部1112からデータ量を直接設定される。これにより、サイズレジスタ1313には、バッファ130に残っているデータのサイズが設定される。
【0054】
部分領域判定部1311は、リード/ライト決定部1112により一時的に動作を禁止される点以外は、図2に示した部分領域判定部311と同じである。
アクセス制御部1120は、図2に示したアクセス制御部120の機能に加えて、アクセス要求調停部1400から入力される中断指示及び再開指示をアクセス決定部1110に出力し、アクセス決定部1110から入力されるバッファ130が空になった旨の通知をアクセス要求調停部1400に出力する。
【0055】
DMA転送装置7は、モード設定部2100、アクセス決定部2110、アクセス制御部2120、読み出し管理部2200、読み出し決定部2210、書き込み管理部2300、書き込み決定部2310から構成される。この構成は、図2に示したDMA転送装置1と同じ構成であるので説明を省略する。
<動作説明>
図13は、本実施形態のDMA転送システムにおけるDMA転送のタイミングを示すタイムチャートである。同図において、XBRD、XBWT、ADR、SIZE、DATA、XACKは図10と同じである。同図では、DMA転送装置6(DMAチャネル0)には図3、4、10と同様のDMA転送要求が設定され、同図のT1のタイミングでDMA転送装置7(DMAチャネル1)に他のDMA転送要求が設定された場合のタイミングを示す。
【0056】
同図では、(1)(2)(3)は、図10と同様に、DMAチャネル0の転送元の部分領域からの読み出し(1)(2)と、転送先の部分領域への書き込み(3)のタイミングを示している。
部分領域への書き込み(3)の実行中に優先度の高いDMAチャネル1のDMA転送要求がモード設定部2100に設定されたものとする。
【0057】
アクセス要求調停部1400は、DMAチャネル1のDMA転送要求が設定されいると判定し、既にDMAチャネル0のDMA転送要求が設定されているので、DMA転送装置6に中断指示を出す。この中断指示により、DMA転送装置6内のリード/ライト決定部1112は、同図の(3)が完了したとき、新たにリードを行なうと決定しないで、バッファ130内に存在するデータ量をサイズレジスタ1313に設定して、ライトを行なうと決定する。これによりアクセス制御部1120は、DMAチェネル0の転送データでバッファ130に残っているデータの全てを転送先の記憶領域に書き込む(同図(7))。
【0058】
この書き込み完了後、リード/ライト決定部1112は、バッファ130が空になった旨をアクセス要求調停部1400に通知する。この通知を受けてアクセス要求調停部1400は、DMAチャネル1に対するアクセス要求を優先してDMA転送装置7から受付けて、SDRAM I/F3に出力する(同図(8))。
【0059】
この後、アクセス要求調停部1400は、DMAチャネル1のDMAデータ転送が完了している判定した場合、DMA転送装置6に再開指示を出す。
このように本実施の形態におけるDMAデータ転送システムによれば、各チャネル毎に独立したバッファを備える必要がなく、回路規模を抑えたままデータ転送中に他のチャネルから優先度の高いDMA転送要求が発生した場合に実行中のDMA転送を一時中断して、優先度の高いDMA転送要求を先に処理することができる。
<第3の実施の形態>
図14は、本発明の第3の実施の形態におけるDMA転送装置8の構成を示すブロック図である。同図は、図2と比べて、アクセス決定部110、書き込み管理部300、アクセス制御部120、バッファ130の代わりにそれぞれアクセス決定部4110、アクセス制御部4120、バッファ4130を備えている点が異なっている。図2と同じ符号の構成要素は同じ機能を有するので説明を省略し、以下異なる点を中心に説明する。
【0060】
バッファ4130は、書き込みと読み出しとの並行動作可能な2ポートメモリである。バッファ4130の2つのポートは異なるバスに接続されている。1つのポートはSDRAM I/F3を介してSDRAM4に接続され、他のポートはSDRAM I/F4003を介してSDRAM4004に接続される。いずれのポートからも読み出し動作と書き込み動作とが可能である。一方のポートからの書き込み動作と同時に他方のポートからの読み出し動作が可能である。
【0061】
アクセス決定部4110は、バッファ4130に保持されているデータ量(バイト数)をバッファ4130から直接取得して管理する。したがって、バッファ4130に1ワードの書き込み及び読み出しが行われる毎に、アクセス決定部4110は、データ量を更新することになる。さらに、アクセス決定部411は、読み出し決定部210に決定された部分領域のサイズ(PARTIAL_R_SIZE_213)以上の空き領域がバッファ4130に存在すればリードを行なうと決定し、また、書き込み決定部310に決定された部分領域のサイズ(PARTIAL_W_SIZE_313)以上のデータがバッファ4130に存在すればライトを行なうと決定する。転送元部分領域のリードの決定と、転送先の部分領域のライトの決定とは、択一になされるのではなく独立に行われるので、ライトの決定タイミングが第1の実施の形態に比べて早くなる。
【0062】
アクセス制御部4120は、SDRAM4とSDRAM4004に対する読み出しと書き込みとを並行して行なう。すなわち、アクセス制御部4120は、読み出し決定部210により決定された部分領域の読み出しを行い、これと並行して、書き込み決定部4310から入力されるアドレスに基づいて転送先領域に書き込みを行なう。
<動作説明>
図15は、本実施形態のDMA転送装置におけるDMA転送のタイミングを示すタイムチャートである。
【0063】
同図において上半分はアクセス制御部4120からSDRAM I/F3に出力される信号群を、下半分はSDRAM I/F4003に出力される信号群を示している。また、転送元はSDRAM4の5008番地から7ワード分の領域、転送先はSDRAM4004の600C番地から7ワード分の領域としている。
【0064】
図15と図10とを比較すると、図15では部分領域への書き込み(同図(3)(5)(6))の開始タイミングが早くなっている。これは、アクセス決定部4110がバッファ4130に保持されているデータ量をワード単位に管理しているので、アクセス決定部4110は、転送先の部分領域への書き込みデータサイズ分のデータがバッファ4130に書き込まれた時点でライトを決定することができるからである。
【0065】
このように本実施の形態におけるDMA転送装置によれば、部分領域毎に高速ページアクセスを行なうことに加えて、転送元メモリと転送元メモリが異なるバスに接続されている場合に、転送元メモリからの読み出しと、転送先メモリへの書き込みを並列に実行することができる。
<第4の実施の形態>
第2の実施の形態ではDMAチャネル0、1ともに同一のメモリ(SDRAM4)又は同一バス上の異なるメモリを転送対象としていたが、本実施形態では、異なるバス上のメモリも転送対象とするDMA転送システムについて説明する。
【0066】
図16は、本発明の第4の実施の形態におけるDMA転送システムの構成を示すブロック図である。同図は、第2の実施の形態における図11と比較して、アクセス要求調停部1400の代わりにアクセス要求調停部4400を、バッファ130の代わりにバッファ4130を備える点が異なっている。図11と同じ符号の構成要素は同じ機能であるので説明を省略し、以下異なる点を中心に説明する。
【0067】
バッファ4130は、書き込みと読み出しとの並行動作可能な2ポートメモリである。バッファ4130の2つのポートは異なるバスに接続されている。1つのポートはSDRAM I/F3を介してSDRAM4に接続され、他のポートはSDRAM I/F4003を介してSDRAM4004に接続される。いずれのポートからも読み出し動作と書き込み動作とが可能である。
【0068】
図17にバッファ4130の構成例を示す。同図のバッファ4130は、マルチプレクサ4130a、FIFO4130b、デマルチプレクサ4130マルチプレクサ4130a、FIFO4130b、デマルチプレクサ4130cとからなる。ポート0、1は、いずれもマルチプレクサ4130a及びデマルチプレクサ4130cに接続されている。これにより、バッファ4130は、一方のポートからの書き込み動作と他方のポートからの読み出し動作とを並列実行可能である。
【0069】
アクセス要求調停部4400は、DMAチャネル0のDMA転送中に優先度の高いDMAチャネル1の転送要求が設定され、かつ、DMAチャネル0の転送先メモリとDMAチャネル1の転送元メモリが同じメモリ又は同一バス上のメモリである場合には、第2の実施形態におけるアクセス要求調停部1400と同じ動作を行う。
【0070】
また、アクセス要求調停部4400は、DMA転送中に他のDMAチャネルの転送要求が設定され、転送先メモリとDMAチャネルの転送元メモリが異なるバス上のメモリである場合には、DMA転送における全転送データについての転送元からの読み出しが完了し、かつ、バッファ4130にDMAチャネルの最初の部分領域の読み出しサイズ分の空き領域が存在するという状態になった時点で、DMAチャネルの最初の部分領域の読み出しを開始する。
【0071】
図18(a)〜図18(f)に、DMAチャンネル0の転送先とDMAチャネル1の転送元とが異なるメモリである場合を示す。同図においてSRC0、DST0はDMAチャネル0の転送元の記憶領域、転送先の記憶領域を、SRC1、DST1はDMAチャネル1の転送元の記憶領域、転送先の記憶領域をそれぞれ示す。また、図中の▲1▼を付した破線は、DMAチャネル0の最後の部分領域の読み出し(メモリ→バッファ4130)を、▲2▼の矢線はDMAチャネル0の最後の部分領域の書き込み(バッファ4130→メモリ)を意味する。また▲3▼の矢線はDMAチャネル1の最初の部分領域の読み出し(メモリ→バッファ4130)を意味する。アクセス要求調停部4400は、▲2▼と▲3▼とが異なるバスに接続された2つのメモリへの書き込みと読み出しであるので並列実行する。
<動作説明>
図19は、図18(a)の場合の動作例を示すタイムチャートである。
【0072】
同図において上半分はアクセス要求調停部4400からSDRAM I/F3に出力される信号群を、下半分はSDRAM I/F4003に出力される信号群を示している。図中の▲1▼▲2▼▲3▼は図18(a)の▲1▼▲2▼▲3▼に対応する。
同図のようにアクセス要求調停部4400は、DMAチャネル0のDMA転送中に、DMAチャネル1の転送要求が設定され、DMAチャンネル0の転送先とDMAチャネル1の転送元とが異なるメモリ(SDRAM4と4004)である場合には、DMAチャネル0の全転送データについて転送元からの読み出しが完了し(図中▲1▼の完了時点)、かつ、バッファ4130にDMAチャネル1の最初の部分領域の読み出しサイズ分の空き領域が存在するという状態になった時点で(図中▲3▼の開始時点)、DMAチャネル1の最初の部分領域の読み出しを開始するように制御する。
【0073】
以上のように本実施の形態におけるDMA転送システムによれば、DMA転送中に他のDMAチャネルのDMA転送要求が設定され、先行する転送中の転送先メモリと、新たに設定されたDMA転送要求の転送先メモリとが異なるバスに接続されている場合に、アクセス要求調停部4400は、先行するDMA転送の最後の部分領域の読み出しが完了し、かつバッファ4130に他のDMAチャネルの最初の部分領域のサイズ分の空きが生じた時点で、新たなDMA転送要求の読み出しを開始するので、連続する2つのDMA転送要求によるバス使用効率を向上させることができる。
【0074】
なお、図18(a)〜(f)では、DMAチャネル0のDMA転送中にDMAチャネル1のDMA転送要求が設定された場合を示しているが、逆の場合つまりDMAチャネル1のDMA転送中にDMAチャネル0のDMA転送要求が設定された場合も、先行するDMA転送の転送先メモリと新たなDMA転送の転送元メモリとが異なるバス上にある限り同様である。
【0075】
本実施の形態におけるDMA転送システムは、3つ以上のDMA転送装置を備える構成としてもよい。その場合、アクセス要求調停部は、全てのDMA転送装置から最後の部分領域の読み出しを完了したことを検出し、かつ、各DMA転送装置における転送先と転送元のメモリを判別し、それらに基づいて図19のような制御を行うようにすればよい。
<その他>
なお、上記各実施の形態において、転送元及び転送先が何れも高速ページアクセス可能なメモリであることを前提に説明したが、転送元及び転送先の一方が高速ページアクセス可能なメモリである場合には、高速ページアクセス可能なメモリに対してのみ、ページ境界で区切られた部分領域毎にアクセスすることになる。例えば、高速ページアクセス可能なメモリと、固定アドレスが割り当てられたI/Oとの間のDMA転送であっても、メモリに対する高速ページアクセスを保証することができ、かつバッファ130又は4130のバッファ容量が少なくてもよい。
【0076】
また、上記第1の実施の形態において減算器211aの代わりに、図6のREMAIN_R_A_201の下位4ビットを入力し、減算結果と同じ値を出力する入出力論理をもつ論理回路又はテーブルを備えてもよい。
【0077】
【発明の効果】
(1)本発明のDMA転送装置は、高速ページアクセスに対応するメモリを対象とするDMA転送装置であって、転送対象となるメモリ領域を構成する複数の部分領域であって、前記メモリ領域の先頭とページ境界との間、ページ境界間及びページ境界と前記メモリ領域の末尾との間の各部分領域を判別する判別手段と、判別された部分領域毎に高速ページアクセスを行なうアクセス手段とを備える。
【0078】
この構成によれば、DMA転送装置は、転送元と転送先の少なくとも一方が高速ページアクセス可能なメモリである場合に、転送対象のメモリ領域内においてページ境界により区切られた部分領域毎に、高速ページアクセスすることを保証できる。その結果、本DMA転送装置は、メモリの性能を犠牲にすることなく、高速ページアクセス可能なメモリと相性が良く、バスの遊休期間を低減しDMA転送時間を短縮することができる。
【0079】
(2)前記判別手段は、転送対象となる領域の先頭アドレスを初期値として保持し、アクセス手段により高速ページアクセスがなされる毎に、保持内容を転送対象のメモリ領域のうち未転送の領域の先頭アドレスに更新するアドレス更新手段と、転送対象となる領域のデータサイズを初期値として保持し、アクセス手段により高速ページアクセスがなされる毎に保持内容を、転送対象のデータサイズのうちの未転送データサイズに更新するデータサイズ更新手段と、アドレス更新手段に初期値として保持される先頭アドレスから直近のページ境界までの部分領域を判別し、アドレス更新手段が更新する毎に、更新後の先頭アドレスから直近のページ境界又は前記メモリ領域の末尾までの次の部分領域を判別する部分領域判別手段とを備えるように構成してもよい。
【0080】
この構成によれば、判別手段は、高速ページアクセスがなされる毎に、転送対象のメモリ領域の先頭から直近のページ境界までの部分領域、そのページ境界から次のページ境界までの部分領域、・・・、ページ境界から前記メモリ領域の末尾までの部分領域というように複数の部分領域を順次判別することと、アクセス手段が各部分領域に対して高速ページアクセスすることとを並行して行なうことができる。
【0081】
(3)前記部分領域判別手段は、アドレス更新手段に保持された先頭アドレスから直近のページ境界または前記メモリ領域の末尾までのサイズを判別するサイズ判別手段と、サイズ判別手段により判別されたサイズを部分領域のサイズとして保持するサイズ保持手段とを備え、前記アクセス手段は、アドレス更新手段に保持されてい先頭アドレスからサイズ保持手段に保持されたサイズ分の部分領域を高速ページアクセスするように構成してもよい。
【0082】
この構成によれば、部分領域判定手段は、先頭アドレスとサイズとの組みというパラメータにより表される部分領域を判別するので、アクセス手段に高速ページアクセスに適したパラメータを出力することができる。
(4)前記サイズ判別手段は、ページ領域のサイズから、アドレス更新手段に保持された先頭アドレスの下位ビットであってページ領域内の相対位置を表す下位ビットを減算することにより、直近のページ境界までのサイズを算出する減算手段と、減算手段により算出されたサイズと、データサイズ更新手段に保持された未転送データサイズとを比較する比較手段と、比較手段の比較の結果、大きくない方を選択する選択手段とを備え、前記サイズ保持手段は、選択手段の選択結果を部分領域のサイズとして保持する構成としてもよい。
【0083】
この構成によれば、サイズ判定手段は、減算と比較という簡単な構成により部分領域のサイズを判別することができる。
(5)また、本発明のDMA転送装置は、高速ページアクセスに対応するメモリを転送対象とするDMA転送装置であって、転送元となる第1メモリ領域を構成する複数の転送元部分領域であって、前記第1メモリ領域の先頭、ページ境界及び前記第1メモリ領域の末尾の何れかとページ境界とにより区切られた複数の転送元部分領域を判別する第1判別手段と、転送先となる第2メモリ領域を構成する複数の転送先部分領域であって、前記第2メモリ領域の先頭、ページ境界及び前記第2メモリ領域の末尾の何れかとページ境界とにより区切られた複数の転送先部分領域を判別する第2判別手段と、第1判別手段に判別された転送元部分領域から高速ページアクセスによりデータを読み出し、第2判別手段により判別された転送先部分領域に読み出されたデータを高速ページアクセスにより書き込むアクセス手段とを備える。
【0084】
この構成によれば、DMA転送装置は、転送元と転送先とが高速ページアクセス可能なメモリである場合に、転送対象の第1、第2メモリ領域内においてページ境界により区切られた転送元部分領域、転送先部分領域毎に、高速ページアクセスすることを保証できる。その結果、本DMA転送装置は、メモリの性能を犠牲にすることなく、高速ページアクセス可能なメモリと相性が良く、バスの遊休期間を低減しDMA転送時間を短縮することができる。
【0085】
(6)前記第1判別手段は、第1メモリ領域の先頭アドレスを初期値として保持し、アクセス手段のアクセスに応じて保持内容を、第1メモリ領域のうち未転送の領域の先頭アドレスに更新する第1アドレス更新手段と、第1メモリ領域のデータサイズを初期値として保持し、アクセス手段のアクセスに応じて保持内容を、第1メモリ領域のデータサイズのうちの未転送データサイズに更新する第1データサイズ更新手段と、第1アドレス更新手段に初期値として保持された先頭アドレスから直近のページ境界までの転送元部分領域を判別し、第1アドレス更新手段が更新する毎に、更新後の先頭アドレスから直近のページ境界又は前記第1メモリ領域の末尾までの次の転送元部分領域を判別する第1部分領域判別手段とを備える。
【0086】
この構成によれば、第1判別手段は、高速ページアクセスがなされる毎に、第1メモリ領域の先頭から直近のページ境界までの転送元部分領域、そのページ境界から次のページ境界までの転送元部分領域、・・・、ページ境界から前記第1メモリ領域の末尾までの転送元部分領域というように複数の転送元部分領域を順次判別することと、アクセス手段が各転送元部分領域に対して高速ページアクセスすることとを並行して行なうことができる。
【0087】
(7)また、前記第1部分領域判別手段は、第1アドレス更新手段に保持された先頭アドレスから直近のページ境界または前記第1メモリ領域の末尾までのデータサイズを判別する第1サイズ判別手段と、第1サイズ判別手段により判別されたサイズを転送元部分領域のサイズとして保持する第1サイズ保持手段とを備える。前記アクセス手段は、第1アドレス保持手段に保持された先頭アドレスから、第1サイズ保持手段に保持されたサイズ分の転送元部分領域を高速ページアクセスにより読み出す。
【0088】
この構成によれば、第1部分領域判定手段は、先頭アドレスとサイズとの組みというパラメータにより表される部分領域を判別するので、アクセス手段に高速ページアクセスに適したパラメータを出力することができる。
(8)前記第1サイズ判別手段は、ページ領域のサイズから、第1アドレス更新手段に保持された先頭アドレスの下位ビットであってページ領域内の相対位置を表す下位ビットを減算することにより、直近のページ境界までのサイズを算出する第1減算手段と、第1減算手段により算出されたサイズと、第1データサイズ更新手段に保持された未転送データサイズとを比較する第1比較手段と、第1比較手段の比較の結果、大きくない方を選択する第1選択手段とを備え、前記第1サイズ保持手段は、第1選択手段の選択結果を部分領域のサイズとして保持する。
【0089】
この構成によれば、第1サイズ判定手段は、減算と比較という簡単な構成により部分領域のサイズを判別することができる。
(9)前記第2判別手段は、第2メモリ領域の先頭アドレスを初期値として保持し、アクセス手段のアクセスに応じて保持内容を、第2メモリ領域のうち未転送の領域の先頭アドレスに更新する第2アドレス更新手段と、第2メモリ領域のデータサイズを初期値として保持し、アクセス手段のアクセスに応じて保持内容を、第2メモリ領域のデータサイズのうちの未転送データサイズに更新する第2データサイズ更新手段と、第2アドレス更新手段に初期値として保持された先頭アドレスから直近のページ境界までの転送先部分領域を判別し、第2アドレス更新手段が更新する毎に、更新後の先頭アドレスから直近のページ境界又は前記第2メモリ領域の末尾までの次の転送先部分領域を判別する第2部分領域判別手段とを備える。
【0090】
この構成によれば、第2判別手段が第2メモリ領域の先頭から直近のページ境界までの部分領域、そのページ境界から次のページ境界までの部分領域、・・・、ページ境界から前記メモリ領域の末尾までの部分領域というように複数の部分領域を順次判別することと、アクセス手段が各部分領域に対して高速連続アクセスすることとを並行して行なうことができる。
【0091】
(10)前記第2部分領域判別手段は、第2アドレス更新手段に保持された先頭アドレスから直近のページ境界または前記第2メモリ領域の末尾までのサイズを判別する第2サイズ判別手段と、第2サイズ判別手段により判別されたサイズを転送先部分領域のサイズとして保持する第2サイズ保持手段とを備え、前記アクセス手段は、第2アドレス保持手段に保持された先頭アドレスから、第2サイズ保持手段に保持されたサイズ分の転送先部分領域を高速ページアクセスに書き込む。
【0092】
この構成によれば、第2部分領域判別手段は、転送対象のメモリ領域の先頭から直近のページ境界までの部分領域、そのページ境界から次のページ境界までの部分領域、・・・、ページ境界から前記メモリ領域の末尾までの部分領域というように複数の部分領域を順次判別することと、アクセス手段が各部分領域に対して高速連続アクセスすることとを並行して行なうことができる。
【0093】
(11)前記第2サイズ判別手段は、ページ領域のサイズから、第2アドレス更新手段に保持された先頭アドレスの下位ビットであってページ領域内の相対位置を表す下位ビットを減算することにより、直近のページ境界までのサイズを算出する第2減算手段と、第2減算手段により算出されたサイズと、第2データサイズ更新手段に保持された未転送データサイズとを比較する第2比較手段と、第2比較手段の比較の結果、大きくない方を選択する第2選択手段とを備え、前記第2サイズ保持手段は、第2選択手段の選択結果を部分領域のサイズとして保持する。
【0094】
この構成によれば、第2サイズ判定手段は、減算と比較という簡単な構成により部分領域のサイズを判別することができる。
(12)また、本発明のDMA転送装置は、転送元となる第1メモリ領域を構成する複数の転送元部分領域であって、前記第1メモリ領域の先頭とページ境界との間、ページ境界間及びページ境界と前記第1メモリ領域の末尾との間の各転送元部分領域を判別する第1判別手段と、転送先となる第2メモリ領域を構成する複数の転送先部分領域であって、前記第2メモリ領域の先頭とページ境界との間、ページ境界間及びページ境界と前記第2メモリ領域の末尾との間の各転送先部分領域を判別する第2判別手段と、第1判別手段に判別された転送元部分領域から高速ページアクセスによりデータを読み出してバッファ手段に格納し、バッファ手段に格納されたデータを第2判別手段により判別された転送先部分領域に高速ページアクセスにより書き込むアクセス手段とを備える。
【0095】
この構成によれば、DMA転送装置は、転送元と転送先の両者が高速ページアクセス可能なメモリである場合に、転送元の第1メモリ領域内においてページ境界により区切られた転送元部分領域毎に高速ページアクセスによる読み出しをすることを保証できる。加えて、転送先の第2メモリ領域内においてページ境界により区切られた転送先部分領域毎に高速yージアクセスによる書き込みをすることを保証できる。その結果、バスの遊休期間を低減しDMA転送時間を短縮することができる。
【0096】
(13)また、前記第1メモリ領域と第2メモリ領域とは、同一メモリ内の領域又は同じバスに接続された異なるメモリ内の領域であって、前記アクセス手段は、バッファ手段に保持されているデータのサイズ及びバッファ手段の空きサイズと、転送元部分領域のサイズ及び転送先部分領域のサイズとを比較して、比較結果に応じて転送元部分領域の読み出しと転送先部分領域の書き込みの何れを行なうかを決定するリード/ライト決定手段と、リード/ライト決定手段の決定に従って転送元部分領域からの読み出しと転送先部分領域への書き込みとを行なうアクセス制御手段とを備える。
【0097】
(14)前記バッファ手段は、ページ領域の2倍からメモリのアクセスサイズを引いた容量を少なくとも有し、前記リード/ライト決定手段は、バッファ手段の空きサイズが第1判別手段により判別された転送元部分領域のサイズ以上である場合はリードを行なうと判定し、バッファ管理手段に取得されたデータサイズが、第2判別手段により判別された転送先部分領域のサイズ以上である場合は、ライトを行なうと決定する。
【0098】
この構成によれば、転送元部分領域毎に高速ページアクセスによる読み出しを行い、転送先部分領域毎にも高速ページアクセスによる書き込みをすることを保証できる。さらに、バッファ手段の記憶容量は、ページ領域の2倍からメモリのアクセスサイズを引いた容量を少なくとも有するだけでよいので、少ないバッファ容量で効率よくDMA転送を実現できる。
【0099】
(15)前記バッファ手段は2つのバスに接続される2ポートメモリであり、前記第1メモリ領域と第2メモリ領域とは、異なるバスに接続されたメモリ内の領域であり、前記アクセス手段は、バッファ手段に保持されているデータのサイズとバッファ手段の空きサイズとに応じて、転送元部分領域からの読み出しを行なうか否かと決定し、これと独立に、転送先部分領域への書き込みを行なうか否かを決定するリード/ライト決定手段と、リード/ライト決定手段の決定に従って転送元部分領域からの読み出しと転送先部分領域への書き込みとを行なうアクセス制御手段とを備える。
【0100】
この構成によれば、転送元の第1メモリ領域と転送先の第2メモリ領域とが異なるバスに接続されたメモリ内の領域である場合に、ページ境界で区切られた転送元部分領域からバッファへの転送と、バッファから転送先部分領域への転送とを並行して行うことができ、しかも、少ないバッファ容量で効率よくDMA転送を実現できる。
【0101】
(17)本発明は、優先度が異なる複数のDMAチャネルを有するDMA転送システムであって、DMAチャネル毎に設けられ、対応するDMAチャネルのDMA転送要求を受付け、DMA転送の完了までDMA転送要求を保持する複数の受付手段と、DMAチャネル毎に設けられ、対応するDMAチャネルのDMA転送要求に指定された転送対象のメモリ領域について、当該メモリ領域を構成する複数の部分領域であって、前記メモリ領域の先頭とページ境界との間、ページ境界間及びページ境界と前記メモリ領域の末尾との間の各部分領域を判別する複数の判別手段と、DMAチャネル毎に設けられ、対応するDMAチャネルの判別手段により判別された部分領域毎に高速ページアクセスを指示するアクセス要求を生成する複数のアクセス要求生成手段と、各DMAチャネルに共用され、転送すべきデータを一時的に保持するバッファ手段と、調停手段とを備える。ここで、調停手段は、複数の受付け手段において、ただ1つのDMAチャネルに対するDMA転送要求が保持されている場合には、当該DMAチャネルに対応するアクセス要求に従ってアクセスを行い、DMA転送要求が保持されていて、かつ、優先度の高いDMAチャネルに対するDMA転送要求が受付けられた場合には、先行するDMA転送要求のDMAチャネルに対応する判別手段及びアクセス要求生成手段に対してバッファ手段を空にしてから中断するよう指示し、バッファ手段が空になった時点で優先度の高いDMAチャネルのアクセス要求に従ってアクセスを行い、優先度の高いDMA転送完了後に、先行するDMA転送要求のDMAチャネルに対応する判別手段及びアクセス要求生成手段に対してDMA転送を再開するよう指示する。
【0102】
この構成によれば、転送対象のメモリ領域内においてページ境界により区切られた部分領域毎に、高速ページアクセスすることを保証できるとともに、DMA転送中に優先度の高い他のDMA転送要求が受け付けられた場合に、先行するDMA転送を中断して、優先度の高いDMA転送に切り替えて実行することができる。
【0103】
(18)前記先行するDMAチャネルに対応する判別手段は、調停手段から中断を指示されたとき、バッファ手段に保持されているデータに対応する転送先領域を判別し、前記先行するDMAチャネルに対応するアクセス要求生成手段は、調停手段から中断を指示されたとき、判別手段に判別された転送先領域に対するアクセス要求を生成し、前記調停手段は当該アクセス要求に従って高速ページアクセスを行う。
【0104】
この構成によれば、調停手段から中断を指示されたとき、判別手段がバッファ手段に保持されているデータに対応する転送先領域を判別し、アクセス要求手段が判別された転送先領域にバッファ手段内のデータを書き込むようアクセス要求を生成し、調停手段が当該アクセス要求を実行するので、中断指示後速やかにバッファ手段を空にし、優先度の高いDMAチャネルに移行することができる。
【0105】
(19)前記先行するDMAチャネルに対応する判別手段は、調停手段から再開を指示されたとき、転送対象のメモリ領域中の未転送の領域を構成する部分領域を判別する。
この構成によれば、再開を指示されたとき判別手段は、中断されていた未転送領域から部分領域の判別を再開するので、再開指示の後速やかに元のDMA転送に復帰することができる。
【0106】
(20)また、本発明は、複数のDMAチャネルを有するDMA転送システムであって DMAチャネル毎に設けられ、対応するDMAチャネルのDMA転送要求を受付け、DMA転送の完了までDMA転送要求を保持する複数の受付手段と、DMAチャネル毎に設けられ、対応するDMAチャネルのDMA転送要求に指定された転送対象のメモリ領域について、当該メモリ領域を構成する複数の部分領域であって、前記メモリ領域の先頭とページ境界との間、ページ境界間及びページ境界と前記メモリ領域の末尾との間の各部分領域を判別する複数の判別手段と、DMAチャネル毎に設けられ、対応するDMAチャネルの判別手段により判別された部分領域毎に高速ページアクセスを指示するアクセス要求を生成する複数のアクセス要求生成手段と、各DMAチャネルに共用され、2つのバスに接続された2ポートメモリであるバッファ手段と、調停手段とを備える。ここで、調停手段は、複数の受付け手段において、ただ1つのDMAチャネルに対するDMA転送要求が保持されている場合には、当該DMAチャネルに対応するアクセス要求に従ってアクセスを行い、既にDMA転送要求が保持されていて、かつ、他のDMAチャネルに対するDMA転送要求が受付けられ、かつ、先行するDMA転送の転送先と新たなDMA転送の転送元とが異なるバス上のメモリである場合には、転送中の全転送データについての転送元からの読み出しが完了し、かつ、バッファ手段に他のDMAチャネルの最初の部分領域の読み出しサイズ分の空き領域が存在するという状態になった時点で、他のDMAチャネルの最初の部分領域の読み出しを開始する。
【0107】
この構成によれば、転送対象のメモリ領域内においてページ境界により区切られた部分領域毎に、高速ページアクセスすることを保証できるとともに、先行するDMA転送においてメモリ領域からバッファへの全データの読み出しが終わった後、先行するDMA転送の書き込みと、新たなDMA転送の書き込みとを並列に実行することができる。
【図面の簡単な説明】
【図1】本発明の第1の実施の形態におけるDMA転送装置を備える情報処理装置の主要部の構成を示すブロック図である。
【図2】DMA転送装置の構成を示すブロック図である。
【図3】読み出し決定部によって判別される部分領域の一例を示す。
【図4】書き込み決定部によって判別される部分領域の一例を示す。
【図5】部分領域判定部の詳細な構成例を示すブロック図である。
【図6】ページサイズに相当する定数から、未読み出しの領域の先頭アドレスの下位4ビットを減算した結果であって、当該先頭アドレスからから直近のページ境界までのバイト数を示す図である。
【図7】部分領域判定部の詳細な構成例を示すブロック図である。
【図8】ページサイズに相当する定数から、未書き込みの領域の先頭アドレスの下位4ビットを減算した結果であって、当該先頭アドレスからから直近のページ境界までのバイト数を示す図である。
【図9】図3、4に示した転送元、転送先の記憶領域間において、DMA転送する様子を示す説明図である。
【図10】図9のDMA転送のタイミングを示すタイムチャートである。
【図11】本発明の第2の実施の形態におけるDMA転送システムの構成を示すブロック図である。
【図12】アクセス決定部の詳細な構成を示すブロック図である。
【図13】DMA転送システムにおけるDMA転送のタイミングを示すタイムチャートである。
【図14】本発明の第3の実施の形態におけるDMA転送装置8の構成を示すブロック図である。
【図15】本実施形態のDMA転送装置におけるDMA転送のタイミングを示すタイムチャートである。
【図16】本発明の第4の実施の形態におけるDMA転送システムの構成を示すブロック図である。
【図17】2ポートのバッファの構成例を示す。
【図18】DMAチャンネル0の転送先とDMAチャネル1の転送元とが異なるメモリである場合を示す説明図である。。
【図19】図18(a)の場合の動作例を示すタイムチャートである。
【符号の説明】
1 DMA転送装置
2 CPU
3 SDRAM I/F
4 SDRAM
5 I/O部
100 モード設定部
101〜105 レジスタ
110 アクセス決定部
111 バッファ管理部
112 リード/ライト決定部
120 アクセス制御部
130 バッファ
200 読み出し管理部
201 アドレスカウンタ
202 データカウンタ
210 読み出し決定部
211 部分領域判定部
211a 減算器
211b 比較器
211c セレクタ
212 アドレスレジスタ
213 サイズレジスタ
300 書き込み管理部
301 アドレスカウンタ
302 データカウンタ
310 書き込み決定部
311 部分領域判定部
312 アドレスレジスタ
313 サイズレジスタ
411 アクセス決定部
[0001]
BACKGROUND OF THE INVENTION
DMA data transfer apparatus for guaranteeing continuous access in page units for a memory capable of high-speed page access
[0002]
[Prior art]
A conventional DMA data transfer apparatus transfers data at high speed between a memory and a memory or between a memory and an input / output device.
In the transfer between memories connected to the same bus and the transfer between different storage areas of the same memory, the DMA data transfer apparatus temporarily holds the data read from the transfer source storage area in a buffer in the DMA data transfer apparatus. Further, DMA data transfer is performed by writing from the buffer to the storage area of the transfer destination. This buffer has a capacity equal to or larger than the size of one access to the memory. Conventional typical DMA data transfer performs reading from the transfer source, storing in the buffer, and writing from the buffer to the transfer destination storage area for each data of one access size. This enables DMA data transfer with the minimum necessary buffer size.
[0003]
If the buffer size is a multiple of the access size, the DMA transfer device reads the data from the transfer source until it reaches the buffer size, stores it in the buffer, and transfers the data for the buffer size from the buffer. Write to the destination storage area. In this case, reading and writing are performed in units of buffer size.
[0004]
[Problems to be solved by the invention]
In recent years, SDRAM capable of high-speed page access has been used as a main memory. However, when this SDRAM is a transfer target, there is a problem that the high-speed performance of the SDRAM is sacrificed and its usefulness cannot be fully utilized. It was. This is because the conventional DMA transfer apparatus accesses data regardless of page boundaries in reading from the transfer source to the buffer and writing from the buffer to the transfer destination.
[0005]
An object of the present invention is to provide a useful DMA transfer device that is compatible with a memory capable of high-speed page access and that realizes high-speed DMA transfer without sacrificing performance.
[0006]
[Means for Solving the Problems]
The DMA transfer apparatus according to the present invention is a DMA transfer apparatus for a memory corresponding to high-speed page access, and includes a plurality of partial areas constituting a memory area to be transferred, the top of the memory area and a page A discriminating unit that discriminates each partial region between the borders, between page borders, and between the page border and the end of the memory region; and an access unit that performs high-speed page access for each discriminated partial region.
[0007]
Further, the DMA transfer apparatus of the present invention is a plurality of transfer source partial areas constituting the first memory area as a transfer source, and is between the head of the first memory area and the page boundary, between the page boundaries and between the pages. First discriminating means for discriminating each transfer source partial area between a boundary and the end of the first memory area; and a plurality of transfer destination partial areas constituting a second memory area serving as a transfer destination, A second discriminating means for discriminating each transfer destination partial area between the top of the two memory areas and the page boundary, between the page boundaries and between the page boundary and the end of the second memory area; The data is read from the transfer source partial area by high-speed page access and stored in the buffer means, and the data stored in the buffer means is written to the transfer destination partial area determined by the second determination means by high-speed page access. And a non-access means.
[0008]
The DMA transfer system of the present invention is a DMA transfer system having a plurality of DMA channels having different priorities, provided for each DMA channel, accepting a DMA transfer request for the corresponding DMA channel, and completing the DMA transfer. A plurality of receiving means for holding a DMA transfer request and a transfer target memory area provided for each DMA channel and designated in the DMA transfer request of the corresponding DMA channel are a plurality of partial areas constituting the memory area. A plurality of discriminating means for discriminating each partial area between the top of the memory area and the page boundary, between page boundaries and between the page boundary and the end of the memory area, An access request for instructing high-speed page access is generated for each partial area determined by the DMA channel determination means. To include a plurality of access request generating means, is shared by each DMA channel, a buffer means for temporarily holding data to be transferred, and arbitration means. Here, when a plurality of accepting means holds a DMA transfer request for only one DMA channel, the arbitrating means performs access according to the access request corresponding to the DMA channel, and holds the DMA transfer request. If a DMA transfer request for a DMA channel with a high priority is accepted, the buffer means is emptied for the determination means and the access request generation means corresponding to the DMA channel of the preceding DMA transfer request. When the buffer means becomes empty, access is performed in accordance with the access request for the high priority DMA channel, and after completion of the high priority DMA transfer, the DMA channel corresponding to the preceding DMA transfer request is handled. Instruct the discriminating means and access request generating means to resume DMA transfer. To.
[0009]
The DMA transfer system according to the present invention is a DMA transfer system having a plurality of DMA channels, and is provided for each DMA channel. The DMA transfer system accepts a DMA transfer request of the corresponding DMA channel, and makes a DMA transfer request until the DMA transfer is completed. A plurality of accepting means for holding, and a plurality of partial areas constituting the memory area, each of which is provided for each DMA channel and which is a transfer target memory area specified in the DMA transfer request of the corresponding DMA channel, A plurality of discriminating means for discriminating each partial area between the head of the area and the page boundary, between the page boundary and between the page boundary and the end of the memory area, and provided for each DMA channel, A plurality of applications that generate an access request for instructing high-speed page access for each partial area determined by the determining means. Seth request generating means, each DMA channel is shared, two-port memory connected to the two buses is there Buffer means and arbitration means are provided. Here, when a plurality of accepting means holds a DMA transfer request for only one DMA channel, the arbitrating means performs access according to the access request corresponding to the DMA channel, and already holds the DMA transfer request. If a transfer request for another DMA channel is accepted and the transfer destination of the previous DMA transfer and the transfer source of the new DMA transfer are memories on different buses, the transfer is in progress. When the reading from the transfer source for all the transfer data of the other DMA channel is completed and there is a free area corresponding to the read size of the first partial area of the other DMA channel in the buffer means, the other DMA Start reading the first partial region of the channel.
[0010]
DETAILED DESCRIPTION OF THE INVENTION
<First Embodiment>
<Overall configuration>
FIG. 1 is a block diagram showing a configuration of a main part of an information processing apparatus including a DMA (Direct Memory Access) transfer apparatus according to the first embodiment of the present invention. The information processing apparatus shown in the figure includes, for example, a digital satellite broadcast receiving apparatus (hereinafter referred to as STB (Set Top Box)), an optical disk recording / reproducing apparatus such as a DVD (Digital Video / Versatile Disk), DVD-RAM, etc. It is used for control and includes an I / O unit 5, SDRAM 4, SDRAM I / F 3, CPU 2, and DMA transfer device 1.
[0011]
The I / O unit 5 inputs / outputs MPEG streams and inputs key data from a remote controller (not shown).
The SDRAM 4 is a memory that supports high-speed page access. High-speed page access means high-speed access to a continuous storage area called a predetermined page. And is there. In the present embodiment, the SDRAM 4 has a data width of 32 bits (hereinafter, 32 bits are defined as one word), and one page is a continuous storage area every 4 words (16 bytes). Here, the size of one page can be set to other sizes such as 2 words and 8 words, but it is preferable to set the size to the same as the cache fill size (unit for updating the cache memory) of the CPU 2. This is because the configuration of the SDRAM I / F 3 can be shared between the CPU 2 and the DMA transfer apparatus 1 and can be simplified. In this embodiment, it is assumed that the cache fill size is 16 bytes.
[0012]
The SDRAM I / F 3 accesses the SDRAM 4 by converting the access signal group (address, data, various control signals) sent from the DMA transfer device 1 and the CPU 2 onto the bus to the input / output specifications of the SDRAM 4.
The CPU 2 has an internal cache memory, controls the entire information processing apparatus, and sets a DMA transfer request to the DMA transfer apparatus 1. DMA transfer in FIG. 1 includes transfer from SDRAM 4 to SDRAM 4 (that is, between different storage areas in SDRAM 4), transfer between SDRAM 4 and I / O unit 5, and between SDRAM 4 and MPEG decoder (not shown). There is a transfer etc.
[0013]
The DMA transfer device 1 performs DMA transfer between different storage areas of the SDRAM 4, between the SDRAM 4 and the I / O unit 5, and the like. At that time, when the transfer source or transfer destination is SDRAM 4, the DMA transfer apparatus 1 determines a partial area delimited by the page boundary existing in the transfer target area in the SDRAM 4, and for each partial area, Access is performed continuously by high-speed page access.
<Configuration of DMA transfer device 1>
FIG. 2 is a block diagram showing a configuration of the DMA transfer apparatus 1. As shown in the figure, the DMA transfer apparatus 1 includes a mode setting unit 100, a read management unit 200, a read determination unit 210, a write management unit 300, a write determination unit 310, an access determination unit 110, an access control unit 120, and a buffer 130. Configured. The values in parentheses given to the arrow lines in the figure mean that the contents of the registers of the corresponding code are input / output.
[0014]
The mode setting unit 100 includes registers 101 to 105 that hold DMA transfer requests set by the CPU 2. Here, the DMA transfer request includes various parameters for requesting DMA transfer between different areas of the SDRAM 4 or between the SDRAM 4 and the I / O unit 5 without using the CPU 2. Various parameters include (1) DMA transfer size, (2) read start address, (3) write start address, (4) addressing mode, and (5) access size. Here, (1) “transfer size” indicates the total data length (assumed to be the number of bytes) to be DMA transferred. (2) “Read start address” indicates the start address of the data to be transferred stored in the transfer source (SDRAM 4, I / O unit 5, etc.). (3) “Write start address” indicates the start address of the transfer destination (SDRAM 4, I / O unit 5, etc.). (4) “Addressing mode” indicates whether to access each of the transfer source and transfer destination in ascending order of addresses or access with fixed addresses. (5) “Access size” indicates the data size to be read or written in one access for each of the transfer source and transfer destination. In the present embodiment, it is assumed that the access size is 32 bits.
[0015]
The registers 101 to 105 sequentially hold a transfer size, a read start address, a write start address, an addressing mode, and an access size, and are cleared after completion of the DMA transfer by the DMA transfer request. Hereinafter, the contents held in the registers 101 to 103 are abbreviated as TRANSFER_SIZE_101, SRC_A_102, and DST_A_103.
The read management unit 200 manages the start address of unread data (hereinafter abbreviated as REMAIN_R_A_201) and the unread data size (hereinafter abbreviated as REMAIN_R_SIZE_202) in the transfer source recording area specified by TRANSFER_SIZE_101 and SRC_A_10. To do. Therefore, the read management unit 200 includes an address counter 201 and a data counter 202.
[0016]
The address counter 201 holds SRC_A_102 input from the register 102 as an initial value of REMAIN_R_A_201 when a DMA transfer request is issued to the mode setting unit 100, and further reads when the addressing mode is in ascending order of addresses. Each time the notification about the number of bytes of the partial area that has been completed is received from the read determining unit 210, the notified number of bytes is added to REMAIN_R_A_201, thereby updating REMAIN_R_A_201 to indicate the start address of the next partial area. The number of bytes of the partial area that has been read is notified from the read determination section 210 when the data in the transfer source partial area is read by the access control section 120 and stored in the buffer 130. On the other hand, when the addressing mode is fixed, the address counter 201 does not update during DMA transfer while storing SRC_A_102 input from the register 102.
[0017]
When a DMA transfer request is issued to the mode setting unit 100, the data counter 202 holds TRANSFER_SIZE_101 as an initial value of REMAIN_R_SIZE_202, and further notifies the read determination unit 210 of the number of bytes in the partial area that has been read. Every time it is updated by subtracting the number of bytes from REMAIN_R_SIZE_202. As a result, REMAIN_R_SIZE_202 represents the unread data size in TRANSFER_SIZE_101.
[0018]
The read determination unit 210 includes a partial area determination unit 211, an address register 212, and a size register 213. A storage area for unread data specified by REMAIN_R_A_201 and REMAIN_R_SIZE_202 after a DMA transfer request is issued to the mode setting unit 100 The partial area delimited by the page boundary is determined, the start address (hereinafter abbreviated as PARTIAL_R_A_212) for each determined partial area is set in the address register 212, and the determined partial area size (PARTIAL_R_SIZE_213) is set in the size register 213 To do. After the setting, upon receiving notification from the access control unit 120 that reading of the partial area and storage in the buffer 130 have been completed, the read determination unit 210 sets PARTIAL_R_SIZE_213 of the size register 213 to the size of the partial area that has been read. Is read out to the read management unit 200 and the next partial area is determined and set in the address register 212 and the size register 213 in the same manner as described above.
[0019]
FIG. 3 shows an example of a partial region that is discriminated by the read determination unit 210. This figure shows the storage area of the transfer source in the SDRAM 4. This transfer source storage area is a 28 byte storage area starting from address 500C (hexadecimal), that is, SRC_A_102 is address 500C, and TRANSFER_SIZE_101 is 28 bytes (7 words: (1) to (7) in the figure). It shall be. Since the page size of the SDRAM 4 is 16 bytes (4 words), data to be transferred (seven words (1) to (7) in the figure) is stored across three pages.
[0020]
In this case, the read determination unit 210 sequentially determines the next first to third partial areas. The first partial area is a storage area of the word (1) represented by (PARTIAL_R_A_212, PARTIAL_R_SIZE_213) = (500C, 4). The second partial area is a storage area for the words (2) to (5) represented by (5010, 16). The third partial area is a storage area for the word (6) (7) represented by (5020,8). As described above, each partial area does not include a page boundary, and thus is suitable for high-speed page access.
[0021]
The write management unit 300 manages the start address of the unwritten area (abbreviated as REMAIN_W_A_301) and the unwritten data size (abbreviated as REMAIN_W_SIZE_302) in the transfer destination recording area specified by TRANSFER_SIZE_101 and DST_A_103. Therefore, the write management unit 300 includes an address counter 301 and a data counter 302.
[0022]
The address counter 301 receives DST_A_103 input from the register 103 when a DMA transfer request is issued to the mode setting unit 100. The first When the addressing mode is in ascending order of address, and the notification about the number of bytes in the partial area that has been written is received from the write determination unit 310, the notified number of bytes is added to REMAIN_W_A_301. By doing so, REMAIN_W_A_301 is updated so as to indicate the head address of the next partial area. The number of bytes of the partial area for which the above writing has been completed is notified from the write determination section 310 when data is written to the transfer destination partial area by the access control section 120. On the other hand, when the addressing mode is fixed, the address counter 301 does not update during DMA transfer while storing DST_A_103 input from the register 103.
[0023]
When a DMA transfer request is issued to the mode setting unit 100, the data counter 302 holds TRANSFER_SIZE_101 as an initial value of REMAIN_W_SIZE_302, and further notifies the write determination unit 310 of the number of bytes in the partial area that has been written. Every time it is updated by subtracting the number of bytes from REMAIN_W_SIZE_302. As a result, REMAIN_R_SIZE_202 represents the unread data size in TRANSFER_SIZE_101.
[0024]
The write determination unit 310 includes a partial area determination unit 311, an address register 312, and a size register 313, and after a DMA transfer request is issued to the mode setting unit 100, in the unwritten storage area specified by REMAIN_W_A_301 and REMAIN_W_SIZE_302 The partial area divided by the page boundary is discriminated, and the start address (hereinafter abbreviated as PARTIAL_W_A_312) for each discriminated partial area is set in the address register 312 and the size of the discriminated partial area (hereinafter abbreviated as PARTIAL_W_SIZE_313) is set in the size register 313 To do. After the setting, when the notification indicating that the writing to the partial area is completed is received from the access control unit 120, the PARTIAL_W_SIZE_313 of the size register 313 is notified to the writing management unit 300 as the size of the writing completed, and again in the same manner as above. The next partial area is discriminated and the next partial area is set in the address register 312 and the size register 313.
[0025]
FIG. 4 shows an example of a partial area determined by the writing determination unit 310. This figure shows a part of the transfer destination storage area in the SDRAM 4. This transfer destination storage area is a 28-byte storage area starting from address 6008, that is, DST_A_103 is address 6008 (hexadecimal), and TRANSFER_SIZE_101 is 28 bytes (7 words: (1) to (7) in the figure). Shall. Since the page size of the SDRAM 4 is 16 bytes (4 words), the storage area of the transfer destination ((1) to (7) in the figure) is stored across three pages.
[0026]
In this case, the writing determination unit 310 sequentially determines the next fourth to sixth partial areas. The fourth partial area is a storage area of the words (1) and (2) represented by (PARTIAL_W_A_302, PARTIAL_W_SIZE_303) = (6008,8). The fifth partial area is a storage area for the words (3) to (6) represented by (6010, 16). The sixth partial area is a storage area for the word (7) represented by (6020, 4). As described above, each partial area does not include a page boundary, and thus is suitable for high-speed page access.
[0027]
The access determination unit 110 includes a buffer management unit 111 and a read / write determination unit 112, and reads from the transfer source partial area determined by the read determination unit 210 and stores it in the buffer 130 (hereinafter abbreviated as read). The data stored in the buffer 130 indicates which of the data stored in the buffer 130 is to be executed by the access control unit 120 among the writing to the partial area of the transfer destination determined by the write determination unit 310 (hereinafter abbreviated as “write”). Decide according to the amount.
[0028]
The buffer management unit 111 receives REMAIN_R_SIZE_202 and REMAIN_W_SIZE_302, and calculates the amount of data temporarily held in the buffer 130 by subtracting REMAIN_W_SIZE_302 from REMAIN_R_SIZE_202.
When the amount of data calculated by the buffer management unit 111 is smaller than PARTIAL_W_SIZE_313, the read / write determination unit 112 determines to cause the access control unit 120 to perform reading, otherwise, the write control is performed. It is determined to be executed by the unit 120.
[0029]
In accordance with the determination by the read / write determination unit 112, the access control unit 120 reads the data from the transfer source partial area by the read determination unit 210 and stores it in the buffer 130, and also reads the data stored in the buffer 130. Writing to the partial area of the transfer destination determined by the writing determination unit 310 is performed.
The buffer 130 temporarily holds data read from the transfer source and is erased when it is written to the transfer destination. The size of the buffer 130 is 32 bytes (for two pages).
<Configuration Example of Partial Area Determination Unit 211>
FIG. 5 is a block diagram illustrating a detailed configuration example of the partial region determination unit 211. As shown in the figure, the partial area determination unit 211 includes a subtractor 211a, a comparator 211b, and a selector 211c.
[0030]
The subtractor 211a subtracts the lower 4 bits of REMAIN_R_A_201 from a constant (10H) corresponding to the page size. This subtraction result means the number of bytes from REMAIN_R_A_201 to the nearest page boundary, and in this embodiment, it is one of four types of values as shown in FIG.
The comparator 211b compares the number of bytes of the subtraction result (A in the figure) with the magnitude relationship between REMAIN_R_SIZE_202 (B in the figure).
[0031]
The selector 211c selects the subtraction result when REMAIN_R_SIZE_202 is larger than the subtraction result, and selects REMAIN_R_SIZE_202 otherwise (that is, when unread data exists only before the most recent page boundary). The selection result is output to the size register 213 as the data size PARTIAL_R_SIZE_213 of the partial area to be read next.
[0032]
In this way, the data size of one partial area is determined. The start address of the partial area is REMAIN_R_A_201 (updated by the address counter 201) itself. REMAIN_R_A_201 is set in the address register 212 as PARTIAL_R_A_212 at the same time that the output of the selector 211c is set in the size register 213.
<Partial region determination unit 311>
The partial area determination unit 311 also sequentially determines the partial area of the transfer destination with the configuration as shown in FIGS. 7 and 8 have substantially the same configuration as the partial region determination unit 211 shown in FIGS.
<Description of operation>
The operation of the DMA transfer apparatus 1 configured as above according to the first embodiment of the present invention will be described.
[0033]
FIG. 9 is an explanatory diagram showing a state of DMA transfer between the transfer source and transfer destination storage areas shown in FIGS. In this case, the CPU 2 sets TRANSFER_SIZE_101 = 28 (byte, decimal), SRC_A_102 = 500 C (hexadecimal), DST_A_103 = 6008 (hexadecimal) as a TDMA transfer request in the mode setting unit 100, and the addressing is set in the register 104. As the mode, the address ascending order is set for both the transfer source and transfer destination, and the access size is set in the register 105 (4 bytes).
[0034]
In response to this setting, the DMA transfer device 1 reads out data from the transfer source storage area (SDRAM 4 → buffer 130) for each of the partial areas (1), (2), and (4) in FIG. Write (buffer 130 → SDRAM 4) is performed in numerical order for each of the partial areas (3), (5), and (6) in FIG.
FIG. 10 is a time chart showing the timing of DMA transfer in FIG. In the figure, XBRD is a read signal (negative logic), XBWT is a write signal (negative logic), ADR is an address, SIZE is an access size, DATA is read / write data, and XACK is an acknowledge signal. These signals are input / output between the access control unit 120 and the SDRAM I / F 3. In the following, description will be given in order.
[0035]
(1) By setting the DMA transfer request, the read management unit 200 holds REMAIN_R_A_201 = 500C (hexadecimal) and REMAIN_R_SIZE_202 = 28 (decimal) as initial values. Also, the write management unit 300 holds REMAIN_W_A_301 = 6008 and REMAIN_W_SIZE_302 = 28 as initial values.
The read determination unit 210 determines the size of the first partial area based on REMAIN_R_A_201, REMAIN_R_SIZE_202, the addressing mode (address ascending order), and the access size of the read management unit 200. The first partial area is determined as an area for storing the transfer source word (1) in FIG. 5. As a result, the address register 212 and the size register 213 have PARTIAL_R_A_212 = 500C (hexadecimal), PARTIAL_R_SIZE_213 = 4 (decimal). ).
[0036]
In parallel with this, the write determination unit 310 similarly determines that the storage area of the transfer destination word (1) (2) is the first partial area, sets PARTIAL_W_A_312 = 6008 in the address register 312, and stores it in the size register 313. PARTIAL_W_SIZE_313 = 8 is set.
After the transfer source partial area and the transfer destination partial area are set in this way, the access determination unit 110 reads 0 because the data amount of the buffer 130 managed by the buffer management unit 111 is 0. The access control unit 120 is instructed to read the transfer source partial area set by.
[0037]
In response to this instruction, the access control unit 120 reads data from the first partial area of the transfer source (area storing the word (1) in the figure) and writes it into the buffer 130 ((1) in FIGS. 9 and 10). .
(2) After completing the reading of the first partial area (word {circle around (1)}) of the transfer source, the access control unit 120 notifies the reading determining unit 210 that the reading has been completed, and the reading determining unit 210 sets PARTIAL_R_SIZE_213. The read management unit 200 is notified of the read completion size.
[0038]
With this notification, the read management unit 200 updates REMAIN_R_A_201 and REMAIN_R_SIZE_202 to 5010h and 24 (bytes). On the other hand, since the write determination unit 310 has not received a notification from the access control unit 120 that the write has been completed, PARTIAL_W_A_312 = 6008 and PARTIAL_W_SIZE_313 = 8 remain unchanged.
[0039]
At this time, since only one word is stored in the buffer 130, the access determination unit 110 determines to read the transfer source partial area set by the read determination unit 210, and instructs the access control unit 120 to that effect. To do.
In response to this instruction, the access control unit 120 reads the data from the second partial area (words {circle around (2)} to {circle around (5)}) of the transfer source by high-speed page access and writes it to the buffer 130 (in FIGS. 9 and 10). 2)).
[0040]
(3) After the reading of the second partial area of the transfer source is completed, the read management unit 200 and the read determination unit 210 have REMAIN_R_A_201 = 5020 (hexadecimal), REMAIN_R_SIZE_202 = 8 (decimal), PARTIAL_R_A_212 = 5020 (hexadecimal) , PARTIAL_R_SIZE_213 The size register 213 is updated to 8 = 8.
At this point, the access determination unit 110 stores 5 words in the buffer 130. Have Therefore, it is determined to read the first partial area of the transfer destination set by the write determination unit 310, and the access control unit 120 is instructed to that effect.
[0041]
In response to this instruction, the access control unit 120 reads the data from the buffer 130 and writes the data to the first partial area (word (1) (2)) of the transfer destination by continuous access ((3) in FIGS. 9 and 10).
(4) to (6) Hereinafter, similarly, the DMA transfer apparatus 1 sequentially reads the partial area (4), the partial area (5), and the (6) partial area in FIG. 9 and FIG. Do.
[0042]
As described above, the DMA transfer apparatus 1 performs high-speed page access in the reading (2), the writing (3) (4), and the writing (5) in FIG.
That is, for each transfer source and transfer destination of the DMA transfer apparatus 1, high-speed page access is performed in units of one page for partial areas other than the first and last partial areas, and two words are also used in the first and last partial areas. In the above case, high-speed page access is performed. As a result, the DMA transfer apparatus 1 can complete the DMA transfer at high speed. Further, the storage capacity of the buffer 130 may be at least two pages (more accurately, (size of two pages) − (1 word)).
[0043]
In the above embodiment, the case where both the transfer source and the transfer destination are SDRAMs 4 has been described. Z If one of them is an SDRAM 4, the SDRAM 4 may be accessed for each partial area.
<Second Embodiment>
The DMA transfer system of the present embodiment has a plurality of DMA channels sharing the buffer 130, and when DMA transfer requests of different DMA channels are not competing, each DMA channel is the same as that of the first embodiment. Similarly, access is made for each partial area, and when the DMA transfer request conflicts (when a DMA transfer request of another DMA channel having a higher priority is issued during DMA transfer), the DMA transfer is interrupted and priority is given. After performing a high-frequency DMA transfer, the original DMA transfer is resumed. For this interruption, the DMA transfer system writes the data remaining in the low-priority DMA transfer buffer currently being executed to the transfer destination sequentially, regardless of the page boundary, instead of accessing each partial area. Then, the DMA transfer is interrupted.
[0044]
FIG. 11 is a block diagram showing a configuration of the DMA transfer system according to the second embodiment of the present invention. This DMA transfer system includes a DMA transfer device 6 corresponding to DMA channel 0, a DMA transfer device 7 corresponding to DMA channel 1, a buffer 130, and an access request arbitration unit 1400. Assume that the priority of DMA channel 1 is higher than the priority of DMA channel 0.
[0045]
The access request arbitration unit 1400 receives a DMA channel 0 access request from the DMA transfer device 6 and a DMA channel 1 access request from the DMA transfer device 7, and arbitrates them when they conflict. Here, the access request refers to a request for reading or writing to the memory area including the partial area or page boundary.
[0046]
Specifically, the access request arbitration unit 1400 determines whether or not DMA transfer requests for DMA channels 0 and 1 are set in the DMA transfer apparatuses 6 and 7. This determination depends on, for example, whether or not the unwritten data sizes (REMAIN_W_SIZE_1302, REMAIN_W_SIZE_2302) held in the write management unit 1300 and the write management unit 2300 are 0, respectively.
[0047]
As a result of the determination, if a DMA transfer request for one of the DMA channels is set, the access request arbitration unit 1400 receives the access request for that channel and outputs it to the SDRAM I / F 3.
When a DMA transfer request for DMA channel 0 with a lower priority is set during the DMA transfer for DMA channel 1, the access request arbitration unit 1400 performs an access request for DMA channel 0 after the DMA transfer for DMA channel 1 is completed. Is output to the SDRAM I / F 3.
[0048]
When a DMA transfer request for DMA channel 1 having a higher priority is set during DMA transfer of DMA channel 0, the access request arbitration unit 1400 outputs an interruption instruction to the DMA transfer device 6, and performs DMA transfer according to the interruption instruction. When the notification that the buffer 130 is empty is received from the device 6, the DMA transfer device 7 receives the DMA channel 1 access request and outputs it to the SDRAM I / F 3. As a result, when the inter-D transfer of the DMA channel 1 is completed, a restart instruction is output to the DMA transfer device 6.
[0049]
The DMA transfer apparatus 6 includes a mode setting unit 1100, an access determination unit 1110, an access control unit 1120, a read management unit 1200, a read determination unit 1210, a write management unit 1300, and a write determination unit 1310.
Among these, the mode setting unit 1100, the read management unit 1200, the read determination unit 1210, and the write management unit 1300 have the same configuration as the mode setting unit 100, read management unit 200, read determination unit 210, and write management unit 300 shown in FIG. Is an element. Hereinafter, description of the same components will be omitted, and different points will be mainly described.
[0050]
The access determination unit 1110 has the same function as the access determination unit 110 shown in FIG. 2, and in addition, the access request arbitration unit 1400 is performing transfer by a DMA transfer interruption instruction or resumption instruction via the access control unit 1120. It is configured to suspend and resume DMA. As shown in FIG. 12, the access determination unit 1110 includes a buffer management unit 1111 and a read / write determination unit 1112.
[0051]
The buffer management unit 1111 manages the data amount of the buffer 130 in the same manner as the buffer management unit 111 illustrated in FIG.
The read / write determination unit 1112 has the following functions compared to the read / write determination unit 112 shown in FIG.
That is, when the read / write determination unit 1112 receives an interruption instruction from the access control unit 1120, the read / write determination unit 1112 temporarily prohibits the operation of the partial region determination unit 1311 without performing a determination to perform reading thereafter, and the buffer management unit The data amount calculated in 1111 is notified to the write determination unit 1310, and the data amount is set in the size register 1313. Further, when the data amount calculated by the buffer management unit 1111 becomes “0”, the access request arbitration unit 1400 is notified via the access control unit 1120 that the buffer 130 has become empty.
[0052]
When the read / write determination unit 1112 receives a restart instruction from the access control unit 1120 during the DMA transfer, the read / write determination unit 1112 cancels the prohibition of the operation of the partial area determination unit 1311 and reads / write determination unit 112 shown in FIG. The same determination is performed.
The write determination unit 1310 includes a partial area determination unit 1311, an address register 1312, and a size register 1313 as shown in FIG.
[0053]
The address register 1312 and the size register 1313 are the same as the address register 312 and the size register 313 shown in FIG. However, the PARTIAL_W_SIZE_313 size register 1313 is directly set with the data amount from the read / write determination unit 1112 when the read / write determination unit 1112 receives an interruption instruction. As a result, the size of the data remaining in the buffer 130 is set in the size register 1313.
[0054]
The partial area determination unit 1311 is the same as the partial area determination unit 311 illustrated in FIG. 2 except that the operation is temporarily prohibited by the read / write determination unit 1112.
In addition to the functions of the access control unit 120 illustrated in FIG. 2, the access control unit 1120 outputs a suspend instruction and a resume instruction input from the access request arbitration unit 1400 to the access determination unit 1110 and inputs from the access determination unit 1110 The notification that the buffer 130 to be used is empty is output to the access request arbitration unit 1400.
[0055]
The DMA transfer apparatus 7 includes a mode setting unit 2100, an access determination unit 2110, an access control unit 2120, a read management unit 2200, a read determination unit 2210, a write management unit 2300, and a write determination unit 2310. Since this configuration is the same as that of the DMA transfer apparatus 1 shown in FIG.
<Description of operation>
FIG. 13 is a time chart showing the timing of DMA transfer in the DMA transfer system of this embodiment. In the figure, XBRD, XBWT, ADR, SIZE, DATA, and XACK are the same as those in FIG. In the same figure, the DMA transfer request similar to that in FIGS. 3, 4 and 10 is set in the DMA transfer apparatus 6 (DMA channel 0), and other DMA transfer apparatus 7 (DMA channel 1) is set in the DMA transfer apparatus 7 (DMA channel 1) at the timing T1 in FIG. The timing when a DMA transfer request is set is shown.
[0056]
In the same figure, (1), (2) and (3) are read from the transfer source partial area of DMA channel 0 (1) (2) and written to the transfer destination partial area (FIG. 10). The timing of 3) is shown.
It is assumed that a DMA transfer request of DMA channel 1 having a high priority is set in the mode setting unit 2100 during execution of the partial area writing (3).
[0057]
The access request arbitration unit 1400 is set with a DMA transfer request for DMA channel 1. The Since the DMA transfer request for DMA channel 0 has already been set, an interruption instruction is issued to the DMA transfer device 6. In response to this interruption instruction, the read / write determining unit 1112 in the DMA transfer device 6 does not determine to newly read when (3) in FIG. It is set in the register 1313 and determined to be written. As a result, the access control unit 1120 writes all of the data transferred in the DMA channel 0 and remaining in the buffer 130 to the transfer destination storage area ((7) in the figure).
[0058]
After this writing is completed, the read / write determination unit 1112 notifies the access request arbitration unit 1400 that the buffer 130 is empty. Upon receiving this notification, the access request arbitration unit 1400 gives priority to an access request for the DMA channel 1 from the DMA transfer device 7 and outputs it to the SDRAM I / F 3 ((8) in the figure).
[0059]
Thereafter, the access request arbitration unit 1400 has completed the DMA data transfer of the DMA channel 1. When If it is determined, the DMA transfer apparatus 6 is instructed to resume.
As described above, according to the DMA data transfer system in the present embodiment, it is not necessary to provide an independent buffer for each channel, and a DMA transfer request having a high priority from another channel during data transfer while suppressing the circuit scale. When this occurs, the DMA transfer being executed can be temporarily suspended, and a DMA transfer request with a high priority can be processed first.
<Third Embodiment>
FIG. 14 is a block diagram showing a configuration of the DMA transfer apparatus 8 according to the third embodiment of the present invention. 2 differs from FIG. 2 in that an access determination unit 4110, an access control unit 4120, and a buffer 4130 are provided instead of the access determination unit 110, the write management unit 300, the access control unit 120, and the buffer 130, respectively. ing. Components having the same reference numerals as those in FIG. 2 have the same functions, and thus description thereof will be omitted. Hereinafter, differences will be mainly described.
[0060]
The buffer 4130 is a two-port memory capable of writing and reading in parallel. The two ports of the buffer 4130 are connected to different buses. One port is connected to the SDRAM 4 via the SDRAM I / F 3 and the other port is connected to the SDRAM 4004 via the SDRAM I / F 4003. A read operation and a write operation can be performed from any port. A read operation from the other port is possible simultaneously with a write operation from one port.
[0061]
The access determination unit 4110 directly acquires and manages the data amount (number of bytes) held in the buffer 4130 from the buffer 4130. Therefore, each time one word is written to or read from the buffer 4130, the access determination unit 4110 updates the data amount. Further, the access determination unit 411 determines to perform reading if there is an empty area in the buffer 4130 that is equal to or larger than the size (PARTIAL_R_SIZE_213) of the partial area determined by the read determination unit 210, and is also determined by the write determination unit 310. If the buffer 4130 contains data larger than the size of the partial area (PARTIAL_W_SIZE_313) Set The Since the determination of the read of the transfer source partial area and the determination of the write of the transfer destination partial area are performed independently rather than being selected, the write determination timing is higher than that of the first embodiment. Get faster.
[0062]
Access control unit 4120 reads and writes SDRAM4 and SDRAM4004 in parallel. In other words, the access control unit 4120 reads the partial area determined by the read determination unit 210, and in parallel, writes to the transfer destination area based on the address input from the write determination unit 4310.
<Description of operation>
FIG. 15 is a time chart showing the timing of DMA transfer in the DMA transfer apparatus of this embodiment.
[0063]
In the figure, the upper half shows a signal group output from the access control unit 4120 to the SDRAM I / F 3 and the lower half shows a signal group output to the SDRAM I / F 4003. The transfer source is an area for 7 words from the address 5008 of the SDRAM 4, and the transfer destination is an area for 7 words from the address 600C of the SDRAM 4004.
[0064]
Comparing FIG. 15 with FIG. 10, in FIG. 15, the start timing of writing to the partial area ((3), (5), (6) in FIG. 15) is earlier. This is because the access determination unit 4110 manages the amount of data held in the buffer 4130 in units of words, so that the access determination unit 4110 stores data for the size of the write data in the transfer destination partial area in the buffer 4130. Because the write can be determined at the time of writing In The
[0065]
As described above, according to the DMA transfer apparatus of the present embodiment, in addition to performing high-speed page access for each partial area, when the transfer source memory and the transfer source memory are connected to different buses, the transfer source memory Reading from the memory and writing to the transfer destination memory can be executed in parallel.
<Fourth embodiment>
In the second embodiment, the same memory (SDRAM 4) is used for both DMA channels 0 and 1 or different memories on the same bus. However, in this embodiment, DMA transfer is also performed for memories on different buses. The system will be described.
[0066]
FIG. 16 is a block diagram showing a configuration of a DMA transfer system according to the fourth embodiment of the present invention. This figure is different from FIG. 11 in the second embodiment in that an access request arbitration unit 4400 is provided instead of the access request arbitration unit 1400, and a buffer 4130 is provided instead of the buffer 130. Components having the same reference numerals as those in FIG. 11 have the same functions, and thus description thereof will be omitted.
[0067]
The buffer 4130 is a two-port memory capable of writing and reading in parallel. The two ports of the buffer 4130 are connected to different buses. One port is connected to the SDRAM 4 via the SDRAM I / F 3 and the other port is connected to the SDRAM 4004 via the SDRAM I / F 4003. A read operation and a write operation can be performed from any port.
[0068]
FIG. 17 shows a configuration example of the buffer 4130. The buffer 4130 shown in the figure includes a multiplexer 4130a, a FIFO 4130b, a demultiplexer 4130 multiplexer 4130a, a FIFO 4130b, and a demultiplexer 4130c. The ports 0 and 1 are both connected to the multiplexer 4130a and the demultiplexer 4130c. Thus, the buffer 4130 can execute a write operation from one port and a read operation from the other port in parallel.
[0069]
The access request arbitration unit 4400 sets a DMA channel 1 transfer request having a high priority during DMA transfer of the DMA channel 0, and the transfer destination memory of the DMA channel 0 and the transfer source memory of the DMA channel 1 are the same memory or When the memories are on the same bus, the same operation as the access request arbitration unit 1400 in the second embodiment is performed.
[0070]
Further, the access request arbitration unit 4400, when a transfer request for another DMA channel is set during the DMA transfer and the transfer destination memory and the transfer source memory of the DMA channel are memories on different buses, When reading of the transfer data from the transfer source is completed and the buffer 4130 has a free area corresponding to the read size of the first partial area of the DMA channel, the first partial area of the DMA channel Starts reading.
[0071]
FIG. 18A to FIG. 18F show a case where the transfer destination of the DMA channel 0 and the transfer source of the DMA channel 1 are different memories. In the figure, SRC0 and DST0 indicate a transfer source storage area and a transfer destination storage area of DMA channel 0, and SRC1 and DST1 indicate a transfer source storage area and a transfer destination storage area of DMA channel 1, respectively. In the figure, a broken line marked with (1) indicates reading of the last partial area of the DMA channel 0 (memory → buffer 4130), and an arrow indicated by (2) indicates writing of the last partial area of the DMA channel 0 ( Buffer 4130 → memory). The arrow line (3) means reading of the first partial area of the DMA channel 1 (memory → buffer 4130). The access request arbitration unit 4400 executes in parallel because (2) and (3) are writing and reading to two memories connected to different buses.
<Description of operation>
FIG. 19 is a time chart showing an operation example in the case of FIG.
[0072]
In the figure, the upper half shows a signal group output from the access request arbitration unit 4400 to the SDRAM I / F 3, and the lower half shows a signal group output to the SDRAM I / F 4003. (1), (2), and (3) in the figure correspond to (1), (2), and (3) in FIG.
As shown in the figure, the access request arbitration unit 4400 has a DMA channel 1 transfer request set during DMA transfer of the DMA channel 0, and the transfer destination of the DMA channel 0 and the transfer source of the DMA channel 1 are different (SDRAM 4). 4004), reading of all transfer data of DMA channel 0 from the transfer source is completed (at the time of completion of (1) in the figure), and the first partial area of DMA channel 1 is stored in buffer 4130. Control is performed so that reading of the first partial area of the DMA channel 1 is started when a free area corresponding to the read size exists (at the start of (3) in the figure).
[0073]
As described above, according to the DMA transfer system of the present embodiment, a DMA transfer request for another DMA channel is set during the DMA transfer, the transfer destination memory being transferred in advance, and the newly set DMA transfer request When the transfer request memory is connected to a different bus, the access request arbitration unit 4400 completes reading of the last partial area of the preceding DMA transfer and stores the first part of another DMA channel in the buffer 4130. Since reading of a new DMA transfer request is started when a space corresponding to the size of the area is generated, it is possible to improve the bus use efficiency by two consecutive DMA transfer requests.
[0074]
18A to 18F show the case where a DMA transfer request for DMA channel 1 is set during DMA transfer for DMA channel 0, but the reverse case, that is, during DMA transfer for DMA channel 1 is shown. When the DMA transfer request for DMA channel 0 is set to the same, the same applies as long as the transfer destination memory of the preceding DMA transfer and the transfer source memory of the new DMA transfer are on different buses.
[0075]
The DMA transfer system according to the present embodiment may be configured to include three or more DMA transfer devices. In that case, the access request arbitration unit detects that the reading of the last partial area from all the DMA transfer devices has been completed, determines the transfer destination and the transfer source memory in each DMA transfer device, and based on them Thus, the control as shown in FIG. 19 may be performed.
<Others>
In each of the embodiments described above, the transfer source and the transfer destination are both assumed to be memory capable of high-speed page access, but one of the transfer source and transfer destination is a memory capable of high-speed page access. Only the memory capable of high-speed page access is accessed for each partial area delimited by the page boundary. For example, even in a DMA transfer between a memory capable of high-speed page access and an I / O to which a fixed address is assigned, high-speed page access to the memory can be guaranteed, and the buffer capacity of the buffer 130 or 4130 There may be less.
[0076]
Further, in the first embodiment, instead of the subtractor 211a, a logic circuit or table having input / output logic for inputting the lower 4 bits of REMAIN_R_A_201 in FIG. 6 and outputting the same value as the subtraction result may be provided. Good.
[0077]
【The invention's effect】
(1) A DMA transfer apparatus according to the present invention is a DMA transfer apparatus for a memory corresponding to high-speed page access, and includes a plurality of partial areas constituting a memory area to be transferred, Discrimination means for discriminating each partial area between the top and page boundaries, between page boundaries and between the page boundary and the end of the memory area, and access means for performing high-speed page access for each identified partial area Prepare.
[0078]
According to this configuration, when at least one of the transfer source and the transfer destination is a memory capable of high-speed page access, the DMA transfer device performs high-speed for each partial area delimited by the page boundary in the transfer target memory area. You can guarantee page access. As a result, the present DMA transfer device is compatible with a memory capable of high-speed page access without sacrificing the performance of the memory, and can reduce the bus idle period and the DMA transfer time.
[0079]
(2) The discriminating means holds the initial address of the area to be transferred as an initial value, and each time high speed page access is made by the access means, the held contents are stored in the untransferred area of the memory area to be transferred. Address update means for updating to the start address and the data size of the area to be transferred are held as initial values, and the held contents are transferred for each high-speed page access by the access means, not transferred among the data size to be transferred Data size update means for updating to the data size and the partial area from the start address held as the initial value in the address update means to the nearest page boundary, and the updated start address every time the address update means updates And a partial area discriminating means for discriminating the next partial area from the last page boundary to the end of the memory area. It may be configured to.
[0080]
According to this configuration, each time a high-speed page access is performed, the determination means includes a partial area from the beginning of the memory area to be transferred to the nearest page boundary, a partial area from the page boundary to the next page boundary, ..Sequentially determining a plurality of partial areas such as a partial area from the page boundary to the end of the memory area and the access means performing high-speed page access to each partial area in parallel Can do.
[0081]
(3) The partial area determination means includes a size determination means for determining a size from a head address held in the address update means to the nearest page boundary or the end of the memory area, and a size determined by the size determination means. Size holding means for holding the size of the partial area, and the access means is held by the address updating means. Ru A partial area corresponding to the size held in the size holding means from the start address may be configured to perform high-speed page access.
[0082]
According to this configuration, since the partial area determination unit determines the partial area represented by the parameter of the combination of the start address and the size, the parameter suitable for high-speed page access can be output to the access unit.
(4) The size discriminating unit subtracts a lower bit representing a relative position in the page area, which is a lower bit of the head address held in the address updating unit, from the size of the page area, thereby obtaining the nearest page boundary. The subtraction means for calculating the size up to, the comparison means for comparing the size calculated by the subtraction means with the untransferred data size held in the data size update means, and the result of comparison of the comparison means, whichever is not large Selecting means for selecting, and the size holding means may hold the selection result of the selecting means as the size of the partial area.
[0083]
According to this configuration, the size determination unit can determine the size of the partial region with a simple configuration of subtraction and comparison.
(5) The DMA transfer apparatus according to the present invention is a DMA transfer apparatus for transferring a memory corresponding to high-speed page access, and includes a plurality of transfer source partial areas constituting the first memory area as a transfer source. A first discriminating unit for discriminating a plurality of transfer source partial areas separated by any one of a head, a page boundary, and a tail of the first memory area, and a page boundary; A plurality of transfer destination partial areas constituting the second memory area, wherein the transfer destination parts are divided by any one of a head, a page boundary and a tail of the second memory area and a page boundary. A second discriminating means for discriminating the area, and a transfer destination partial area discriminated by the second discriminating means by reading data from the transfer source partial area discriminated by the first discriminating means by high-speed page access And an access means for writing the read data by the high-speed page access.
[0084]
According to this configuration, when the transfer source and the transfer destination are memories capable of high-speed page access, the DMA transfer device transfers the transfer source portion separated by the page boundary in the first and second memory areas to be transferred. It is possible to guarantee high-speed page access for each area and transfer destination partial area. As a result, the present DMA transfer device is compatible with a memory capable of high-speed page access without sacrificing the performance of the memory, and can reduce the bus idle period and the DMA transfer time.
[0085]
(6) The first discriminating means retains the start address of the first memory area as an initial value, and updates the retained content to the start address of the untransferred area in the first memory area in response to access by the access means. The first address updating means that stores the data size of the first memory area as an initial value, and updates the held content to the untransferred data size of the data size of the first memory area in response to access by the access means. The first data size update means and the transfer source partial area from the head address held as the initial value in the first address update means to the nearest page boundary are discriminated and updated each time the first address update means updates. First partial area discriminating means for discriminating the next transfer source partial area from the first address to the nearest page boundary or the end of the first memory area.
[0086]
According to this configuration, each time high-speed page access is performed, the first determination unit transfers the transfer source partial area from the beginning of the first memory area to the nearest page boundary, and transfers from the page boundary to the next page boundary. The original partial area,..., Sequentially determining a plurality of transfer source partial areas such as a transfer source partial area from the page boundary to the end of the first memory area, and the access means for each transfer source partial area And high-speed page access can be performed in parallel.
[0087]
(7) Further, the first partial area determination means determines the data size from the head address held in the first address update means to the nearest page boundary or the end of the first memory area. And first size holding means for holding the size determined by the first size determining means as the size of the transfer source partial area. The access means reads the transfer source partial area of the size held in the first size holding means from the head address held in the first address holding means by high-speed page access.
[0088]
According to this configuration, since the first partial area determination unit determines the partial area represented by the parameter of the combination of the start address and the size, the parameter suitable for high-speed page access can be output to the access unit. .
(8) The first size determining means subtracts, from the size of the page area, the lower bits representing the relative position in the page area, which is the lower bits of the head address held in the first address update means, First subtracting means for calculating the size up to the nearest page boundary; first comparing means for comparing the size calculated by the first subtracting means with the untransferred data size held in the first data size updating means; And a first selection means for selecting the smaller one as a result of the comparison by the first comparison means, and the first size holding means holds the selection result of the first selection means as the size of the partial region.
[0089]
According to this configuration, the first size determination unit can determine the size of the partial region with a simple configuration of subtraction and comparison.
(9) The second discriminating means holds the start address of the second memory area as an initial value, and updates the held contents to the start address of the untransferred area in the second memory area in response to access by the access means. Second address updating means for holding the data size of the second memory area as an initial value, and updating the held content to the untransferred data size of the data size of the second memory area in response to access by the access means The second data size updating means and the transfer destination partial area from the head address held as the initial value in the second address updating means to the nearest page boundary are discriminated and updated every time the second address updating means updates. Second partial area discriminating means for discriminating the next transfer destination partial area from the first address to the nearest page boundary or the end of the second memory area.
[0090]
According to this configuration, the second discriminating unit has a partial area from the top of the second memory area to the nearest page boundary, a partial area from the page boundary to the next page boundary,. It is possible to simultaneously determine a plurality of partial areas such as partial areas up to the end of, and to access each partial area at a high speed continuously in parallel.
[0091]
(10) The second partial area determination means includes a second size determination means for determining the size from the head address held in the second address update means to the nearest page boundary or the end of the second memory area; Second size holding means for holding the size determined by the two size determining means as the size of the transfer destination partial area, and the access means holds the second size from the head address held in the second address holding means The transfer destination partial area for the size held in the means is written to the high-speed page access.
[0092]
According to this configuration, the second partial area determination means includes a partial area from the beginning of the memory area to be transferred to the nearest page boundary, a partial area from the page boundary to the next page boundary,. Thus, it is possible to simultaneously determine a plurality of partial areas, such as partial areas from the memory area to the end of the memory area, and to access each partial area at a high speed continuously.
[0093]
(11) The second size determining means subtracts, from the size of the page area, lower bits representing the relative position in the page area, which is the lower bits of the head address held in the second address updating means, Second subtracting means for calculating the size up to the nearest page boundary; second comparing means for comparing the size calculated by the second subtracting means with the untransferred data size held in the second data size updating means; And second selection means for selecting the one that is not larger as a result of the comparison by the second comparison means, and the second size holding means holds the selection result of the second selection means as the size of the partial area.
[0094]
According to this configuration, the second size determination unit can determine the size of the partial region with a simple configuration of subtraction and comparison.
(12) Further, the DMA transfer apparatus of the present invention is a plurality of transfer source partial areas constituting the first memory area as the transfer source, and the page boundary between the head of the first memory area and the page boundary. First discriminating means for discriminating each transfer source partial area between the page boundary and the end of the first memory area, and a plurality of transfer destination partial areas constituting a second memory area as a transfer destination, A second discriminating means for discriminating each transfer destination partial area between the head of the second memory area and the page boundary, between page boundaries, and between the page boundary and the end of the second memory area; The data is read from the transfer source partial area determined by the means by high-speed page access and stored in the buffer means, and the data stored in the buffer means is transferred to the transfer destination partial area determined by the second determination means for high-speed page access. Ri and an access means for writing.
[0095]
According to this configuration, when both the transfer source and the transfer destination are memories capable of high-speed page access, the DMA transfer device can transfer each transfer source partial area delimited by a page boundary in the first memory area of the transfer source. In addition, it is possible to guarantee reading by high-speed page access. In addition, it is possible to guarantee that writing is performed by high-speed page access for each transfer destination partial area delimited by page boundaries in the transfer destination second memory area. As a result, the idle period of the bus can be reduced and the DMA transfer time can be shortened.
[0096]
(13) The first memory area and the second memory area are areas in the same memory or areas in different memories connected to the same bus, and the access means is held in the buffer means. The size of the stored data and the free space of the buffer means are compared with the size of the transfer source partial area and the size of the transfer destination partial area, and according to the comparison result, the transfer of the transfer source partial area and the write of the transfer destination partial area Read / write determination means for determining which to perform, and access control means for performing reading from the transfer source partial area and writing to the transfer destination partial area in accordance with the determination of the read / write determination means.
[0097]
(14) The buffer means has at least a capacity obtained by subtracting the memory access size from twice the page area, and the read / write determination means performs transfer in which the free size of the buffer means is determined by the first determination means. If the size is larger than the size of the original partial area, it is determined that reading is performed. If the data size acquired by the buffer management means is larger than the size of the transfer destination partial area determined by the second determination means, write is performed. Decide to do.
[0098]
According to this configuration, it is possible to ensure that reading is performed by high-speed page access for each transfer source partial area and writing is performed by high-speed page access for each transfer destination partial area. Further, since the storage capacity of the buffer means only needs to have at least a capacity obtained by subtracting the memory access size from twice the page area, DMA transfer can be efficiently realized with a small buffer capacity.
[0099]
(15) The buffer means is a two-port memory connected to two buses, and the first memory area and the second memory area are areas in a memory connected to different buses, and the access means In accordance with the size of the data held in the buffer means and the free size of the buffer means, it is determined whether or not to read from the transfer source partial area, and independently of this, writing to the transfer destination partial area is performed. Read / write determining means for determining whether or not to perform, and access control means for performing reading from the transfer source partial area and writing to the transfer destination partial area in accordance with the determination of the read / write determination means.
[0100]
According to this configuration, when the first memory area of the transfer source and the second memory area of the transfer destination are areas in the memory connected to different buses, the buffer is transferred from the transfer source partial area delimited by the page boundary. And the transfer from the buffer to the transfer destination partial area can be performed in parallel, and DMA transfer can be efficiently realized with a small buffer capacity.
[0101]
(17) The present invention is a DMA transfer system having a plurality of DMA channels having different priorities, provided for each DMA channel, accepting a DMA transfer request of the corresponding DMA channel, and performing a DMA transfer request until completion of the DMA transfer A plurality of receiving means for holding each of the memory areas to be transferred, which are provided for each DMA channel and specified in the DMA transfer request of the corresponding DMA channel, and a plurality of partial areas constituting the memory area, A plurality of discriminating means for discriminating each partial area between the top of the memory area and the page boundary, between the page boundaries and between the page boundary and the end of the memory area, and a corresponding DMA channel provided for each DMA channel; A plurality of accesses for generating an access request for instructing high-speed page access for each partial area determined by the determining means. Includes a request generation unit, are shared in each DMA channel, a buffer means for temporarily holding data to be transferred, and arbitration means. Here, when a plurality of accepting means holds a DMA transfer request for only one DMA channel, the arbitrating means performs access according to the access request corresponding to the DMA channel, and holds the DMA transfer request. If a DMA transfer request for a DMA channel with a high priority is accepted, the buffer means is emptied for the determination means and the access request generation means corresponding to the DMA channel of the preceding DMA transfer request. When the buffer means becomes empty, access is performed in accordance with the access request for the high priority DMA channel, and after completion of the high priority DMA transfer, the DMA channel corresponding to the preceding DMA transfer request is handled. Instruct the discriminating means and access request generating means to resume DMA transfer. To.
[0102]
According to this configuration, it is possible to guarantee high-speed page access for each partial area delimited by the page boundary in the memory area to be transferred, and other DMA transfer requests with high priority can be accepted during DMA transfer. In this case, the preceding DMA transfer can be interrupted and switched to a higher priority DMA transfer.
[0103]
(18) The discriminating means corresponding to the preceding DMA channel discriminates the transfer destination area corresponding to the data held in the buffer means when instructed to be interrupted by the arbitrating means, and corresponds to the preceding DMA channel. The access request generating means generates an access request for the transfer destination area determined by the determining means when instructed by the arbitrating means, and the arbitrating means performs high-speed page access according to the access request.
[0104]
This configuration By Thus, when the arbitration means is instructed to interrupt, the determination means determines the transfer destination area corresponding to the data held in the buffer means, and the access request means determines the data in the buffer means to the transfer destination area. Since the arbitration unit executes the access request, the buffer unit can be emptied immediately after the interruption instruction, and the DMA channel can be shifted to a higher priority channel.
[0105]
(19) The discriminating means corresponding to the preceding DMA channel discriminates a partial area constituting an untransferred area in the memory area to be transferred when instructed to resume from the arbitrating means.
According to this configuration, when the restart is instructed, the determination unit restarts the determination of the partial area from the interrupted untransferred area, so that the original DMA transfer can be quickly restored after the restart instruction.
[0106]
(20) Further, the present invention is a DMA transfer system having a plurality of DMA channels, which is provided for each DMA channel, receives a DMA transfer request of the corresponding DMA channel, and holds the DMA transfer request until the completion of the DMA transfer. A plurality of accepting means and a plurality of partial areas constituting the memory area, each of which is provided for each DMA channel and designated in the DMA transfer request of the corresponding DMA channel, A plurality of determination means for determining each partial area between the head and the page boundary, between the page boundaries and between the page boundary and the end of the memory area, and a corresponding DMA channel determination means provided for each DMA channel Multiple access request generation that generates an access request instructing high-speed page access for each partial area determined by Means and a two-port memory shared by each DMA channel and connected to two buses. is there Buffer means and arbitration means are provided. Here, when a plurality of accepting means holds a DMA transfer request for only one DMA channel, the arbitrating means performs access according to the access request corresponding to the DMA channel, and already holds the DMA transfer request. If a transfer request for another DMA channel is accepted and the transfer destination of the previous DMA transfer and the transfer source of the new DMA transfer are memories on different buses, the transfer is in progress. When the reading from the transfer source for all the transfer data of the other DMA channel is completed and there is a free area corresponding to the read size of the first partial area of the other DMA channel in the buffer means, the other DMA Start reading the first partial region of the channel.
[0107]
According to this configuration, it is possible to guarantee high-speed page access for each partial area delimited by page boundaries in the memory area to be transferred, and to read all data from the memory area to the buffer in the preceding DMA transfer. After the completion, the previous DMA transfer write and the new DMA transfer write can be executed in parallel.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of a main part of an information processing apparatus including a DMA transfer apparatus according to a first embodiment of the present invention.
FIG. 2 is a block diagram showing a configuration of a DMA transfer apparatus.
FIG. 3 shows an example of a partial area determined by a read determination unit.
FIG. 4 shows an example of a partial area determined by a writing determination unit.
FIG. 5 is a block diagram illustrating a detailed configuration example of a partial region determination unit.
FIG. 6 is a diagram showing the number of bytes from the head address to the most recent page boundary as a result of subtracting the lower 4 bits of the head address of the unread area from the constant corresponding to the page size.
FIG. 7 is a block diagram illustrating a detailed configuration example of a partial region determination unit.
FIG. 8 is a diagram showing the number of bytes from the head address to the most recent page boundary as a result of subtracting the lower 4 bits of the head address of an unwritten area from a constant corresponding to the page size.
9 is an explanatory diagram showing a state of DMA transfer between the transfer source and transfer destination storage areas shown in FIGS. 3 and 4. FIG.
10 is a time chart showing the timing of DMA transfer in FIG. 9;
FIG. 11 is a block diagram showing a configuration of a DMA transfer system according to a second embodiment of the present invention.
FIG. 12 is a block diagram illustrating a detailed configuration of an access determination unit.
FIG. 13 is a time chart showing the timing of DMA transfer in the DMA transfer system.
FIG. 14 is a block diagram showing a configuration of a DMA transfer apparatus 8 according to a third embodiment of the present invention.
FIG. 15 is a time chart showing the timing of DMA transfer in the DMA transfer apparatus of this embodiment.
FIG. 16 is a block diagram showing a configuration of a DMA transfer system according to a fourth embodiment of the present invention.
FIG. 17 shows a configuration example of a 2-port buffer.
18 is an explanatory diagram showing a case where the transfer destination of DMA channel 0 and the transfer source of DMA channel 1 are different memories; FIG. .
FIG. 19 is a time chart showing an operation example in the case of FIG.
[Explanation of symbols]
1 DMA transfer device
2 CPU
3 SDRAM I / F
4 SDRAM
5 I / O section
100 Mode setting section
101-105 registers
110 Access decision unit
111 Buffer manager
112 Read / write decision unit
120 Access control unit
130 buffers
200 Read manager
201 Address counter
202 Data counter
210 Read determination unit
211 Partial region determination unit
211a subtractor
211b comparator
211c selector
212 Address register
213 size register
300 Write manager
301 Address counter
302 data counter
310 Write determination unit
311 Partial region determination unit
312 Address register
313 size register
411 Access decision unit

Claims (7)

高速ページアクセスに対応するメモリを転送対象とするDMA転送装置であって、
転送元となる第一メモリ領域において、前記第一メモリ領域の先頭アドレス、前記第一メモリ領域における一または複数存在するページ境界、及び前記第一メモリ領域の末尾アドレスによって、それぞれ区切られた複数の転送元部分領域を判別する第一判別部と、
転送先であり、前記第一メモリ領域の先頭アドレスに対し、ページ領域における相対位置を示すアドレスが異なる先頭アドレスを有する第二メモリ領域において、前記第二メモリ領域の先頭アドレス、前記第二メモリ領域における一または複数存在するページ境界、及び前記第二メモリ領域の末尾アドレスによって、それぞれ区切られた複数の転送先部分領域を判別する第二判別部と、
データ保持機能を有するバッファ部と、
前記バッファ部の空き領域のサイズと、第1転送元部分領域のサイズとを比較し、前記バッファ部の空き領域のサイズが前記第1転送元部分領域のサイズよりも大きい場合に、前記第1転送元部分領域の第1データを読み出して前記バッファ部に書き込みを行うことを決定し、前記バッファ部に保持されている前記第1データのデータサイズと、先頭アドレスとページ境界とで区切られた第1転送先部分領域のサイズとを比較し、前記第1データのデータサイズが前記第1転送先部分領域のサイズよりも大きい場合に、前第1データのうち、前記第1転送先部分領域と同じサイズの第2データ前記バッファ部から読み出して前記第1転送先部分領域に書き込みを行うことを決定するリード/ライト決定部と、
前記リード/ライト決定部の決定に従って、前記第1転送元部分領域から前記第1データを読み出して前記バッファ部への書き込みと、前記バッファ部から前記第2データを読み出して前記第1転送先部分領域への書き込みと、を行なうアクセス制御部と、
を有するDMA転送装置。
A DMA transfer apparatus for transferring a memory corresponding to high-speed page access,
In the first memory area that is the transfer source, a plurality of addresses delimited by a start address of the first memory area, one or more page boundaries in the first memory area, and an end address of the first memory area A first discriminating unit for discriminating a transfer source partial area;
In a second memory area that is a transfer destination and has a start address in which an address indicating a relative position in the page area is different from the start address of the first memory area, the start address of the second memory area, the second memory area A second discriminating unit that discriminates a plurality of transfer destination partial areas each divided by one or a plurality of existing page boundaries and an end address of the second memory area;
A buffer unit having a data holding function;
The size of the empty area of the buffer unit is compared with the size of the first transfer source partial area, and when the size of the empty area of the buffer unit is larger than the size of the first transfer source partial area, the first It is determined that the first data in the transfer source partial area is read and written to the buffer unit, and is delimited by the data size of the first data held in the buffer unit , the start address, and the page boundary comparing the size of the first transfer destination subregion, when the data size of the first data is larger than the size of the first transfer destination subregion, among the pre-Symbol first data, the first transfer destination portion A read / write determining unit that determines that second data having the same size as the region is read from the buffer unit and written to the first transfer destination partial region;
According to the determination of the read / write determination unit, the first data is read from the first transfer source partial area and written to the buffer unit, and the second data is read from the buffer unit and the first transfer destination part An access control unit for writing to the area;
A DMA transfer apparatus.
前記バッファ部は1ポートメモリであり、
前記アクセス制御部は、前記リード/ライト決定部の決定に従って、前記第1転送元部分領域から前記第1データを読み出して前記バッファ部への書き込みと、前記バッファ部から前記第2データを読み出して前記第1転送先部分領域への書き込みと、のいずれかを行なう請求項1記載のDMA転送装置。
The buffer unit is a 1-port memory,
The access control unit reads the first data from the first transfer source partial area to write to the buffer unit and reads the second data from the buffer unit according to the determination of the read / write determination unit. 2. The DMA transfer device according to claim 1, wherein the DMA transfer device performs any one of writing to the first transfer destination partial area.
請求項1に記載のDMA転送装置であって、The DMA transfer device according to claim 1,
転送対象である前記メモリが前記第1転送元部分領域から構成される場合において、In the case where the memory to be transferred is composed of the first transfer source partial area,
前記リード/ライト決定部は、前記アクセス制御部が前記バッファ部から前記第2データを読み出して前記転送先部分領域への書き込みを行った後、前記第1データのうち前記第2データ以外の第3データを前記バッファ部から読み出して、前記第1転送先部分領域における末尾アドレスの次のアドレスを先頭アドレスとする第2転送先部分領域に書き込みを行うことを決定するDMA転送装置。The read / write determination unit reads the second data from the buffer unit and writes the second data in the transfer destination partial area after the access control unit reads out the second data from the buffer unit. A DMA transfer apparatus that reads three data from the buffer unit and decides to write to a second transfer destination partial area having a next address after a tail address in the first transfer destination partial area as a head address.
転送対象である前記メモリが複数の転送元部分領域のデータを含む場合において、
前記リード/ライト決定部は、前記アクセス制御部が前記バッファ部から前記第2データを読み出して前記第1転送先部分領域への書き込みを行った後、前記バッファ部の空き領域のサイズと、前記第1転送元部分領域における末尾アドレスの次のアドレスを先頭アドレスとする第2転送元部分領域のサイズとを比較し、前記バッファ部の空き領域のサイズが前記第2転送元部分領域のサイズよりも大きい場合に、前記第2転送元部分領域の第4データを読み出して前記バッファ部に書き込みを行ことを決定する請求項記載のDMA転送装置。
In the case where the memory to be transferred includes data of a plurality of transfer source partial areas,
The read / write determination unit, after the access control unit reads the second data from the buffer unit and writes the second data to the first transfer destination partial region, the size of the empty region of the buffer unit, The size of the second transfer source partial area whose head address is the next address after the end address in the first transfer source partial area is compared, and the size of the empty area of the buffer unit is larger than the size of the second transfer source partial area. when is large, DMA transfer device according to claim 1, wherein determining that intends row write to the buffer unit fourth data reads of the second transfer source subregion.
前記リード/ライト決定部は、前記第1データのうち前記第2データ以外の第3データおよび前記第4データと、前記第1転送先部分領域における末尾アドレスの次のアドレスを先頭アドレスとする第2転送先部分領域のサイズとを比較し、前記第3データおよび前記第4データのデータサイズが前記第2転送先部分領域のサイズよりも大きい場合に、前記第3データおよび前記第4データのうち、前記第2転送先部分領域と同じサイズのデータを前記バッファ部から読み出して前記第2転送先部分領域に書き込みを行うことを決定する請求項4に記載のDMA転送装置。The read / write determining unit includes a third address other than the second data and the fourth data in the first data, and a first address that is an address next to the end address in the first transfer destination partial area. 2 When the size of the third data and the fourth data is larger than the size of the second transfer destination partial area, the sizes of the third data and the fourth data are compared. 5. The DMA transfer apparatus according to claim 4, wherein data having the same size as the second transfer destination partial area is read from the buffer unit and is determined to be written to the second transfer destination partial area. 前記バッファ部は2つのバスに接続される2ポートメモリであり、
前記アクセス制御部は、前記リード/ライト決定部の決定に従って、前記転送元部分領域から前記第1データを読み出して前記バッファ部への書き込みと、前記バッファ部から前記第2データを読み出して前記転送先部分領域への書き込みと、を独立に行なうアクセス制御部と、
を有する請求項1記載のDMA転送装置。
The buffer unit is a two-port memory connected to two buses,
The access control unit reads the first data from the transfer source partial area and writes to the buffer unit, and reads the second data from the buffer unit according to the determination of the read / write determination unit. An access control unit that independently performs writing to the destination partial area;
The DMA transfer apparatus according to claim 1, comprising:
高速ページアクセスに対応するメモリを転送対象とするDMA転送方法であって、
転送元となる第一メモリ領域において、前記第一メモリ領域の先頭アドレス、前記第一メモリ領域における一または複数存在するページ境界、及び前記第一メモリ領域の末尾アドレスによって、それぞれ区切られた複数の転送元部分領域を判別し、
転送先であり、前記第一メモリ領域の先頭アドレスに対し、ページ領域における相対位置を示すアドレスが異なる先頭アドレスを有する第二メモリ領域において、前記第二メモリ領域の先頭アドレス、前記第二メモリ領域における一または複数存在するページ境界、及び前記第二メモリ領域の末尾アドレスによって、それぞれ区切られた複数の転送先部分領域を判別し、
データ保持機能を有するバッファ部の空き領域のサイズと、前記転送元部分領域のサイズとを比較し、前記バッファ部の空き領域のサイズが前記転送元部分領域のサイズよりも大きい場合に、前記転送元部分領域の第1データを読み出して前記バッファ部に書き込みを行うことを決定し、
前記バッファ部に保持されている前記第1データのデータサイズと前記転送先部分領域のサイズとを比較し、前記第1データのデータサイズが前記転送先部分領域のサイズよりも大きい場合に、前記第1データのうち、前記転送先部分領域と同じサイズの第2データを前記バッファ部から読み出して前記転送先部分領域に書き込みを行うことを決定し
き込みを行うか否かの決定に従って、前記転送元部分領域から前記第1データを読み出して前記バッファ部への書き込みと、前記バッファ部から前記第2データを読み出して前記転送先部分領域への書き込みと、を行なうDMA転送方法。
A DMA transfer method for transferring a memory corresponding to high-speed page access,
In the first memory area that is the transfer source, a plurality of addresses delimited by a start address of the first memory area, one or more page boundaries in the first memory area, and an end address of the first memory area Determine the transfer source partial area,
In a second memory area that is a transfer destination and has a start address in which an address indicating a relative position in the page area is different from the start address of the first memory area, the start address of the second memory area, the second memory area A plurality of transfer destination partial areas delimited by one or a plurality of existing page boundaries and the end address of the second memory area,
The size of the free area of the buffer unit having a data holding function is compared with the size of the transfer source partial area, and when the size of the free area of the buffer unit is larger than the size of the transfer source partial area, the transfer Deciding to read the first data of the original partial area and write to the buffer unit,
Comparing the size of the data size of the first data held in the buffer unit and the transfer destination subregion, when the data size of the first data is larger than the size of the transfer destination partial region, wherein of the first data, it determines that writing to the transfer destination subregion the second data having the same size as the transfer destination partial region the heading buffer unit or Ra読,
According to whether the decision performs write write-out, the transfer and writing to the buffer unit from the original partial region reading said first data, said to the destination subregion from the buffer unit reads the second data DMA transfer method for performing writing of data.
JP33962399A 1998-11-30 1999-11-30 DMA transfer apparatus and DMA transfer system Expired - Fee Related JP4536189B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP33962399A JP4536189B2 (en) 1998-11-30 1999-11-30 DMA transfer apparatus and DMA transfer system

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP10-338739 1998-11-30
JP33873998 1998-11-30
JP33962399A JP4536189B2 (en) 1998-11-30 1999-11-30 DMA transfer apparatus and DMA transfer system

Publications (2)

Publication Number Publication Date
JP2000227897A JP2000227897A (en) 2000-08-15
JP4536189B2 true JP4536189B2 (en) 2010-09-01

Family

ID=26576190

Family Applications (1)

Application Number Title Priority Date Filing Date
JP33962399A Expired - Fee Related JP4536189B2 (en) 1998-11-30 1999-11-30 DMA transfer apparatus and DMA transfer system

Country Status (1)

Country Link
JP (1) JP4536189B2 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6816921B2 (en) * 2000-09-08 2004-11-09 Texas Instruments Incorporated Micro-controller direct memory access (DMA) operation with adjustable word size transfers and address alignment/incrementing
JP4606725B2 (en) * 2003-11-10 2011-01-05 株式会社デジタル High speed memory access controller
US7908411B2 (en) * 2006-09-20 2011-03-15 Panasonic Corporation Data transfer device and mobile telephone
US8732382B2 (en) 2008-08-06 2014-05-20 Qualcomm Incorporated Haltable and restartable DMA engine
JP2011034414A (en) * 2009-08-03 2011-02-17 Canon Inc Dma controller
CN114461552B (en) * 2022-01-26 2024-01-30 北京经纬恒润科技股份有限公司 Data storage method and device
CN114546906B (en) * 2022-01-28 2023-06-23 郑州信大捷安信息技术股份有限公司 Data interaction method and system based on ring communication mechanism

Also Published As

Publication number Publication date
JP2000227897A (en) 2000-08-15

Similar Documents

Publication Publication Date Title
US6633926B1 (en) DMA transfer device capable of high-speed consecutive access to pages in a memory
US7165126B2 (en) Direct memory access device
JP5287301B2 (en) Descriptor transfer device, I / O controller, and descriptor transfer method
TW202015044A (en) Data management method and storage controller using the same
JP4536189B2 (en) DMA transfer apparatus and DMA transfer system
US20070011398A1 (en) Method and device for transferring data between a main memory and a storage device
US6728806B2 (en) Data processing unit
JP4266900B2 (en) Image processing system
US20080016296A1 (en) Data processing system
US6615292B1 (en) Data transfer apparatus performing DMA data transfer from non-consecutive addresses
CN111045961B (en) Data processing method and memory controller using the same
US20080209085A1 (en) Semiconductor device and dma transfer method
JP4335327B2 (en) Arbitration apparatus and method
JP4431492B2 (en) Data transfer unit that supports multiple coherency granules
JP3217348B2 (en) Information processing system
JP2006331008A (en) Memory interface
JP2005063358A (en) Instruction supply controller and semiconductor device
JPH1011387A (en) Information processor
JPH0736806A (en) Dma system
JP2972568B2 (en) Bus extender
JPH0833869B2 (en) Data processing device
JP2004227445A (en) Copying method for storage device subsystem and storage device subsystem therefor
JP2972711B2 (en) Ordering control method and node
JP2001154978A (en) Dma controller and its control method
JPH11312123A (en) Cache controller

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060620

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090401

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090602

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090731

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20091208

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100203

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20100525

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20100616

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

Free format text: PAYMENT UNTIL: 20130625

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees