JP2004030602A - Data processor - Google Patents

Data processor Download PDF

Info

Publication number
JP2004030602A
JP2004030602A JP2003120875A JP2003120875A JP2004030602A JP 2004030602 A JP2004030602 A JP 2004030602A JP 2003120875 A JP2003120875 A JP 2003120875A JP 2003120875 A JP2003120875 A JP 2003120875A JP 2004030602 A JP2004030602 A JP 2004030602A
Authority
JP
Japan
Prior art keywords
data
memory
dma
access
control circuit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2003120875A
Other languages
Japanese (ja)
Inventor
Hideki Ishibashi
石橋 秀樹
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.)
Sanyo Electric Co Ltd
Original Assignee
Sanyo Electric 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 Sanyo Electric Co Ltd filed Critical Sanyo Electric Co Ltd
Priority to JP2003120875A priority Critical patent/JP2004030602A/en
Publication of JP2004030602A publication Critical patent/JP2004030602A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Bus Control (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a data processor which can realize high speed data processing. <P>SOLUTION: An SDRAM (synchronous dynamic random access memory) 12 is a memory of which the effective throughput is enhanced as data amount to be accessed at once is increased, a buffer 30 is a memory to be accessed by every address and a compact flash (R) 46 is a memory to be accessed by every sector. DMA data transfer by every sector is performed by a write control circuit 18 and a read control circuit 20 between the SDRAM 12 and the buffer 30 and the DMA data transfer by every sector is performed by a read control circuit 26 and write control circuit 28 between the buffer 30 and the compact flash (R) 46. A CPU 54 performs data access to the buffer 30 in a program control system and access data amount in this case is smaller than one sector. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【産業上の利用分野】
この発明は、データ処理装置に関し、たとえばディジタルカメラに適用され、第1メモリおよび第2メモリの間でデータを転送する、データ処理装置に関する。
【0002】
【従来の技術】
従来から周知のデータ処理装置として、DMA(Direct Memory Access)制御方式およびプログラム制御方式の2つの方式を併用して、メモリにアクセスするものがある。DMA制御方式は、大量のデータを2つのメモリ間で転送する場合に用いられ、プログラム制御方式は制御情報などの短いデータをメモリとCPUとの間でやり取りするときに用いられる。
【0003】
【発明が解決しようとする課題】
しかし、従来技術では、アクセス先のメモリの特性によっては、プログラム制御方式のアクセスに時間がかかり、全体の処理速度が低下する場合が生じる。たとえば、一方のメモリがバースト転送方式を採用するSDRAMで、他方のメモリがセクタ単位でのアクセスを基本とするコンパクトフラッシュである場合、1セクタ未満のデータをプログラム制御方式で読み出したいときに問題が生じる。つまり、バースト転送方式では、一括してアクセスするデータ量が多ければ多いほど実効スループットが向上するが、逆に言えば、少量のデータアクセスを行なうときは実効スループットが低下してしまう。一方、コンパクトフラッシュでは、上述のように1セクタ毎のアクセスが基本であるため、少量のデータアクセスを行なうメモリには適していない。
【0004】
また、従来技術では、制御バスはDMAコントローラおよびCPUに個別に割り当てられているものの、データバスはDMAコントローラおよびCPUによって共用される。このため、CPUがデータバスを一度開放すると、データバスはDMAコントローラによって占有されてしまい、CPUは、DMAコントローラの処理が完了しない限り、データバスを獲得できない。
【0005】
このように、従来技術では、アクセス先のメモリの特性やバスとの接続関係などの点で、処理速度が低下するという問題があった。
【0006】
それゆえに、この発明の主たる目的は、高速データ処理を実現できる、データ処理装置を提供することである。
【0007】
【課題を解決するための手段】
第1の発明は、第1メモリと第2メモリとの間で所定量のDMAデータ転送を行なう第1DMAコントローラ、第2メモリと第3メモリとの間で所定量のDMAデータ転送行なう第2DMAコントローラ、および第2メモリに対してプログラム制御方式のデータアクセスを行なうCPUを備え、第1メモリは1回にアクセスするデータ量が多くなるほど実効スループットが向上するメモリであり、第2メモリは所定アドレス数毎にアクセスされるメモリであり、第3メモリは前記所定量毎にアクセスされるメモリであり、そしてCPUが第2メモリにアクセスするときのデータ量は所定量よりも少ない、データ処理装置である。
【0008】
第2の発明は、第1メモリに対して第1データバスを通してDMA制御方式のデータアクセスを行なうDMAコントローラ、第1メモリに対して第2データバスを通してプログラム制御方式のデータアクセスを行なうCPU、およびDMAコントローラから第1メモリへの第1アクセス要求およびCPUから第1メモリへの第2アクセス要求を調停する調停回路を備える、データ処理装置である。
【0009】
【作用】
第1の発明では、第1DMAコントローラが第1メモリと第2メモリとの間で所定量のDMAデータ転送を行ない、第2DMAコントローラが第2メモリと第3メモリとの間で所定量のDMAデータ転送行ない、CPUが第2メモリに対してプログラム制御方式のデータアクセスを行なう。ここで、第1メモリは1回にアクセスするデータ量が多くなるほど実効スループットが向上するメモリであり、第2メモリは所定アドレス数毎にアクセスされるメモリであり、第3メモリは所定量毎にアクセスされるメモリである。一方、CPUが第2メモリにアクセスするときのデータ量は、所定量よりも少ない。
【0010】
このため、CPUが第2メモリにアクセスするのに要する時間は、CPUが第1メモリにアクセスするのに要する時間よりも短くなる。また、第3メモリへのアクセスは所定量毎に行なわれるため、CPUは、第2メモリをアクセス先とすることで効率的なアクセスが可能となる。
【0011】
この発明の好ましい例では、第2メモリは、各々が少なくとも所定量に相当する容量を持つ複数のバンクを含む。ここで、CPUは、第2メモリの特定のバンクにのみアクセスし、第1DMAコントローラは、第2メモリの特定のバンク以外のバンクにのみアクセスし、第2DMAコントローラは、複数のバンクのいずれにもアクセスする。
【0012】
さらに好ましくは、第3メモリは所望データおよび所望データを管理する管理データを格納し、第2DMAコントローラは、管理データについて特定のバンクと第3メモリとの間でDMAデータ転送を行ない、CPUは特定のバンクに格納された管理データにアクセスする。これによって、管理データが所望データによって上書きされるのを防止できる。
【0013】
この発明の好ましい他の例では、第3メモリはアクセスが可能であるかどうかを示す状態信号を発生する。ここで、CPUは状態信号が示す状態に関係なく第2DMAコントローラに対してDMAデータ転送を要求し、第2DMAコントローラは状態信号が示す状態に応じて前記第3メモリにアクセスする。これによって、第2DMAコントローラは第3メモリがアクセス可能となった時点で速やかにDMAデータ転送を開始でき、データ転送処理が高速化される。
【0014】
さらに好ましくは、第1DMAコントローラおよび第2DMAコントローラの一方によるDMAデータ転送に応じてインクリメントされ第1DMAコントローラおよび第2DMAコントローラの他方によるDMAデータ転送に応じてディクリメントされるカウンタが、さらに備えられる。ここで、CPUは、カウンタの値に関係なく第1DMAコントローラおよび第2DMAコントローラにDMAデータ転送を要求し、第1DMAコントローラおよび第2DMAコントローラは、カウンタの値に応じてDMAデータ転送を開始する。これによって、CPUが単に処理要求を発生するだけで、適切なタイミングでDMAデータ転送が実行される。
【0015】
第2の発明では、DMAコントローラは、第1メモリに対して第1データバスを通してDMA制御方式のデータアクセスを行ない、CPUは、第1メモリに対して第2データバスを通してプログラム制御方式のデータアクセスを行なう。そして、DMAコントローラから第1メモリへの第1アクセス要求およびCPUから第1メモリへの第2アクセス要求は、調停回路によって調停される。このため、DMA制御方式のデータアクセスの途中でプログラム制御方式のデータアクセスを行なうようなとき、バスの占有関係を切り換える必要がない。
【0016】
この発明の好ましい例では、調停回路は、CPUからの第2アクセス要求を優先的に受け付ける。このため、第1アクセス要求および第2アクセス要求が同時に発生したような場合、CPUが優先的に第1メモリにアクセスする。
【0017】
【発明の効果】
第1の発明によれば、CPUが第2メモリにアクセスするのに要する時間は、CPUが第1メモリにアクセスするのに要する時間よりも短くなるため、全体の処理を高速化できる。また、第3メモリへのアクセスは所定量毎に行なわれるため、CPUは、必要なデータに効率的にアクセスすることができる。
【0018】
第2の発明によれば、DMA制御方式のデータアクセスの途中でプログラム制御方式のデータアクセスを行ないたいようなときにバスの占有関係を切り換える必要がないため、処理を高速化できる。
【0019】
この発明の上述の目的,その他の目的,特徴および利点は、図面を参照して行う以下の実施例の詳細な説明から一層明らかとなろう。
【0020】
【実施例】
図1を参照して、この実施例のディジタルカメラ10は、データを格納するメモリとして、SDRAM12,コンパクトフラッシュ(CF)46,レジスタ36,バッファ30およびフラッシュメモリ52を含む。このうち、SDRAM12は、撮影された画像データを含む画像ファイルを一時的に記録するための内部メモリであり、コンパクトフラッシュ46は、このような画像ファイルを記録するため着脱自在の記録媒体である。レジスタ36は、後述するDMAデータ転送のための処理要求を格納する内部メモリであり、バッファ30は、SDRAM12とコンパクトフラッシュ46との間でDMA転送される画像データ、あるいはコンパクトフラッシュ46のFAT情報データを一時的に格納する内部メモリである。フラッシュメモリ52は、CPU54のプログラムを格納する内部メモリである。
【0021】
SDRAM12に対するアクセスはアクセス制御回路14およびアクセス要求制御回路16によって制御され、コンパクトフラッシュ46に対するアクセスはアクセス制御回路42およびアクセス要求制御回路44によって制御される。また、レジスタ36に対するアクセスはアクセス制御回路38およびアクセス要求制御回路40によって制御され、バッファ30a〜30cに対するアクセスはアクセス制御回路32およびアクセス要求制御回路34によって制御される。さらに、フラッシュメモリ52に対するアクセスはアクセス制御回路50およびアクセス要求制御回路48によって制御される。
【0022】
各々のアクセス要求制御回路は、アクセス要求が与えられたとき要求元に承認信号ACKを返送し、要求元は、この承認信号に応答して、アクセス信号をアクセス要求制御回路に与える。また、アクセス態様が書き込みの場合、要求元はアクセス信号とともに書き込みに係るデータをアクセス要求制御回路に与える。アクセス信号(およびデータ)は、アクセス要求制御回路を通してアクセス制御回路に与えられ、アクセス制御回路は、入力されたアクセス信号に従ってメモリにアクセスする。
【0023】
アクセス要求制御回路34,40および48にはCPU54からのみアクセス要求が発せられる。これに対して、アクセス要求制御回路16には、CPU54以外にライト制御回路18,リード制御回路20およびカメラ処理系のDMAコントローラ58からもアクセス要求が与えられる。アクセス要求制御回路42にも、CPU54のほかにリード制御回路26およびライト制御回路28からアクセス要求が与えられる。つまり、アクセス要求制御回路16および42には、複数のアクセス要求が同時に入力される可能性があり、アクセス要求制御回路16および42は、同時に入力された各々のアクセス要求を調停していずれかの要求元に承認信号ACKを返送する。ただし、アクセス要求制御回路16および42はCPU54に優先順位を与えており、複数のアクセス要求が与えられたときは、CPU54からのアクセス要求を最優先で受け付ける。
【0024】
なお、カメラ処理には、撮影された生画像データ(RAWデータ)をYUVデータに変換するYUV変換処理、ならびにYUVデータを圧縮して圧縮YUVデータ(上述の画像データ)を生成する圧縮処理があり、RAWデータ,YUVデータおよび圧縮YUVデータのいずれも、対応するDMAコントローラによってSDRAM12に対するライト/リード処理を施される。上述のDMAコントローラ58は、このようなカメラ処理を行なう複数のDMAコントローラを含む概念である。ここで、DMAコントローラ58は、制御バスCBDMA4および32ビットのデータバスDBDMA5を通してアクセス要求制御回路16にアクセスする。
【0025】
SDRAM12はバースト転送方式のメモリであり、先頭アドレスを指定すれば、これに続く複数アドレスに連続してアクセスすることができる。つまり、読み出し時は、連続する複数のアドレスに格納されたデータを1回で読み出すことができ、書き込み時は、複数アドレス分のデータを連続する複数のアドレスに1回で書き込むことができる。SDRAM12でもランダムアクセスは可能であるが、アドレスがロウ(ROW)およびコラム(COLUMN)に分割されており、ロウアドレスを先に設定するというオーバヘッドがあるため、1ワード毎のアクセスでは効率が悪くなる。このような理由から、バースト転送方式では、アクセスする1回あたりのデータ量が大きいほど、実効スループットが向上する。バーストアクセスを行なう場合、アクセス要求制御回路16に与えられるアクセス信号には、アクセス先の先頭アドレス情報,データサイズ情報およびリード/ライトを示すアクセス態様情報が含まれる。
【0026】
コンパクトフラッシュ46は、図2に示すようにコントローラ46a,バッファメモリ46bおよび主メモリ46cを含み、コントローラ46aはバッファメモリ46bを介して主メモリ46cにアクセスする。バッファメモリ46bは1セクタ(512バイト)分の容量を持ち、アクセスは1セクタ毎に行なわれる。したがって、アクセス要求制御回路42に与えられるアクセス信号には、所望のセクタアドレス情報およびリード/ライトを示すアクセス態様情報が含まれる。内部転送が行なわれているとき、コンパクトフラッシュ46はビジー状態となり、内部転送が行なわれていないとき、コンパクトフラッシュ46はレディ状態となる。このようなレディ状態およびビジー状態の判別信号は、コンパクトフラッシュ46の特定の入出力ポートから出力される。
【0027】
なお、主メモリ46cにアクセスするためには、上述のアクセス信号に先立って、所望のセクタ番号およびアクセスの態様をコントローラ46aに設定する必要がある。
【0028】
レジスタ36は、図3に示すように形成される。SDRAM側ライト制御回路(ライト制御回路18),SDRAM側リード制御回路(リード制御回路20),CF側ライト制御回路(ライト制御回路28)およびCF側リード制御回路(リード制御回路26)が、いわゆるDMAコントローラである。処理要求は、アドレス情報,バンク情報および転送サイズ情報からなり、これらの情報を格納する欄が各々のDMAコントローラに対応してレジスタ36に形成される。処理要求をレジスタ36に設定するとき、アクセス要求制御回路40には、書き込み先のアドレス情報(書き込み欄の位置情報)およびアクセス態様情報“ライト”を含むアクセス信号と処理要求を形成する各情報データが与えられる。処理要求に含まれるアドレス情報,バンク情報および転送サイズ情報は、アクセス信号に基づいて所望の欄に書き込まれる。
【0029】
バッファ30としては、図4に示すように3つのバンク0〜2を持つSRAMが適用され、各々のバンクは512バイトの容量を持つ。各バンクへのアクセスは1アドレス毎に行なわれる。このため、バッファ30へのアクセス信号には、アクセス先のバンク情報,アドレス情報およびリード/ライトを示すアクセス態様情報が含まれる。
【0030】
フラッシュメモリ52に対するアクセスは、バッファ30と同じように、アクセス先のアドレス情報およびリード/ライトを示すアクセス態様情報を含むアクセス信号によって行なわれる。
【0031】
各々の回路およびメモリ間の主な接続関係を以下に説明する。アクセス要求制御回路16は、制御バスCBDMA1によってライト制御回路18およびリード制御回路20と接続され、制御バスCBCPU1によってCPU54ならびにアクセス要求制御回路34,40,42および48と接続される。アクセス要求制御回路16はまた、データバスDBDMA1によってライト制御回路18と接続され、データバスDBDMA2によってリード制御回路20と接続され、データバスDBCPU1およびDBCPU2によってアクセス要求制御回路34,40,42および48と接続される。データバスDBCPU1およびDBCPU2はまた、CPU54が接続されたデータバスDBCPU3と双方向バッファ56を介して接続される。アクセス要求制御回路42は、上述の接続に加えて、制御バスCBDMA3によってリード制御回路26およびライト制御回路28と接続され、データバスDBDMA3およびDBDMA4によってリード制御回路26およびライト制御回路28の各々と接続される。
【0032】
リード制御回路20および26は、制御バスCBCOM1およびデータバスDBCOM1によってバッファ30の入力側と接続され、ライト制御回路18および28は、制御バスCBCOM2およびデータバスDBCOM2によってバッファ30の出力側と接続される。また、リード制御回路20および26およびライト制御回路18および28のいずれも、制御バスCBDMA2によってレジスタ36と接続される。制御バスCBCOM1およびCBCOM2ならびにデータバスDBCOM1およびDBCOM2は、アクセス制御回路32にも接続される。
【0033】
つまり、データバスDBDMA1,DBDMA2,DBDMA3およびDBDMA4はそれぞれ、ライト制御回路18,リード制御回路20,ライト制御回路28およびリード制御回路26専用のデータバスであり、DBCPU1〜DBCPU3はCPU54に専用のデータバスである。これに対して、データバスDBCOM1およびDBCOM2は、ライト制御回路18および28,リード制御回路20および26ならびにCPU54によって共有される。なお、データバスDBDMA1およびDBDMA2は32ビットのバスであり、データバスDBDMA3およびDBDMA4は16ビットのバスである。
【0034】
リード制御回路20は、レジスタ36のSDRAM側リード制御回路の欄に処理要求が設定されたとき、図5に示すフロー図に従って動作する。
【0035】
SDRAM12の所望の先頭アドレス情報,バンク0〜2のいずれか1つを示すバンク情報および“512バイト”の転送サイズ情報がレジスタ36のSDRAM側リード制御回路の欄に設定された場合、まずステップS1で内部カウンタ20aの値が“0”であるかどうか判別する。そして、カウント値が“1”以上であればステップS1の処理をくり返し、カウント値が“0”となったとき、アクセス先のバンクが空になったとみなしてステップS3に進む。ステップS3では、アクセス要求を制御バスCBDMA1を通してアクセス要求制御回路16に発する。これに対して承認信号ACKが返送されると、ステップS5でYESと判断し、ステップS7でアクセス信号(先頭アドレス情報,リードを示すアクセス態様情報,512バイトのサイズ情報)を、同じ制御バスCBDMA1を通してアクセス要求制御回路16に出力する。所望の先頭アドレス以降に書き込まれた512バイト分のデータはアクセス制御回路12によって読み出され、データバスDBDMA2を介してリード制御回路20に入力される。
【0036】
ステップS9では、アクセス要求制御回路16から入力された4バイト(32ビット)分のデータをデータバスDBCOM1を介してバッファ30に与えるとともに、指定されたバンクのアドレス信号を制御バスCBDMA2を介してバッファ30に与える。続いて、ステップS11で共有カウンタ24および内部カウンタ20aを“4”インクリメントし、ステップS11でカウンタ20aの値を“512”と比較する。そして、カウント値が“512”未満であればステップS9およびS11の処理を繰り返す。この結果、入力された512バイトのデータは所望のバンクに先頭アドレスから順に書き込まれ、共有カウンタ24および内部カウンタ20aのカウント値は“512”までインクリメントされる。カウント値が“512”に達すると、ステップS15で終了フラグを発行する。終了フラグは、割り込み端子(図示せず)を通してCPU54に与えられる。
【0037】
ライト制御回路28は、レジスタ36のCF側ライト制御回路の欄に処理要求が設定されたとき、図6に示すフロー図に従って動作する。
【0038】
コンパクトフラッシュ46の所望のセクタアドレス情報,所望のバンクを示すバンク情報および“512バイト”の転送サイズ情報がレジスタ36のCF側ライト制御回路の欄に設定されると、まずステップS21でコンパクトフラッシュ46がレディ状態/ビジー状態のいずれにあるかを状態信号に基づいて判別する。そして、ビジー状態であればステップS21の処理を繰り返し、レディ状態に移行したときにステップS23に進む。ステップS23では、共有カウンタ24の値が“2”以上を示しているかどうか判断し、NOであれば同じ処理を繰り返す。カウント値が“2”以上となると、所望のバンクに転送可能なデータが格納されたとみなして、ステップS25でアクセス要求を発生する。アクセス要求は、制御バスCBDMA3を通してアクセス要求制御回路42に与えられる。
【0039】
このアクセス要求に対してアクセス要求制御回路42から承認信号ACKが返送されると、ステップS29でアクセス信号(セクタアドレス情報,ライトのアクセス態様情報,512バイトのデータサイズ情報)を発生し、ステップS31で所望のバンクのアドレス信号をバッファ30に与える。アクセス信号は制御バスCBDMA3を通してアクセス要求制御回路42に与えられ、アドレス信号は制御バスCBCOM2を通してバッファ30に与えられる。これによって、所望のバンクの所望のアドレスに格納された2バイト(16ビット)分のデータがデータバスDBCOM2を通して読み出され、読み出されたデータは、データバスDBDMA3を通してアクセス要求制御回路42に与えられる。ステップS33では共有カウンタ24の値を“2”ディクリメントするとともに内部カウンタ28aの値を“2”インクリメントし、続くステップS35では内部カウンタ28aの値を“512”と比較する。そして、カウント値が“512”未満であればステップS23〜S33の処理を繰り返すが、カウント値が“512”であれば、ステップS37で終了フラグを発行する。
【0040】
ステップS23〜ステップS35の処理が繰り返されることによって、バッファ30から読み出された512バイト分のデータが、データバスDBDMA3,アクセス要求制御回路42およびアクセス制御回路44を経てコンパクトフラッシュ46に与えられる。コントローラ46aは、与えられた512バイトのデータを一旦バッファメモリ46bに蓄積し、バッファメモリ46bが満杯となったときにこの512バイトのデータを主メモリ46cの所望のセクタに書き込む。
【0041】
リード制御回路26は、レジスタ36のCF側リード制御回路の欄に処理要求が設定されたとき、図7に示すフロー図に従って動作する。
【0042】
コンパクトフラッシュ46の所望のセクタアドレス情報,所望のバンクを示すバンク情報および“512バイト”の転送サイズ情報がレジスタ36のCF側リード制御回路の欄に設定されると、ステップS41でコンパクトフラッシュ46の状態を判別し、レディ状態であればステップS43で共有カウンタ22の値を判別する。そして、共有カウンタ22の値が“0”であれば、所望のバンクは空であるとみなし、ステップS45でアクセス要求を制御バスCBDMA3を通してアクセス要求制御回路42に出力する。これに対してアクセス要求制御回路42から承認信号ACKが返送されると、ステップS49でアクセス信号(セクタアドレス情報,リードのアクセス態様情報)を同じ制御バスCBDMA3を通してアクセス要求制御回路42に与える。コンパクトフラッシュ46からは2バイト分のデータが読み出され、読み出されたデータはデータバスDBDMA4を通してリード制御回路26に与えられる。
【0043】
ステップS51では、読み出された2バイトのデータをアドレス信号とともにバッファ30に与える。このとき、データはデータバスDBCOM1を通して、アドレス信号はCBCOM1を通してバッファ30に与えられる。ステップS53では共有カウンタ22を“2”インクリメントし、続くステップS55ではカウント値を“512”と比較する。そして、カウント値が“512”を下回る限りステップS45〜S53の処理を繰り返し、これによって、コンパクトフラッシュ46の所望のセクタからデータが2バイトずつ読み出され、合計512バイトのデータがバッファ30の所望のバンクに格納される。カウント値が“512”となるとステップS55でYESと判断し、ステップS57で終了フラグを発行する。
【0044】
ライト制御回路18は、レジスタ36のSDRAM側ライト制御回路の欄に処理要求が設定されたとき、図8に示すフロー図に従って動作する。
【0045】
SDRAM12の先頭アドレス情報,バンク0〜2のいずれか1つを示すバンク情報および“512バイト”の転送サイズ情報がレジスタ36のSDRAM側ライト制御回路の欄に設定されると、ステップS61で共有カウンタ22の値を“512”と比較し、比較結果が一致を示せば、ステップS63でアクセス要求を制御バスCBDMA1を通してアクセス要求制御回路16に出力する。これに対して承認信号ACKが返送されると、ステップS65でYESと判断し、ステップS67でアクセス信号(先頭アドレス情報,リードを示すアクセス態様情報,512バイトのサイズ情報)を同じ制御バスCBDMA1を通してアクセス要求制御回路16に出力する。
【0046】
ステップS69では、アドレス信号を制御バスCBCOM2を通してバッファ30に与え、4バイト分のデータを所望のバンクから読み出す。読み出されたデータは、データバスDBCOM2およびデータバスDBDMA1を通してアクセス要求制御回路16に与えられる。続いて、ステップS71で共有カウンタ22の値を“4”ディクリメントし、ステップS73でカウント値を“0”と比較する。ここでカウント値が“1”以上であれば、ステップS69およびS71の処理を繰り返し、カウント値が“0”となると、ステップS75で終了フラグを発行する。これによって、所望のバンクから512バイトのデータが読み出され、アクセス制御回路14によってSDRAM12の所望アドレスに書き込まれるとともに、書き込みが完了した時点で終了フラグが発行される。
【0047】
SDRAM12には、上述のように画像ファイルが格納されており、リード制御回路20およびライト制御回路28によるDMA転送の対象となるデータは、この画像ファイルを形成する画像データである。一方、コンパクトフラッシュ46の主メモリ46aには、同様の画像ファイルのほかにFAT情報データも記録されている。つまり、コンパクトフラッシュ46はMS−DOS方式を採用しているため、FATのようなファイル管理情報も主メモリ46aに記録されている。このため、リード制御回路26およびライト制御回路18によるDMA転送の対象となるデータとしては、画像ファイルを形成する画像データ以外にFATデータも含まれる。
【0048】
ただし、FAT情報データはCPU54による空きクラスタの検索のために読み出されるものであり、バッファ30からSDRAM12にDMA転送されることはない。このため、リード制御回路26は、FATデータおよび画像データの両方をコンパクトフラッシュ46からバッファ30にDMA転送するものの、ライト制御回路18は、画像データのみをバッファ30からSDRAM12にDMA転送する。
【0049】
バッファ30に格納されたFATデータは、CPU54によって読み出される。つまり、CPU54が制御バスCBCPU1を通してアクセス要求をアクセス要求制御回路40に与え、これに対する承認信号ACKに応答して、バンク情報,アドレス情報およびアクセス態様情報を含むアクセス信号を同じ制御バスCBCPU1を通してアクセス要求制御回路34に与える。所望のバンクの所望のアドレスに書き込まれたFAT情報データは、アクセス制御回路32によって読み出される。読み出されたFAT情報データは、データバスDBCPU1およびDBCPU3を通してCPU54に与えられる。なお、バッファ30に格納されたFAT情報データが、後続の画像データによって上書きされることのないよう、FAT情報データおよび画像データは互いに別のバンクに格納される。
【0050】
CPU54は、SDRAM12に格納された画像ファイルをコンパクトフラッシュ46に記録するとき、図9および図10に示すフロー図を処理する。
【0051】
まずステップS81で、FAT領域内のいずれかのセクタ番号およびアクセス態様“リード”を、特定の入出力ポートを通してコンパクトフラッシュ46のコントローラ46aに設定する。次に、リード制御回路26にFAT情報データのDMA転送を行なわせるための処理要求を、ステップS83でレジスタ36に設定する。つまり、ステップS1で設定したセクタ番号に対応するセクタアドレス情報,バンク0を示すバンク情報および“512バイト”の転送サイズ情報を図3に示すCF側リード制御回路の欄に書き込む。これによって、FAT領域に書き込まれたFAT情報データの一部がコンパクトフラッシュ46からバッファ30のバンク0にDMA転送される。ステップS85では、このDMA転送処理の終了の有無を終了フラグに応答して判別する。つまり、終了フラグがリード制御回路26から入力されない限りステップS85の処理を繰り返し、終了フラグが与えられると、ステップS87に進む。
【0052】
ステップS87では、アクセス要求制御回路34およびアクセス要求回路32を通してバッファ30のバンク0にアクセスし、バンク0内のFATデータに基づいて空きクラスタを検索する。具体的には、バンク0からFATエントリを読み出して、対応するクラスタが空いているかどうかを判別する。全てのFATエントリの検索が完了すると、空きクラスタが検索されたかどうかをステップS89で判断する。そして、空きクラスタが1つも見つからなかったときは、ステップS91でセクタ番号を更新してからステップS81に戻る。次回のステップS81〜S85の処理では、FAT領域の別のセクタにあるFAT情報データがコンパクトフラッシュ46からバッファ30にDMA転送され、バンク0に格納された新規のFAT情報データに基づいて空きクラスタの検索処理が行なわれる。
【0053】
空きクラスタが発見されたときは、ステップS89からステップS93に進み、発見された空きクラスタの先頭のセクタ番号およびアクセス態様“リード”をコンパクトフラッシュ46に設定する。さらに、SDRAM12に格納された画像ファイルをコンパクトフラッシュ46に転送するための処理要求を、ステップS95でレジスタ36に設定する。具体的には、SDRAM12の所望の先頭アドレス情報,バンク1を示すバンク情報および“512バイト”の転送サイズ情報をレジスタ36のSDRAM側リード制御回路の欄に設定し、かつコンパクトフラッシュ46の所望のセクタアドレス情報,バンク1を示すバンク情報および“512バイト”の転送サイズ情報をレジスタ36のCF側ライト制御回路の欄に設定する。
【0054】
これによって、SDRAM12の所望の先頭アドレス以降に格納された512バイトの画像データが、リード制御回路20によってバッファ30のバンク1にDMA転送され、さらに、バンク1に格納された512バイトの画像データが、ライト制御回路28によってコンパクトフラッシュ46にDMA転送される。転送された512バイトの画像データは、空きクラスタの先頭に位置するセクタに書き込まれる。なお、バンク1を画像データの書き込み先として選択するのは、バンク0に格納されたFAT情報データが消滅するのを防止するためである。
【0055】
ステップS97では、リード制御回路20およびライト制御回路28の両方から終了フラグが発行されたときに、ステップS97で要求したDMA処理が終了したと判断する。続くステップS99では、ステップS87で検索した空きクラスタが満杯になったかどうか判断し、NOであればステップS101でセクタ番号を更新してからステップS93に戻る。この結果、クラスタが満杯になるまで、ステップS93〜S99の処理が繰り返され、画像ファイルを形成する画像データは、空きクラスタ内の複数のセクタに連続して書き込まれる。
【0056】
ステップS99で空きクラスタが満杯になったと判断されると、現画像ファイルのDMA転送(コンパクトフラッシュ46への記録)が完了したかどうかをステップS103で判断する。ここでNOであれば、ステップS105でバッファ30内のバンク0にアクセスし、バンク0のFAT情報データを更新する。つまり、今回のDMA転送によって満杯となったクラスタに対応するFATエントリの情報を書き換える。続いて、ステップS107で再度バンク0にアクセスし、上述のステップS87と同じ要領で空きクラスタの検索を行なう。続くステップS109では空きクラスタが発見されたかどうか判断し、YESであれば、ステップS93に戻って上述と同様のDMA転送処理を行なう。
【0057】
一方、ステップS109でNOであれば、ステップS111でFAT領域内のセクタ番号およびアクセス態様“ライト”をコンパクトフラッシュ46に設定する。ここで、設定するセクタ番号は、バンク0に格納されているFAT情報データを書き込むべきセクタの番号である。続いて、ライト制御回路28にFAT情報データのDMA転送を行なうための処理要求を、ステップS113でレジスタ36に設定する。つまり、ステップS111で設定したセクタ番号に対応するセクタアドレス情報,バンク0を示すバンク情報および“512バイト”の転送サイズ情報を、図3に示すCF側ライト制御回路の欄に書き込む。これによって、バンク0に格納されたFATデータが、ライト制御回路28によってコンパクトフラッシュ46にDMA転送され、FAT領域内の元のセクタに書き込まれる。
【0058】
ステップS115では、ライト制御回路28によるDMA転送処理の終了の有無を、ライト制御回路28から終了フラグが発行されたかどうかによって判断する。終了フラグが発行されなければステップS115の処理を繰り返し、終了フラグが発行されると、ステップS117に進む。ステップS117では、FAT領域の別のセクタからFATデータを読み出すべくセクタ番号を更新し、その後ステップS81に戻る。
【0059】
ステップS103で現画像ファイルのDMA転送が完了したと判断されたときは、記録日時やファイルサイズなどのファイル情報をコンパクトフラッシュ46に書き込むべく、ステップS119に進む。ステップS119では、このようなファイル情報の書き込み先のセクタ番号およびアクセス態様“ライト”をコンパクトフラッシュ46に設定する。続くステップS121では、SDRAM12に格納されたファイル情報をコンパクトフラッシュ46に転送するための処理要求を、上述のステップS95と同じ要領でレジスタ36に設定する。つまり、SDRAM12の所望の先頭アドレス情報,バンク1を示すバンク情報および“512バイト”の転送サイズ情報をレジスタ36のSDRAM側リード制御回路の欄に設定するとともに、コンパクトフラッシュ46の所望のセクタアドレス情報,バンク1を示すバンク情報および“512バイト”の転送サイズ情報をレジスタ36のCF側ライト制御回路の欄に設定する。
【0060】
これによって、SDRAM12の所望の先頭アドレス以降に格納された512バイトのファイル情報データがリード制御回路20によってバッファ30のバンク1にDMA転送され、さらに、バンク1に格納された512バイトのファイル情報データがライト制御回路28によってコンパクトフラッシュ46にDMA転送される。転送された512バイトの画像データは、ステップS119で設定されたセクタ番号に対応するセクタに書き込まれる。
【0061】
ステップS123では、リード制御回路20およびライト制御回路28の両方から終了フラグが発行されたかどうかを判断し、YESとの判断結果が得られたときにステップ125に進む。ステップS125では、SDRAM12に格納された全ての画像ファイルの記録処理が完了したかどうか判断する。そして、YESであれば処理を終了するが、NOであればステップS117でセクタ番号を更新してからステップS81に戻る。
【0062】
なお、以上の処理はSDRAM12からコンパクトフラッシュ46に画像ファイルを転送するときの処理であり、コンパクトフラッシュ46からSDRAM12に画像ファイルを転送するときの処理については、説明を省略している。ただし、このコンパクトフラッシュ46からSDRAM12へのDMA転送処理も上述と同じ要領で行なわれる。このとき、FAT情報データはたとえばバンク0に格納され、画像データはたとえばバンク2を用いて転送される。
【0063】
図示しないシャッタボタンが押されたとき、CPU54は図7に示す割り込みルーチンを処理する。まず、ステップS131でSDRAM12に十分な空き容量が存在するかどうか判断し、YESとの判断結果が得られたときにステップS133で、カメラ処理を行なう。このとき、撮影されたRAWデータのSDRAM12に対するライト/リード処理、RAWデータをYUV変換することで生成されたYUVデータのSDRAM12に対するライト/リード処理,およびYUVデータをJPEG圧縮して生成された圧縮YUVデータのSDRAM12に対するライト処理が、DMAコントローラ58によって行なわれる。
【0064】
このようなカメラ処理が完了すると、ステップS135で撮影日時やファイルサイズを含むファイル情報データをSDRAM12に格納する。このとき、CPU54は、まずアクセス要求を制御バスCBCPU3を通してアクセス要求制御回路16に与える。これに対してアクセス要求制御回路16から承認信号ACKが返送されると、SDRAM12の所望の先頭アドレス情報,ファイル情報データのサイズ情報および“ライト”を示すアクセス態様情報を含むアクセス信号を、同じ制御バスCBCPU3を通してアクセス要求制御回路16に与え、同時にファイル情報データをデータバスDBCPU3およびDBCPU1を通してアクセス制御回路16に与える。ファイル情報データはSDRAM12の所望のアドレスに書き込まれ、これによって圧縮YUVデータおよびファイル情報データを含む画像ファイルがSDRAM12内に作成される。
【0065】
以上の説明から分かるように、SDRAM12は1回にアクセスするデータ量が多くなるほど実効スループットが向上するメモリであり、バッファ30は1アドレス毎にアクセスされるメモリであり、そしてコンパクトフラッシュ46は1セクタ毎にアクセスされるメモリである。SDRAM12とバッファ30との間では、ライト制御回路18およびリード制御回路20によって1セクタ(512バイト)毎のDMAデータ転送が行なわれ、バッファ30とコンパクトフラッシュ46との間では、リード制御回路26およびライト制御回路28によって1セクタ(512バイト)毎のDMAデータ転送が行なわれる。一方、CPU54は、バッファ30に対してプログラム制御方式でデータアクセスを行ない、このときのアクセスデータ量は1セクタよりも少ない。
【0066】
このように、CPU54が必要とするデータ量は1セクタよりも少ないため、SDRAM12にアクセスするよりも、バッファ30にアクセスした方が、アクセス処理が短時間で完了する。また、コンパクトフラッシュ46はセクタ単位でのアクセスしかできないため、バッファ30をCPU54のアクセス先とした方が、効率的なアクセスが可能となる。
【0067】
また、バッファ30は複数のバンク0〜2からなり、各バンクは512バイトの容量を持っている。ライト制御回路18およびリード制御回路20は、画像データのDMA転送にバンク1または2を用い、リード制御回路26およびライト制御回路28は、FAT情報データのDMA転送にバンク0を用いるとともに、画像データのDMA転送にバンク1または2を用いる。そして、CPU54は、FAT情報データの読み出し/書き込みのためにバンク0にアクセスする。このように、画像データの格納先とFAT情報データの格納先が互いに異なるため、画像データのDMA転送時にFAT情報データが消滅することはない。
【0068】
コンパクトフラッシュ46は、内部転送を実行していないときにレディ状態となり、内部転送を実行しているときにビジー状態となり、現時点の状態を示す状態信号が特定の入出力ポートから出力される。コンパクトフラッシュ46とバッファ30との間でのDMA転送を行なうとき、CPU54は、この状態信号が示す状態に関係なく、処理要求をレジスタ36に設定する。一方、リード制御回路26およびライト制御回路28は、状態信号が示すレディを示すときにコンパクトフラッシュ46ににアクセスする。従来技術では、CPUがコンパクトフラッシュの状態を監視し、コンパクトフラッシュがレディ状態に移行してからDMAコントローラに処理要求を与えていたため、時間的なロスが発生していた。この実施例では、上述の要領で処理が行なわれるため、従来技術のような時間のロスが生じることはない。
【0069】
また、SDRAM12からコンパクトフラッシュ46へのDMAデータ転送を行なう場合、ライト制御回路18は、4バイト(32ビット)分のデータをSDRAM12からバッファ30に転送する毎にカウンタ22を“4”ずつインクリメントし、リード制御回路26は、2バイト分のデータをバッファ30からコンパクトフラッシュ46に転送する毎にカウンタ22を“2”ずつディクリメントする。逆に、コンパクトフラッシュ46からSDRAM12へのDMAデータ転送を行なう場合は、ライト制御回路28が、2バイト分のデータをコンパクトフラッシュ46からバッファ30に転送する毎にカウンタ24を“2”ずつインクリメントし、リード制御回路20が、4バイト分のデータをバッファ30からSDRAM12に転送する毎にカウンタ24を“4”ずつディクリメントする。したがって、CPU54は、単に処理要求をレジスタ36に設定するだけで、適切なタイミングでDMAデータ転送が実行される。なお、ライト制御回路28およびリード制御回路20は同時に動作することはないため、アクセスが同時に実行されることはない。
【0070】
また、ライト制御回路18,リード制御回路20,DMAコントローラ58およびCPU54の各々は、専用のデータバスDBDMA1,DBDMA2,DBDMA5およびCBCPU1を通してSDRAM12へのデータアクセスを行なう。ここで、各々のデータアクセスが互いに衝突することがないよう、アクセス要求がアクセス要求制御回路16によって調停される。さらに、アクセス要求制御回路16は、複数のアクセス要求が与えられたとき、CPU54からのアクセス要求を優先的に受け付ける。これによって、それぞれのDMAコントローラがDMA処理を行なっているときでも、DMA処理の合間でプログラム制御によるアクセスを行なうことができる。DMA処理の合間で行なわれる処理としては、図11のステップS135におけるファイル情報データの書き込み処理がある。なお、このような処理は、リード制御回路26,ライト制御回路28およびCPU54の各々がコンパクトフラッシュ46にアクセスするときも行なわれる。
【0071】
なお、この実施例では、画像ファイルの記録媒体としてコンパクトフラッシュを用いているため、1セクタを512バイトとしているが、記録媒体としてスマートメディアを用いるときは、1セクタは528バイトである。このとき、バッファには、各々が528バイトの容量を持つバンクを設け、1回のDMA処理によって転送するデータ量は528バイトとする必要がある。
【0072】
また、この実施例では、バースト転送方式のメモリとしてSDRAMを用いているが、バースト転送は単なるDRAMでも行なわれる。このため、SDRAMの代わりにDRAMを用いてもよい。
【図面の簡単な説明】
【図1】この発明の一実施例の構成を示すブロック図である。
【図2】コンパクトフラッシュの構成を示すブロック図である。
【図3】レジスタの一例を示す図解図である。
【図4】バッファに形成された複数のバンクを示す図解図である。
【図5】SDRAM側リード制御回路の動作の一部を示すフロー図である。
【図6】CF側ライト制御回路の動作の一部を示すフロー図である。
【図7】CF側リード制御回路の動作の一部を示すフロー図である。
【図8】SDRAM側ライト制御回路の動作の一部を示すフロー図である。
【図9】CPUの動作の一部を示すフロー図である。
【図10】CPUの動作の他の一部を示すフロー図である。
【図11】CPUの動作のその他の一部を示すフロー図である。
【符号の説明】
10…ディジタルカメラ
12…SDRAM
16,34,40,42,48…アクセス要求制御回路
18,28…ライト制御回路
20,26…リード制御回路
30…バッファ
36…レジスタ
46…コンパクトフラッシュ
54…CPU
[0001]
[Industrial applications]
The present invention relates to a data processing device, for example, a data processing device which is applied to a digital camera and transfers data between a first memory and a second memory.
[0002]
[Prior art]
2. Description of the Related Art Conventionally, as a well-known data processing apparatus, there is an apparatus that accesses a memory by using both a DMA (Direct Memory Access) control method and a program control method. The DMA control method is used when a large amount of data is transferred between two memories, and the program control method is used when short data such as control information is exchanged between the memory and the CPU.
[0003]
[Problems to be solved by the invention]
However, in the related art, depending on the characteristics of the memory to be accessed, it takes time to access the program control system, and the overall processing speed may decrease. For example, when one memory is an SDRAM adopting a burst transfer method and the other memory is a compact flash based on access in units of a sector, there is a problem in reading data of less than one sector by a program control method. Occurs. In other words, in the burst transfer method, the larger the amount of data to be accessed collectively, the better the effective throughput is. However, conversely, when a small amount of data is accessed, the effective throughput decreases. On the other hand, the compact flash is not suitable for a memory for performing a small amount of data access since the access is basically performed for each sector as described above.
[0004]
In the prior art, the control bus is individually assigned to the DMA controller and the CPU, but the data bus is shared by the DMA controller and the CPU. Therefore, once the CPU releases the data bus, the data bus is occupied by the DMA controller, and the CPU cannot acquire the data bus unless the processing of the DMA controller is completed.
[0005]
As described above, in the related art, there is a problem that the processing speed is reduced in the characteristics of the memory to be accessed and the connection relation with the bus.
[0006]
Therefore, a main object of the present invention is to provide a data processing device capable of realizing high-speed data processing.
[0007]
[Means for Solving the Problems]
A first invention provides a first DMA controller for transferring a predetermined amount of DMA data between a first memory and a second memory, and a second DMA controller for transferring a predetermined amount of DMA data between a second memory and a third memory. And a CPU for performing program control data access to the second memory. The first memory is a memory whose effective throughput increases as the amount of data accessed at one time increases, and the second memory has a predetermined number of addresses. A third memory is a memory accessed every predetermined amount, and a data amount when the CPU accesses the second memory is smaller than the predetermined amount. .
[0008]
A second invention provides a DMA controller for performing a DMA control data access to a first memory through a first data bus, a CPU performing a program control data access to a first memory through a second data bus, and A data processing device including an arbitration circuit that arbitrates a first access request from a DMA controller to a first memory and a second access request from a CPU to a first memory.
[0009]
[Action]
In the first invention, the first DMA controller transfers a predetermined amount of DMA data between the first memory and the second memory, and the second DMA controller transfers a predetermined amount of DMA data between the second memory and the third memory. The transfer is performed, and the CPU accesses the second memory in the program control mode. Here, the first memory is a memory whose effective throughput increases as the amount of data accessed at one time increases, the second memory is a memory accessed every predetermined number of addresses, and the third memory is a memory accessed every predetermined number of addresses. The memory to be accessed. On the other hand, the data amount when the CPU accesses the second memory is smaller than the predetermined amount.
[0010]
Therefore, the time required for the CPU to access the second memory is shorter than the time required for the CPU to access the first memory. Further, since the access to the third memory is performed at predetermined intervals, the CPU can access the second memory efficiently by using the second memory as an access destination.
[0011]
In a preferred embodiment of the present invention, the second memory includes a plurality of banks each having a capacity corresponding to at least a predetermined amount. Here, the CPU accesses only a specific bank of the second memory, the first DMA controller accesses only a bank other than the specific bank of the second memory, and the second DMA controller accesses any of the plurality of banks. to access.
[0012]
More preferably, the third memory stores desired data and management data for managing the desired data, the second DMA controller transfers DMA data between a specific bank and the third memory for the management data, and Access to the management data stored in the bank. This can prevent the management data from being overwritten by the desired data.
[0013]
In another preferred embodiment of the invention, the third memory generates a status signal indicating whether access is possible. Here, the CPU requests DMA data transfer to the second DMA controller regardless of the state indicated by the state signal, and the second DMA controller accesses the third memory according to the state indicated by the state signal. As a result, the second DMA controller can immediately start the DMA data transfer when the third memory becomes accessible, thereby speeding up the data transfer process.
[0014]
More preferably, there is further provided a counter that is incremented in response to DMA data transfer by one of the first DMA controller and the second DMA controller and decremented in response to DMA data transfer by the other of the first DMA controller and the second DMA controller. Here, the CPU requests the first DMA controller and the second DMA controller to transfer the DMA data regardless of the value of the counter, and the first DMA controller and the second DMA controller start the DMA data transfer according to the value of the counter. As a result, the DMA data transfer is executed at an appropriate timing simply by the CPU issuing a processing request.
[0015]
In the second invention, the DMA controller accesses the first memory through the first data bus in the DMA control mode, and the CPU accesses the first memory through the second data bus in the program control mode. Perform The first access request from the DMA controller to the first memory and the second access request from the CPU to the first memory are arbitrated by the arbitration circuit. Therefore, when performing data access of the program control method during data access of the DMA control method, there is no need to switch the bus occupancy.
[0016]
In a preferred example of the present invention, the arbitration circuit preferentially receives the second access request from the CPU. Therefore, when the first access request and the second access request occur at the same time, the CPU preferentially accesses the first memory.
[0017]
【The invention's effect】
According to the first aspect, the time required for the CPU to access the second memory is shorter than the time required for the CPU to access the first memory, so that the overall processing can be speeded up. Further, since the access to the third memory is performed at predetermined intervals, the CPU can efficiently access necessary data.
[0018]
According to the second aspect, it is not necessary to switch the bus occupancy when it is desired to perform the program control data access during the DMA control data access, so that the processing can be speeded up.
[0019]
The above and other objects, features and advantages of the present invention will become more apparent from the following detailed description of embodiments with reference to the drawings.
[0020]
【Example】
Referring to FIG. 1, digital camera 10 of this embodiment includes SDRAM 12, compact flash (CF) 46, register 36, buffer 30, and flash memory 52 as memories for storing data. The SDRAM 12 is an internal memory for temporarily recording an image file including photographed image data, and the compact flash 46 is a removable recording medium for recording such an image file. The register 36 is an internal memory for storing a processing request for DMA data transfer described later. The buffer 30 stores image data DMA-transferred between the SDRAM 12 and the compact flash 46, or FAT information data of the compact flash 46. Is an internal memory for temporarily storing. The flash memory 52 is an internal memory that stores a program of the CPU 54.
[0021]
Access to the SDRAM 12 is controlled by the access control circuit 14 and the access request control circuit 16, and access to the compact flash 46 is controlled by the access control circuit 42 and the access request control circuit 44. Access to the register 36 is controlled by the access control circuit 38 and the access request control circuit 40, and access to the buffers 30a to 30c is controlled by the access control circuit 32 and the access request control circuit 34. Further, access to the flash memory 52 is controlled by the access control circuit 50 and the access request control circuit 48.
[0022]
Each access request control circuit returns an acknowledgment signal ACK to the request source when the access request is given, and the request source supplies the access signal to the access request control circuit in response to the acknowledgment signal. Further, when the access mode is write, the request source supplies the access request control circuit with write-related data together with the access signal. The access signal (and data) is provided to the access control circuit through the access request control circuit, and the access control circuit accesses the memory according to the input access signal.
[0023]
An access request is issued to the access request control circuits 34, 40 and 48 only from the CPU 54. On the other hand, the access request control circuit 16 receives an access request from the write control circuit 18, the read control circuit 20, and the DMA controller 58 of the camera processing system in addition to the CPU 54. The access request control circuit 42 is also provided with an access request from the read control circuit 26 and the write control circuit 28 in addition to the CPU 54. That is, there is a possibility that a plurality of access requests may be simultaneously input to the access request control circuits 16 and 42, and the access request control circuits 16 and 42 arbitrate each of the simultaneously input access requests, and An acknowledgment signal ACK is returned to the request source. However, the access request control circuits 16 and 42 give priority to the CPU 54, and when a plurality of access requests are given, the access request from the CPU 54 is accepted with the highest priority.
[0024]
Note that the camera processing includes a YUV conversion processing for converting captured raw image data (RAW data) into YUV data, and a compression processing for compressing YUV data to generate compressed YUV data (the above-described image data). , RAW data, YUV data, and compressed YUV data, write / read processing is performed on the SDRAM 12 by the corresponding DMA controller. The above-described DMA controller 58 is a concept including a plurality of DMA controllers that perform such camera processing. Here, the DMA controller 58 controls the control bus CB. DMA 4 and 32 bit data bus DB DMA 5, the access request control circuit 16 is accessed.
[0025]
The SDRAM 12 is a memory of a burst transfer system. If a head address is specified, the SDRAM 12 can continuously access a plurality of addresses subsequent thereto. That is, at the time of reading, data stored at a plurality of continuous addresses can be read at one time, and at the time of writing, data of a plurality of addresses can be written to a plurality of continuous addresses at one time. Although random access is possible with the SDRAM 12, the address is divided into a row (ROW) and a column (COLUMN), and there is an overhead of setting a row address first, so that the efficiency of access for each word deteriorates. . For this reason, in the burst transfer method, the larger the amount of data per access, the higher the effective throughput. When a burst access is performed, the access signal provided to the access request control circuit 16 includes the start address information of the access destination, data size information, and access mode information indicating read / write.
[0026]
As shown in FIG. 2, the compact flash 46 includes a controller 46a, a buffer memory 46b, and a main memory 46c. The controller 46a accesses the main memory 46c via the buffer memory 46b. The buffer memory 46b has a capacity of one sector (512 bytes), and access is performed for each sector. Therefore, the access signal provided to access request control circuit 42 includes desired sector address information and access mode information indicating read / write. When the internal transfer is being performed, the compact flash 46 is in a busy state, and when the internal transfer is not being performed, the compact flash 46 is in a ready state. Such a ready state / busy state determination signal is output from a specific input / output port of the compact flash 46.
[0027]
In order to access the main memory 46c, it is necessary to set a desired sector number and an access mode in the controller 46a prior to the above-mentioned access signal.
[0028]
The register 36 is formed as shown in FIG. The SDRAM side write control circuit (write control circuit 18), the SDRAM side read control circuit (read control circuit 20), the CF side write control circuit (write control circuit 28) and the CF side read control circuit (read control circuit 26) are so-called DMA controller. The processing request includes address information, bank information, and transfer size information, and a column for storing these information is formed in the register 36 corresponding to each DMA controller. When the processing request is set in the register 36, the access request control circuit 40 stores an access signal including the address information of the write destination (position information of the writing column) and the access mode information “write” and each information data forming the processing request. Is given. The address information, bank information, and transfer size information included in the processing request are written in desired columns based on the access signal.
[0029]
As the buffer 30, as shown in FIG. 4, an SRAM having three banks 0 to 2 is applied, and each bank has a capacity of 512 bytes. Access to each bank is performed for each address. Therefore, the access signal to the buffer 30 includes access destination bank information, address information, and access mode information indicating read / write.
[0030]
Like the buffer 30, the access to the flash memory 52 is performed by an access signal including address information of an access destination and access mode information indicating read / write.
[0031]
The main connection relationship between each circuit and the memory will be described below. The access request control circuit 16 controls the control bus CB DMA 1 is connected to the write control circuit 18 and the read control circuit 20, and the control bus CB CPU 1 is connected to the CPU 54 and the access request control circuits 34, 40, 42 and 48. The access request control circuit 16 also has a data bus DB DMA 1 is connected to the write control circuit 18 and the data bus DB DMA 2 to the read control circuit 20 and the data bus DB CPU 1 and DB CPU 2 are connected to the access request control circuits 34, 40, 42 and 48. Data bus DB CPU 1 and DB CPU 2 is a data bus DB to which the CPU 54 is connected. CPU 3 via a bidirectional buffer 56. The access request control circuit 42 includes a control bus CB DMA 3 is connected to the read control circuit 26 and the write control circuit 28, and the data bus DB DMA 3 and DB DMA 4 is connected to each of the read control circuit 26 and the write control circuit 28.
[0032]
Read control circuits 20 and 26 are connected to control bus CB COM 1 and data bus DB COM 1 is connected to the input side of the buffer 30, and the write control circuits 18 and 28 COM 2 and data bus DB COM 2 is connected to the output side of the buffer 30. Both the read control circuits 20 and 26 and the write control circuits 18 and 28 DMA 2 is connected to the register 36. Control bus CB COM 1 and CB COM 2 and data bus DB COM 1 and DB COM 2 is also connected to the access control circuit 32.
[0033]
That is, the data bus DB DMA 1, DB DMA 2, DB DMA 3 and DB DMA 4 are data buses dedicated to the write control circuit 18, the read control circuit 20, the write control circuit 28, and the read control circuit 26, respectively. CPU 1 to DB CPU 3 is a data bus dedicated to the CPU 54. On the other hand, the data bus DB COM 1 and DB COM 2 is shared by the write control circuits 18 and 28, the read control circuits 20 and 26, and the CPU 54. The data bus DB DMA 1 and DB DMA 2 is a 32-bit bus and a data bus DB DMA 3 and DB DMA 4 is a 16-bit bus.
[0034]
The read control circuit 20 operates according to the flowchart shown in FIG. 5 when a processing request is set in the column of the SDRAM side read control circuit of the register 36.
[0035]
When the desired start address information of the SDRAM 12, the bank information indicating any one of the banks 0 to 2 and the transfer size information of "512 bytes" are set in the column of the SDRAM side read control circuit of the register 36, first, at step S1 It is determined whether or not the value of the internal counter 20a is "0". If the count value is "1" or more, the process of step S1 is repeated. When the count value becomes "0", the process proceeds to step S3 on the assumption that the access destination bank is empty. In step S3, the access request is sent to the control bus CB. DMA 1 to the access request control circuit 16. On the other hand, when the acknowledgment signal ACK is returned, YES is determined in step S5, and in step S7, the access signal (start address information, access mode information indicating read, size information of 512 bytes) is transmitted to the same control bus CB. DMA 1 to the access request control circuit 16. The 512-byte data written after the desired head address is read out by the access control circuit 12 and the data bus DB DMA 2 to the read control circuit 20.
[0036]
In step S9, the 4-byte (32-bit) data input from the access request control circuit 16 is transferred to the data bus DB. COM 1 to the buffer 30 and an address signal of the designated bank is supplied to the control bus CB. DMA 2 to the buffer 30. Subsequently, the shared counter 24 and the internal counter 20a are incremented by "4" in step S11, and the value of the counter 20a is compared with "512" in step S11. If the count value is less than "512", the processing of steps S9 and S11 is repeated. As a result, the input 512-byte data is sequentially written to the desired bank from the head address, and the count values of the shared counter 24 and the internal counter 20a are incremented to “512”. When the count value reaches "512", an end flag is issued in step S15. The end flag is provided to the CPU 54 through an interrupt terminal (not shown).
[0037]
When a processing request is set in the column of the CF-side write control circuit of the register 36, the write control circuit 28 operates according to the flowchart shown in FIG.
[0038]
When the desired sector address information of the compact flash 46, the bank information indicating the desired bank, and the transfer size information of "512 bytes" are set in the column of the CF side write control circuit of the register 36, first, at step S21, the compact flash 46 is set. Is determined based on the status signal. If the state is busy, the process of step S21 is repeated, and when the state shifts to the ready state, the process proceeds to step S23. In step S23, it is determined whether or not the value of the shared counter 24 indicates "2" or more, and if NO, the same processing is repeated. When the count value becomes “2” or more, it is considered that transferable data has been stored in a desired bank, and an access request is generated in step S25. The access request is sent to the control bus CB DMA 3 to the access request control circuit 42.
[0039]
When an acknowledgment signal ACK is returned from the access request control circuit 42 in response to this access request, an access signal (sector address information, write access mode information, 512-byte data size information) is generated in step S29, and step S31 is performed. To supply a buffer 30 with an address signal of a desired bank. The access signal is the control bus CB DMA 3 to the access request control circuit 42, and the address signal is supplied to the control bus CB COM 2 to the buffer 30. As a result, 2 bytes (16 bits) of data stored at a desired address of a desired bank are transferred to the data bus DB. COM 2 is read through the data bus DB. DMA 3 to the access request control circuit 42. In step S33, the value of the shared counter 24 is decremented by "2" and the value of the internal counter 28a is incremented by "2". In step S35, the value of the internal counter 28a is compared with "512". If the count value is less than "512", the processes of steps S23 to S33 are repeated. If the count value is "512", an end flag is issued in step S37.
[0040]
By repeating the processing of steps S23 to S35, the data of 512 bytes read from the buffer 30 is stored in the data bus DB. DMA 3. The data is supplied to the compact flash 46 via the access request control circuit 42 and the access control circuit 44. The controller 46a temporarily stores the given 512-byte data in the buffer memory 46b, and writes the 512-byte data to a desired sector of the main memory 46c when the buffer memory 46b becomes full.
[0041]
When a processing request is set in the column of the CF-side read control circuit of the register 36, the read control circuit 26 operates according to the flowchart shown in FIG.
[0042]
When the desired sector address information of the compact flash 46, the bank information indicating the desired bank, and the transfer size information of "512 bytes" are set in the column of the CF side read control circuit of the register 36, the compact flash 46 of the compact flash 46 is set in step S41. The state is determined, and if the state is the ready state, the value of the shared counter 22 is determined in step S43. If the value of the shared counter 22 is "0", it is determined that the desired bank is empty, and the access request is sent to the control bus CB in step S45. DMA 3 to the access request control circuit 42. On the other hand, when the acknowledge signal ACK is returned from the access request control circuit 42, the access signals (sector address information and read access mode information) are transmitted to the same control bus CB in step S49. DMA 3 to the access request control circuit 42. Two bytes of data are read from the compact flash 46, and the read data is stored in a data bus DB. DMA 4 to the read control circuit 26.
[0043]
In step S51, the read 2-byte data is supplied to the buffer 30 together with the address signal. At this time, data is transferred to the data bus DB. COM 1, the address signal is CB COM 1 to the buffer 30. In step S53, the shared counter 22 is incremented by "2", and in the following step S55, the count value is compared with "512". Then, as long as the count value is less than "512", the processing of steps S45 to S53 is repeated, whereby data is read from the desired sector of the compact flash 46 two bytes at a time, and a total of 512 bytes of data is Is stored in the bank. When the count value becomes "512", YES is determined in the step S55, and an end flag is issued in a step S57.
[0044]
The write control circuit 18 operates according to the flowchart shown in FIG. 8 when a processing request is set in the column of the SDRAM write control circuit of the register 36.
[0045]
When the start address information of the SDRAM 12, the bank information indicating any one of banks 0 to 2 and the transfer size information of "512 bytes" are set in the column of the SDRAM write control circuit of the register 36, the shared counter is set in step S61. 22 is compared with “512”, and if the comparison result indicates a match, an access request is sent to the control bus CB in step S63. DMA 1 to the access request control circuit 16. On the other hand, when the acknowledgment signal ACK is returned, YES is determined in step S65, and in step S67, the access signal (start address information, access mode information indicating read, size information of 512 bytes) is transmitted to the same control bus CB. DMA 1 to the access request control circuit 16.
[0046]
In step S69, the address signal is transmitted to the control bus CB. COM 2 to the buffer 30 to read 4 bytes of data from the desired bank. The read data is stored in the data bus DB. COM 2 and data bus DB DMA 1 to the access request control circuit 16. Subsequently, the value of the shared counter 22 is decremented by "4" in step S71, and the count value is compared with "0" in step S73. If the count value is "1" or more, the processes of steps S69 and S71 are repeated. If the count value becomes "0", an end flag is issued in step S75. As a result, 512-byte data is read from a desired bank, written to a desired address of the SDRAM 12 by the access control circuit 14, and an end flag is issued when the writing is completed.
[0047]
The image file is stored in the SDRAM 12 as described above, and the data to be DMA-transferred by the read control circuit 20 and the write control circuit 28 is the image data forming this image file. On the other hand, in the main memory 46a of the compact flash 46, FAT information data is recorded in addition to the same image file. That is, since the compact flash 46 employs the MS-DOS system, file management information such as FAT is also recorded in the main memory 46a. For this reason, data to be subjected to DMA transfer by the read control circuit 26 and the write control circuit 18 include FAT data in addition to image data for forming an image file.
[0048]
However, the FAT information data is read out by the CPU 54 for searching for a free cluster, and is not DMA-transferred from the buffer 30 to the SDRAM 12. Therefore, the read control circuit 26 DMA-transfers both FAT data and image data from the compact flash 46 to the buffer 30, while the write control circuit 18 DMA-transfers only image data from the buffer 30 to the SDRAM 12.
[0049]
The FAT data stored in the buffer 30 is read by the CPU 54. That is, the CPU 54 controls the control bus CB CPU 1 to the access request control circuit 40, and in response to the acknowledgment signal ACK, an access signal including bank information, address information and access mode information is transmitted to the same control bus CB. CPU 1 to the access request control circuit 34. The FAT information data written to a desired address of a desired bank is read by the access control circuit 32. The read FAT information data is stored in the data bus DB. CPU 1 and DB CPU 3 to the CPU 54. The FAT information data and the image data are stored in separate banks so that the FAT information data stored in the buffer 30 is not overwritten by the subsequent image data.
[0050]
When recording the image file stored in the SDRAM 12 on the compact flash 46, the CPU 54 processes the flowcharts shown in FIGS.
[0051]
First, in step S81, one of the sector numbers in the FAT area and the access mode “read” are set in the controller 46a of the compact flash 46 through a specific input / output port. Next, a processing request for causing the read control circuit 26 to perform the DMA transfer of the FAT information data is set in the register 36 in step S83. That is, the sector address information corresponding to the sector number set in step S1, the bank information indicating bank 0, and the transfer size information of "512 bytes" are written in the column of the CF-side read control circuit shown in FIG. As a result, a part of the FAT information data written in the FAT area is DMA-transferred from the compact flash 46 to the bank 0 of the buffer 30. In step S85, the presence or absence of the end of the DMA transfer processing is determined in response to the end flag. That is, the process of step S85 is repeated unless an end flag is input from the read control circuit 26. When the end flag is given, the process proceeds to step S87.
[0052]
In step S87, bank 0 of buffer 30 is accessed through access request control circuit 34 and access request circuit 32, and a free cluster is searched based on FAT data in bank 0. Specifically, the FAT entry is read from bank 0, and it is determined whether the corresponding cluster is empty. When the search of all the FAT entries is completed, it is determined in a step S89 whether or not an empty cluster has been searched. If no empty cluster is found, the process returns to step S81 after updating the sector number in step S91. In the next processing of steps S81 to S85, FAT information data in another sector of the FAT area is DMA-transferred from the compact flash 46 to the buffer 30, and based on the new FAT information data stored in the bank 0, an empty cluster Search processing is performed.
[0053]
When an empty cluster is found, the process proceeds from step S89 to step S93, and the head sector number and access mode “read” of the found empty cluster are set in the compact flash 46. Further, a processing request for transferring the image file stored in the SDRAM 12 to the compact flash 46 is set in the register 36 in step S95. Specifically, the desired start address information of the SDRAM 12, the bank information indicating the bank 1 and the transfer size information of "512 bytes" are set in the column of the SDRAM side read control circuit of the register 36, and the desired The sector address information, the bank information indicating the bank 1 and the transfer size information of “512 bytes” are set in the column of the CF side write control circuit of the register 36.
[0054]
As a result, the 512-byte image data stored after the desired start address of the SDRAM 12 is DMA-transferred to the bank 1 of the buffer 30 by the read control circuit 20, and the 512-byte image data stored in the bank 1 is further transferred to the bank 1. , DMA transfer to the compact flash 46 by the write control circuit 28. The transferred 512-byte image data is written to the sector located at the head of the free cluster. The reason why the bank 1 is selected as the image data writing destination is to prevent the FAT information data stored in the bank 0 from disappearing.
[0055]
In step S97, when an end flag is issued from both the read control circuit 20 and the write control circuit 28, it is determined that the DMA processing requested in step S97 has been completed. In a succeeding step S99, it is determined whether or not the empty cluster searched in the step S87 is full. If NO, the sector number is updated in a step S101, and the process returns to the step S93. As a result, the processes of steps S93 to S99 are repeated until the cluster is full, and the image data forming the image file is continuously written to a plurality of sectors in the empty cluster.
[0056]
If it is determined in step S99 that the free cluster is full, it is determined in step S103 whether the DMA transfer of the current image file (recording on the compact flash 46) has been completed. If "NO" here, the bank 0 in the buffer 30 is accessed in step S105, and the FAT information data of the bank 0 is updated. That is, the information of the FAT entry corresponding to the cluster that has become full by the current DMA transfer is rewritten. Subsequently, the bank 0 is accessed again in step S107, and a search for a free cluster is performed in the same manner as in step S87 described above. In a succeeding step S109, it is determined whether or not an empty cluster is found, and if YES, the process returns to the step S93 to perform the same DMA transfer processing as described above.
[0057]
On the other hand, if “NO” in the step S109, the sector number in the FAT area and the access mode “write” are set in the compact flash 46 in a step S111. Here, the set sector number is the number of the sector to which the FAT information data stored in bank 0 is to be written. Subsequently, a processing request for performing DMA transfer of the FAT information data to the write control circuit 28 is set in the register 36 in step S113. That is, the sector address information corresponding to the sector number set in step S111, the bank information indicating bank 0, and the transfer size information of "512 bytes" are written in the column of the CF side write control circuit shown in FIG. As a result, the FAT data stored in the bank 0 is DMA-transferred to the compact flash 46 by the write control circuit 28, and written in the original sector in the FAT area.
[0058]
In step S115, it is determined whether or not the DMA transfer process by the write control circuit 28 has ended based on whether or not an end flag has been issued from the write control circuit 28. If the end flag has not been issued, the process of step S115 is repeated, and if the end flag has been issued, the process proceeds to step S117. In step S117, the sector number is updated to read FAT data from another sector in the FAT area, and thereafter, the flow returns to step S81.
[0059]
If it is determined in step S103 that the DMA transfer of the current image file has been completed, the process proceeds to step S119 to write file information such as the recording date and time and the file size to the compact flash 46. In step S119, the sector number of the write destination of such file information and the access mode “write” are set in the compact flash 46. In a succeeding step S121, a processing request for transferring the file information stored in the SDRAM 12 to the compact flash 46 is set in the register 36 in the same manner as in the above-described step S95. That is, the desired start address information of the SDRAM 12, the bank information indicating the bank 1 and the transfer size information of "512 bytes" are set in the column of the SDRAM side read control circuit of the register 36, and the desired sector address information of the compact flash 46 is set. , The bank information indicating the bank 1 and the transfer size information of “512 bytes” are set in the column of the CF-side write control circuit of the register 36.
[0060]
As a result, the 512-byte file information data stored after the desired start address of the SDRAM 12 is DMA-transferred to the bank 1 of the buffer 30 by the read control circuit 20, and the 512-byte file information data stored in the bank 1 is further transferred. Is DMA-transferred to the compact flash 46 by the write control circuit 28. The transferred 512-byte image data is written to the sector corresponding to the sector number set in step S119.
[0061]
In step S123, it is determined whether or not an end flag has been issued from both the read control circuit 20 and the write control circuit 28. When a determination result of YES is obtained, the process proceeds to step 125. In the step S125, it is determined whether or not the recording processing of all the image files stored in the SDRAM 12 has been completed. If YES, the process ends. If NO, the sector number is updated in step S117, and the process returns to step S81.
[0062]
The above processing is for transferring an image file from the SDRAM 12 to the compact flash 46, and the description of the processing for transferring the image file from the compact flash 46 to the SDRAM 12 is omitted. However, the DMA transfer process from the compact flash 46 to the SDRAM 12 is performed in the same manner as described above. At this time, the FAT information data is stored in, for example, bank 0, and the image data is transferred using, for example, bank 2.
[0063]
When a shutter button (not shown) is pressed, the CPU 54 processes an interrupt routine shown in FIG. First, it is determined whether or not there is sufficient free space in the SDRAM 12 in step S131, and when a determination result of YES is obtained, camera processing is performed in step S133. At this time, write / read processing of the captured RAW data on the SDRAM 12, write / read processing of the YUV data generated by performing YUV conversion of the RAW data on the SDRAM 12, and compressed YUV generated by JPEG-compressing the YUV data Write processing of data to the SDRAM 12 is performed by the DMA controller 58.
[0064]
When such camera processing is completed, file information data including the shooting date and time and the file size are stored in the SDRAM 12 in step S135. At this time, the CPU 54 first sends the access request to the control bus CB. CPU 3 to the access request control circuit 16. On the other hand, when the acknowledgment signal ACK is returned from the access request control circuit 16, the access signal including the desired start address information of the SDRAM 12, the size information of the file information data, and the access mode information indicating "write" is controlled by the same control. Bus CB CPU 3 to the access request control circuit 16 and simultaneously transmit the file information data to the data bus DB. CPU 3 and DB CPU 1 to the access control circuit 16. The file information data is written to a desired address of the SDRAM 12, whereby an image file including the compressed YUV data and the file information data is created in the SDRAM 12.
[0065]
As can be seen from the above description, the SDRAM 12 is a memory in which the effective throughput increases as the amount of data accessed at one time increases, the buffer 30 is a memory accessed for each address, and the compact flash 46 is a memory for one sector. It is a memory accessed every time. Between the SDRAM 12 and the buffer 30, DMA data transfer for each sector (512 bytes) is performed by the write control circuit 18 and the read control circuit 20, and between the buffer 30 and the compact flash 46, the read control circuit 26 and the The write control circuit 28 performs DMA data transfer for each sector (512 bytes). On the other hand, the CPU 54 performs data access to the buffer 30 by the program control method, and the access data amount at this time is smaller than one sector.
[0066]
As described above, since the data amount required by the CPU 54 is smaller than one sector, the access processing is completed in a shorter time by accessing the buffer 30 than by accessing the SDRAM 12. In addition, since the compact flash 46 can be accessed only in units of sectors, the buffer 30 can be accessed more efficiently if the CPU 54 is used as an access destination.
[0067]
The buffer 30 includes a plurality of banks 0 to 2, each of which has a capacity of 512 bytes. The write control circuit 18 and the read control circuit 20 use the bank 1 or 2 for the DMA transfer of the image data. The read control circuit 26 and the write control circuit 28 use the bank 0 for the DMA transfer of the FAT information data. Bank 1 or 2 is used for DMA transfer. Then, the CPU 54 accesses the bank 0 for reading / writing the FAT information data. As described above, since the storage location of the image data and the storage location of the FAT information data are different from each other, the FAT information data does not disappear during the DMA transfer of the image data.
[0068]
The compact flash 46 is in a ready state when the internal transfer is not being executed, is in a busy state when the internal transfer is being executed, and a state signal indicating the current state is output from a specific input / output port. When performing a DMA transfer between the compact flash 46 and the buffer 30, the CPU 54 sets a processing request in the register 36 regardless of the state indicated by this state signal. On the other hand, the read control circuit 26 and the write control circuit 28 access the compact flash 46 when the status signal indicates ready. In the prior art, the CPU monitors the state of the compact flash and gives a processing request to the DMA controller after the compact flash shifts to the ready state, so that a time loss occurs. In this embodiment, since the processing is performed in the above-described manner, no time loss occurs as in the related art.
[0069]
When performing DMA data transfer from the SDRAM 12 to the compact flash 46, the write control circuit 18 increments the counter 22 by "4" each time 4 bytes (32 bits) of data are transferred from the SDRAM 12 to the buffer 30. The read control circuit 26 decrements the counter 22 by "2" each time 2 bytes of data are transferred from the buffer 30 to the compact flash 46. Conversely, when performing DMA data transfer from the compact flash 46 to the SDRAM 12, the write control circuit 28 increments the counter 24 by "2" every time two bytes of data are transferred from the compact flash 46 to the buffer 30. Each time the read control circuit 20 transfers 4 bytes of data from the buffer 30 to the SDRAM 12, the counter 24 is decremented by "4". Therefore, the CPU 54 executes DMA data transfer at an appropriate timing simply by setting a processing request in the register 36. Since the write control circuit 28 and the read control circuit 20 do not operate at the same time, access is not performed at the same time.
[0070]
Each of the write control circuit 18, the read control circuit 20, the DMA controller 58, and the CPU 54 has a dedicated data bus DB. DMA 1, DB DMA 2, DB DMA 5 and CB CPU 1 to access data to the SDRAM 12. Here, the access request is arbitrated by the access request control circuit 16 so that the data accesses do not conflict with each other. Further, when a plurality of access requests are given, the access request control circuit 16 receives an access request from the CPU 54 with priority. Thus, even when each of the DMA controllers is performing the DMA processing, the access under the program control can be performed between the DMA processings. As a process performed between the DMA processes, there is a process of writing file information data in step S135 of FIG. Such processing is also performed when each of the read control circuit 26, the write control circuit 28, and the CPU 54 accesses the compact flash 46.
[0071]
In this embodiment, since a compact flash is used as a recording medium for an image file, one sector has 512 bytes. However, when a smart medium is used as a recording medium, one sector has 528 bytes. At this time, the buffer needs to be provided with banks each having a capacity of 528 bytes, and the amount of data transferred by one DMA process needs to be 528 bytes.
[0072]
Further, in this embodiment, the SDRAM is used as the memory of the burst transfer method, but the burst transfer can also be performed by a simple DRAM. Therefore, a DRAM may be used instead of the SDRAM.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of an embodiment of the present invention.
FIG. 2 is a block diagram showing a configuration of a compact flash.
FIG. 3 is an illustrative view showing one example of a register;
FIG. 4 is an illustrative view showing a plurality of banks formed in a buffer;
FIG. 5 is a flowchart showing a part of the operation of the SDRAM side read control circuit;
FIG. 6 is a flowchart showing a part of the operation of the CF-side write control circuit;
FIG. 7 is a flowchart showing a part of the operation of the CF-side read control circuit.
FIG. 8 is a flowchart showing a part of the operation of the SDRAM side write control circuit;
FIG. 9 is a flowchart showing a part of the operation of the CPU;
FIG. 10 is a flowchart showing another portion of the operation of the CPU;
FIG. 11 is a flowchart showing another portion of the operation of the CPU;
[Explanation of symbols]
10. Digital camera
12 ... SDRAM
16, 34, 40, 42, 48 ... access request control circuit
18, 28: Write control circuit
20, 26 ... read control circuit
30 ... buffer
36 ... Register
46… Compact flash
54 ... CPU

Claims (7)

第1メモリと第2メモリとの間で所定量のDMAデータ転送を行なう第1DMAコントローラ、
前記第2メモリと第3メモリとの間で前記所定量のDMAデータ転送行なう第2DMAコントローラ、および
前記第2メモリに対してプログラム制御方式のデータアクセスを行なうCPUを備え、
前記第1メモリは1回にアクセスするデータ量が多くなるほど実効スループットが向上するメモリであり、
前記第2メモリは所定アドレス数毎にアクセスされるメモリであり、
前記第3メモリは前記所定量毎にアクセスされるメモリであり、そして
前記CPUが前記第2メモリにアクセスするときのデータ量は前記所定量よりも少ない、データ処理装置。
A first DMA controller for performing a predetermined amount of DMA data transfer between the first memory and the second memory;
A second DMA controller that transfers the predetermined amount of DMA data between the second memory and the third memory; and a CPU that performs program control data access to the second memory.
The first memory is a memory whose effective throughput increases as the amount of data accessed at one time increases,
The second memory is a memory accessed every predetermined number of addresses,
The data processing device, wherein the third memory is a memory accessed every predetermined amount, and a data amount when the CPU accesses the second memory is smaller than the predetermined amount.
前記第2メモリは各々が少なくとも前記所定量に相当する容量を持つ複数のバンクを含み、
前記CPUは前記第2メモリの特定のバンクにのみアクセスし、
前記第1DMAコントローラは前記第2メモリの前記特定のバンク以外のバンクにのみアクセスし、
前記第2DMAコントローラは前記複数のバンクのいずれにもアクセスする、請求項1記載のデータ処理装置。
The second memory includes a plurality of banks each having a capacity corresponding to at least the predetermined amount;
The CPU accesses only a specific bank of the second memory,
The first DMA controller accesses only a bank other than the specific bank of the second memory;
The data processing device according to claim 1, wherein the second DMA controller accesses any of the plurality of banks.
前記第3メモリは所望データおよび前記所望データを管理する管理データを格納し、
前記第2DMAコントローラは前記管理データについて前記特定のバンクと前記第3メモリとの間で前記DMAデータ転送を行ない、
前記CPUは前記特定のバンクに格納された前記管理データにアクセスする、請求項2記載のデータ処理装置。
The third memory stores desired data and management data for managing the desired data,
The second DMA controller performs the DMA data transfer of the management data between the specific bank and the third memory;
3. The data processing device according to claim 2, wherein the CPU accesses the management data stored in the specific bank.
前記第3メモリはアクセスが可能であるかどうかを示す状態信号を発生し、
前記CPUは前記状態信号が示す状態に関係なく前記第2DMAコントローラに対して前記DMAデータ転送を要求し、
前記第2DMAコントローラは前記状態信号が示す状態に応じて前記第3メモリにアクセスする、請求項1ないし3のいずれかに記載のデータ転送装置。
The third memory generates a status signal indicating whether access is possible;
The CPU requests the DMA data transfer to the second DMA controller regardless of a state indicated by the state signal;
4. The data transfer device according to claim 1, wherein the second DMA controller accesses the third memory according to a state indicated by the state signal.
前記第1DMAコントローラおよび前記第2DMAコントローラの一方による前記DMAデータ転送に応じてインクリメントされ前記第1DMAコントローラおよび前記第2DMAコントローラの他方による前記DMAデータ転送に応じてディクリメントされるカウンタをさらに備え、
前記CPUは前記カウンタの値に関係なく前記第1DMAコントローラおよび前記第2DMAコントローラに前記DMAデータ転送を要求し、
前記第1DMAコントローラおよび前記第2DMAコントローラは前記カウンタの値に応じて前記DMAデータ転送を行なう、請求項1ないし4のいずれかに記載のデータ処理装置。
A counter that is incremented in response to the DMA data transfer by one of the first DMA controller and the second DMA controller and decremented in response to the DMA data transfer by the other of the first DMA controller and the second DMA controller;
The CPU requests the first DMA controller and the second DMA controller for the DMA data transfer regardless of the value of the counter;
5. The data processing device according to claim 1, wherein said first DMA controller and said second DMA controller perform said DMA data transfer according to a value of said counter.
第1メモリに対して第1データバスを通してDMA制御方式のデータアクセスを行なうDMAコントローラ、
前記第1メモリに対して第2データバスを通してプログラム制御方式のデータアクセスを行なうCPU、および
前記DMAコントローラから前記第1メモリへの第1アクセス要求および前記CPUから前記第1メモリへの第2アクセス要求を調停する調停回路を備える、データ処理装置。
A DMA controller for performing data access to the first memory through a first data bus in a DMA control mode;
A CPU for performing a program control data access to the first memory through a second data bus, a first access request from the DMA controller to the first memory, and a second access from the CPU to the first memory A data processing device comprising an arbitration circuit for arbitrating requests.
前記調停回路は前記第2アクセス要求を優先的に受け付ける、請求項6記載のデータ処理装置。The data processing device according to claim 6, wherein the arbitration circuit receives the second access request with priority.
JP2003120875A 2003-04-25 2003-04-25 Data processor Pending JP2004030602A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003120875A JP2004030602A (en) 2003-04-25 2003-04-25 Data processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003120875A JP2004030602A (en) 2003-04-25 2003-04-25 Data processor

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2000056610A Division JP3825605B2 (en) 2000-03-02 2000-03-02 Data processing device

Publications (1)

Publication Number Publication Date
JP2004030602A true JP2004030602A (en) 2004-01-29

Family

ID=31185348

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003120875A Pending JP2004030602A (en) 2003-04-25 2003-04-25 Data processor

Country Status (1)

Country Link
JP (1) JP2004030602A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS60219849A (en) * 1984-04-17 1985-11-02 Nec Corp Packet processing unit
JPH03270562A (en) * 1990-03-20 1991-12-02 Toshiba Corp Facsimile equipment
JPH0619834A (en) * 1992-06-29 1994-01-28 Canon Inc Information processor
JPH06266653A (en) * 1993-03-11 1994-09-22 Canon Inc Picture processor
JPH06301634A (en) * 1993-04-09 1994-10-28 Fujitsu Ltd Dma transfer system
JPH10341257A (en) * 1997-06-10 1998-12-22 Nec Shizuoka Ltd Packet processing unit

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS60219849A (en) * 1984-04-17 1985-11-02 Nec Corp Packet processing unit
JPH03270562A (en) * 1990-03-20 1991-12-02 Toshiba Corp Facsimile equipment
JPH0619834A (en) * 1992-06-29 1994-01-28 Canon Inc Information processor
JPH06266653A (en) * 1993-03-11 1994-09-22 Canon Inc Picture processor
JPH06301634A (en) * 1993-04-09 1994-10-28 Fujitsu Ltd Dma transfer system
JPH10341257A (en) * 1997-06-10 1998-12-22 Nec Shizuoka Ltd Packet processing unit

Similar Documents

Publication Publication Date Title
US6012106A (en) Prefetch management for DMA read transactions depending upon past history of actual transfer lengths
KR101051815B1 (en) Storage controller and storage system
US7490185B2 (en) Data processing system, access control method, and access control device
JP5546635B2 (en) Data transfer apparatus and control method thereof
JP2003187203A (en) File allocation table management by memory controller for memory card
US6697906B1 (en) Semiconductor device supporting integrated data transfer bridging between CPU memory and I/O device
JP2000330859A (en) Optimization of usage of bus having read/write coherency
KR100868395B1 (en) Readdressable virtual dma control and status registers
US7484030B2 (en) Storage controller and methods for using the same
US7490201B2 (en) Method and bus prefetching mechanism for implementing enhanced buffer control
JP2007286813A (en) Memory controller and memory control method
JP3825605B2 (en) Data processing device
JP2004030602A (en) Data processor
JP2014167818A (en) Data transfer device and data transfer method
JP2000227897A (en) Device and system for dma transfer
KR100950356B1 (en) Data transfer unit with support for multiple coherency granules
JPH0415493B2 (en)
JP2003085125A (en) Memory controller and memory control method
US8046434B2 (en) Data communication apparatus and method, data communication system, information-processing apparatus and method, recording medium, and program
JP2963696B2 (en) Data transfer control system
JP2594611B2 (en) DMA transfer control device
JPH07319840A (en) Multi-cpu device
JPS6019023B2 (en) data processing equipment
JP3678537B2 (en) Data transfer method and apparatus
JP2826780B2 (en) Data transfer method

Legal Events

Date Code Title Description
A621 Written request for application examination

Effective date: 20061211

Free format text: JAPANESE INTERMEDIATE CODE: A621

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20091020

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20091221

A02 Decision of refusal

Effective date: 20100615

Free format text: JAPANESE INTERMEDIATE CODE: A02