JP2004139361A - Direct memory access device and its control method - Google Patents

Direct memory access device and its control method Download PDF

Info

Publication number
JP2004139361A
JP2004139361A JP2002303674A JP2002303674A JP2004139361A JP 2004139361 A JP2004139361 A JP 2004139361A JP 2002303674 A JP2002303674 A JP 2002303674A JP 2002303674 A JP2002303674 A JP 2002303674A JP 2004139361 A JP2004139361 A JP 2004139361A
Authority
JP
Japan
Prior art keywords
buffer
data
host cpu
empty flag
flag
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
JP2002303674A
Other languages
Japanese (ja)
Inventor
Takashi Imaizumi
今泉 隆
Shigeo Fujimoto
藤基 滋夫
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.)
Sony Corp
Original Assignee
Sony Corp
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 Sony Corp filed Critical Sony Corp
Priority to JP2002303674A priority Critical patent/JP2004139361A/en
Publication of JP2004139361A publication Critical patent/JP2004139361A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To elongate a bus occupying time on the side of a host CPU by holding read access on the side of the host CPU during read access on the side of an external device and transferring downloaded data directly to the side of the host CPU. <P>SOLUTION: When a DMA request signal DREQ is active and an empty flag FLG is active, DMA read access is performed and data read from an external device 13 is stored in a data buffer 21. Thereby, the data is firstly read from the external device 13 without waiting for a DMA enabling signal DACK from the host CPU 11, and then read request is performed on the host CPU 11 when the empty flag FLG is inactive, the data in the data buffer 21 is transferred to the side of the host CPU 11 in response to read from the host CPU 11, and the empty flag FLG is asserted. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は、ダイレクトメモリアクセス(DMA)装置およびその制御方法に関し、特にホストCPU側と外部デバイス側との間に介在するDMAインターフェイス(I/F)を備えたダイレクトメモリアクセス装置およびその制御方法に関する。
【0002】
【従来の技術】
従来、図6に示すように、ホストCPU101およびDMAコントローラ192を搭載したチップ外に外部デバイス103を有し、ホストCPU101側と外部デバイス103側との間に介在するDMAインターフェイス104を介してデータ転送を行うダイレクトメモリアクセス装置では、外部デバイス103側のリードアクセスのとき、ホストCPU101側のリードアクセスをホールドし、外部デバイス103側から取り込んだデータを直接ホストCPU101側に転送していた(例えば、特許文献1参照)。図7に、その動作タイミングを示す。
【0003】
【特許文献1】
特開平7−21118号公報
【0004】
【発明が解決しようとする課題】
しかしながら、上記従来例に係るダイレクトメモリアクセス装置では、外部デバイス103側のリードアクセスの際に、ホストCPU101側のデータバス105を占有することになるため、外部デバイス103側のリードアクセスが終了するまで、ホストCPU101側のデータバス105を使用できないという課題があった。
【0005】
本発明は、上記課題に鑑みてなされたものであり、その目的とするところは、外部デバイス側のリードアクセスの際におけるホストCPU側のデータバスの占有時間を大幅に削減可能なダイレクトメモリアクセス装置およびその制御方法を提供することにある。
【0006】
【課題を解決するための手段】
上記目的を達成するために、本発明では、ホストCPUと、このホストCPUが搭載されたチップ外に設けられた外部デバイスと、ホストCPU側と外部デバイス側との間に介在するDMAインターフェイスとを備えたダイレクトメモリアクセス装置において、データを一時的に格納するバッファと当該バッファが空であるか否かを示すエンプティフラグを生成するフラグ生成手段とをDMAインターフェイスに設け、外部デバイスからのDMA要求信号がアクティブでかつ前記エンプティフラグがアクティブのとき、外部デバイスからデータを取り込んで前記バッファに格納し、次いで前記エンプティフラグがインアクティブのときホストCPUに対してリード要求を行い、ホストCPUからリードがあったときバッファ内のデータをホストCPU側に転送しかつ前記エンプティフラグをアサートする。
【0007】
外部デバイスのリードアクセスの際に、上記の処理を実行することにより、外部デバイス側のリードアクセスの際に、ホストCPUからのDMA許可信号を待たずに、外部デバイスからデータを読み込んでバッファに格納する、即ち外部デバイスからデータを先読みすることができる。したがって、外部デバイス側のリードアクセスの際におけるホストCPU側のデータバスの占有時間を大幅に削減できる。また、データをあらかじめ先読みすることで、連続リードアクセス等の場合にデータの転送時間を短縮できる。
【0008】
【発明の実施の形態】
以下、本発明の実施の形態について図面を参照して詳細に説明する。
【0009】
[第1実施形態]
図1は、本発明の第1実施形態に係るダイレクトメモリアクセス装置の構成例を示すブロック図である。図1から明らかなように、本実施形態に係るダイレクトメモリアクセス装置は、ホストCPU11、DMAコントローラ12、外部デバイス13およびDMAインターフェイス(I/F)14を有する構成となっている。ここで、外部デバイス13は、ホストCPU11が搭載されたチップ外に設けられたメモリ回路である。
【0010】
DMAインターフェイス14は、データバッファ21、エンプティ(Empty)フラグ生成部22およびDMAタイミング生成部23を有する構成となっている。データバッファ21は、外部デバイス13側のリードアクセスの際に外部デバイス13から読み込んだデータを一時的に格納するために設けられたものである。
【0011】
エンプティフラグ生成部22は、データバッファ21が空(Empty)であるか否かを監視し、データバッファ21が空のときにアクティブ(例えば、正論理のとき高レベル)となり、満(Full)のときにインアクティブ(例えば、正論理のとき低レベル)となるエンプティフラグFLGを生成する。DMAインターフェイス14は、DMAコントローラ12の制御の下に、ホストCPU11側と外部デバイス13側との間でDMAデータ転送を行う際に、そのデータ転送に必要なタイミング信号を生成する。
【0012】
ここで、ホストCPU11側で用いる動作クロックとDMAインターフェイス14側で用いる動作クロックとは同期している。一例として、ホストCPU11側およびDMAインターフェイス14側は共に同じ動作クロックCLKを用いている。また、外部デバイス13からDMAインターフェイス14に入力されるDMA要求信号DREQは、入力される期間に亘ってDMA要求を出すレベルタイプの信号、即ちレベル入力の信号となっている。
【0013】
次に、上記構成の第1実施形態に係るダイレクトメモリアクセス装置におけるDMAインターフェイス14の動作について、図2のタイミングチャートを用いて説明する。
【0014】
DMAインターフェイス14は、外部デバイス13から入力されるDMA要求信号DREQがアクティブでかつエンプティフラグ生成部22で生成されるエンプティフラグFLGがアクティブ、即ちデータバッファ21が空になったとき、ホストCPU11からのDMA許可信号DACKを待たずに、外部デバイス13にDMA許可信号DACKを返して外部デバイス13に対してリードアクセスを発生させ、外部デバイス13からデータを取り込んでデータバッファ21に格納する。
【0015】
また、エンプティフラグFLGがインアクティブ、即ちデータバッファ21が満(Full)のとき、ホストCPU11に対してDMAリード要求を行う。そして、ホストCPU11側からデータのリードがあったとき、データバッファ21内のデータをホストCPU11側に転送しかつエンプティフラグFLGをアサートする(アクティブにする)。
【0016】
上述したように、ホストCPU11側の動作クロックとDMAインターフェイス14側の動作クロックとが同期し、DMA要求信号DREQがレベル入力のダイレクトメモリアクセス装置において、DMA要求信号DREQがアクティブでかつエンプティフラグFLGがアクティブのとき、DMAリードアクセスを行って外部デバイス13から読み込んだデータをデータバッファ21に格納し、エンプティフラグFLGがインアクティブのときホストCPU11に対してリード要求を行い、ホストCPU11からのリードに対してデータバッファ21内のデータをホストCPU11側に転送しかつエンプティフラグFLGをアサートすることで、ホストCPU11からのDMA許可信号DACKを待たずに、外部デバイス13からデータを先読みすることができるため、外部デバイス13側のリードアクセスの際におけるホストCPU11側のデータバス15の占有時間を大幅に削減することができる。
【0017】
また、外部デバイス13のリードアクセスの際に、外部デバイス13から取り込んだデータを直接ホストCPU11へ転送するのではなく、ホストCPU11からのDMA許可信号DACKを待たずに、外部デバイス13にDMA許可信号DACKを返してデータをあらかじめ先読みする、即ち外部デバイス13からデータを読み込んでデータバッファ21に格納することにより、連続リードアクセス等の場合に、データの転送時間を短縮することができるという利点もある。
【0018】
なお、本実施形態では、ホストCPU11側の動作クロックとDMAインターフェイス14側の動作クロックとが同期したダイレクトメモリアクセス装置において、DMA要求信号DREQがレベル入力の信号の場合を例に挙げて説明したが、DMA要求信号DREQが入力されるタイミングでDMA要求を出すパルスタイプの信号、即ちパルス入力の信号の場合にも同様に適用可能である。
【0019】
ホストCPU11側の動作クロックとDMAインターフェイス14側の動作クロックとが同期したダイレクトメモリアクセス装置において、DMA要求信号DREQがパルス入力の場には、図3のタイミングチャートに示すように、外部デバイス13のリードアクセスは、エンプティフラグFLGがアクティブのとき、データ要求信号DREQの立ち上がりタイミングにて起動する。ただし、エンプティフラグFLGのみによる起動はない。
【0020】
[第2実施形態]
図4は、本発明の第2実施形態に係るダイレクトメモリアクセス装置の構成例を示すブロック図であり、図中、図1と同等部分には同一符号を付して示している。
【0021】
本実施形態に係るダイレクトメモリアクセス装置は、ホストCPU11側の動作クロックとDMAインターフェイス14側の動作クロックとが非同期で、DMA要求信号DREQがレベル入力となっている。ここでは、DMAインターフェイス14側の動作クロックをCLK1、ホストCPU11側の動作クロックをCLK2とする。ホストCPU11側の動作クロックとDMAインターフェイス14側の動作クロックとが非同期であることに伴って、DMAインターフェイス14は動作クロックをCLK1,CLK2の双方に対してデータバッファ21およびエンプティフラグ生成部22をそれぞれ用意した構成を採っている。
【0022】
すなわち、DMAインターフェイス14は、データバッファ21およびエンプティフラグ生成部22として、DMAインターフェイス14側の動作クロックCLK1で動作する第1データバッファ21−1および第1エンプティフラグ生成部22−1と、ホストCPU11側の動作クロックCLK2で動作する第2データバッファ21−2および第2エンプティフラグ生成部22−2とを有する構成となっている。DMAインターフェイス14以外の構成は、第1実施形態に係るダイレクトメモリアクセス装置の場合と同じである。
【0023】
次に、上記構成の第2実施形態に係るダイレクトメモリアクセス装置におけるDMAインターフェイス14の動作について、図5のタイミングチャートを用いて説明する。
【0024】
外部デバイス15からのDMA要求信号DREQがアクティブでかつ第1エンプティフラグ生成部22−1で生成される第1エンプティフラグFLG1がアクティブ、即ちデータバッファ21−1が空になったとき、ホストCPU11からのDMA許可信号DACKを待たずに、外部デバイス13にDMA許可信号DACKを返して外部デバイス13に対して外部デバイス13に対してDMAリードアクセスを発生させ、外部デバイス13からデータを取り込んでデータバッファ21−1に格納しかつ第1エンプティフラグFLGをネゲートする(インアクティブにする)。
【0025】
次いで、第1エンプティフラグFLG1がインアクティブでかつ第2エンプティフラグ生成部22−2で生成される第2エンプティフラグFLG2がアクティブ、即ち第2エンプティフラグ生成部22−2が空のとき、第1データバッファ21−1から第2データバッファ21−2に対してデータの転送を行い、第1エンプティフラグFLG1をアサートし(アクティブにし)かつ第2エンプティフラグFLG2をネゲートする。
【0026】
第1データバッファ21−1が空になり、第1エンプティフラグFLG1がアサートされたら、外部デバイス13に対してリードアクセスを行う。このリードアクセスにより、外部デバイス13からデータを取り込んでデータバッファ21−1に格納し、第2エンプティフラグ生成部22−2が空のとき、第1データバッファ21−1から第2データバッファ21−2に対してデータの転送を行う動作を繰り返す。
【0027】
一方、第2エンプティフラグFLG2がインアクティブ、即ちFullのときホストCPU11に対してリード要求を行い、ホストCPU11側からリードがあったとき第2データバッファ21−2のデータをホストCPU11側に転送して第2エンプティフラグFLG2をアサートする。また、第2データバッファ21−2のデータをホストCPU11に転送した後、第1エンプティフラグFLG1がインアクティブでかつ第2エンプティフラグFLG2がアクティブのとき、第1データバッファ21−1から第2データバッファ21−2に対してデータの転送を行う。
【0028】
上述したように、DMAインターフェイス14は動作クロックをCLK1,CLK2の双方に対してデータバッファ21(21−1,21−2)およびエンプティフラグ生成部22(22−1,22−2)をそれぞれ用意し、外部デバイス13のリードアクセスの際に、ホストCPU11からのDMA許可信号DACKを待たずに、外部デバイス13からデータを先読みし、かつデータバッファ21−1,21−2で中継することにより、ホストCPU11側の動作クロックとDMAインターフェイス14側の動作クロックとが非同期の場合であっても、同期の場合と同様に、外部デバイス13側のリードアクセスの際におけるホストCPU11側のデータバス15の占有時間を大幅に削減することができるとともに、連続リードアクセス等の場合に、データの転送時間を短縮することができる。
【0029】
【発明の効果】
以上説明したように、本発明によれば、外部デバイス側のリードアクセスの際に、ホストCPUからのDMA許可信号を待たずに、外部デバイスからデータを先読みすることができるため、ホストCPU側のデータバスの占有時間を大幅に削減することができるとともに、連続リードアクセス等の場合にデータの転送時間を短縮することができる。
【図面の簡単な説明】
【図1】本発明の第1実施形態に係るダイレクトメモリアクセス装置の構成例を示すブロック図である。
【図2】第1実施形態に係るダイレクトメモリアクセス装置におけるレベル入力の場合のタイミングチャートである。
【図3】第1実施形態に係るダイレクトメモリアクセス装置におけるパルス入力の場合のタイミングチャートである。
【図4】本発明の第2実施形態に係るダイレクトメモリアクセス装置の構成例を示すブロック図である。
【図5】第2実施形態に係るダイレクトメモリアクセス装置におけるレベル入力の場合のタイミングチャートである。
【図6】ダイレクトメモリアクセス装置の従来例を示すブロック図である。
【図7】従来例に係るダイレクトメモリアクセス装置のタイミングチャートである。
【符号の説明】
11…ホストCPU、12…DMAコントローラ、13…外部デバイス、14…DMAインターフェイス(I/F)、21,21−1,21−2…データバッファ、22,22−1,22−2…エンプティフラグ生成部、23…DMAタイミング生成部
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a direct memory access (DMA) device and a control method thereof, and more particularly to a direct memory access device having a DMA interface (I / F) interposed between a host CPU and an external device and a control method thereof. .
[0002]
[Prior art]
Conventionally, as shown in FIG. 6, an external device 103 is provided outside a chip on which a host CPU 101 and a DMA controller 192 are mounted, and data transfer is performed via a DMA interface 104 interposed between the host CPU 101 and the external device 103. In the direct memory access apparatus performing the read operation, when the external device 103 performs a read access, the read access of the host CPU 101 is held and the data fetched from the external device 103 is directly transferred to the host CPU 101 (for example, see Patent Reference 1). FIG. 7 shows the operation timing.
[0003]
[Patent Document 1]
JP-A-7-21118
[Problems to be solved by the invention]
However, in the direct memory access apparatus according to the above-described conventional example, the data bus 105 of the host CPU 101 is occupied during the read access of the external device 103, so that the read access of the external device 103 is completed. However, there is a problem that the data bus 105 of the host CPU 101 cannot be used.
[0005]
The present invention has been made in view of the above problems, and an object of the present invention is to provide a direct memory access device capable of greatly reducing the occupation time of a data bus on a host CPU side during a read access on an external device side. And a control method therefor.
[0006]
[Means for Solving the Problems]
In order to achieve the above object, according to the present invention, a host CPU, an external device provided outside a chip on which the host CPU is mounted, and a DMA interface interposed between the host CPU and the external device are provided. In a direct memory access apparatus provided with a DMA interface, a buffer for temporarily storing data and a flag generation means for generating an empty flag indicating whether or not the buffer is empty are provided in a DMA interface, and a DMA request signal from an external device is provided. Is active and the empty flag is active, fetches data from an external device and stores it in the buffer, then makes a read request to the host CPU when the empty flag is inactive, Data in the buffer when And transferred to the CPU side and asserts the empty flag.
[0007]
By performing the above processing at the time of read access of the external device, the data is read from the external device and stored in the buffer without waiting for the DMA permission signal from the host CPU at the time of the read access of the external device. In other words, data can be read ahead from an external device. Therefore, the occupation time of the data bus on the host CPU side during read access on the external device side can be greatly reduced. Further, by pre-reading the data in advance, the data transfer time can be reduced in the case of continuous read access or the like.
[0008]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
[0009]
[First Embodiment]
FIG. 1 is a block diagram showing a configuration example of the direct memory access device according to the first embodiment of the present invention. As is clear from FIG. 1, the direct memory access device according to the present embodiment has a configuration including a host CPU 11, a DMA controller 12, an external device 13, and a DMA interface (I / F) 14. Here, the external device 13 is a memory circuit provided outside the chip on which the host CPU 11 is mounted.
[0010]
The DMA interface 14 has a configuration including a data buffer 21, an empty (Empty) flag generator 22, and a DMA timing generator 23. The data buffer 21 is provided for temporarily storing data read from the external device 13 at the time of read access on the external device 13 side.
[0011]
The empty flag generation unit 22 monitors whether the data buffer 21 is empty (Empty). When the data buffer 21 is empty, the empty flag generation unit 22 becomes active (for example, high level when positive logic), and becomes full (Full). An empty flag FLG that is inactive at some time (for example, low level when the logic is positive) is generated. The DMA interface 14 generates a timing signal required for data transfer under the control of the DMA controller 12 when performing DMA data transfer between the host CPU 11 and the external device 13.
[0012]
Here, the operation clock used by the host CPU 11 and the operation clock used by the DMA interface 14 are synchronized. As an example, both the host CPU 11 and the DMA interface 14 use the same operation clock CLK. The DMA request signal DREQ input from the external device 13 to the DMA interface 14 is a level type signal for issuing a DMA request over the input period, that is, a level input signal.
[0013]
Next, the operation of the DMA interface 14 in the direct memory access device according to the first embodiment having the above configuration will be described with reference to the timing chart of FIG.
[0014]
When the DMA request signal DREQ input from the external device 13 is active and the empty flag FLG generated by the empty flag generator 22 is active, that is, when the data buffer 21 becomes empty, the DMA interface 14 Without waiting for the DMA permission signal DACK, the DMA controller returns the DMA permission signal DACK to the external device 13 to generate a read access to the external device 13, fetches data from the external device 13 and stores it in the data buffer 21.
[0015]
When the empty flag FLG is inactive, that is, when the data buffer 21 is full (Full), a DMA read request is issued to the host CPU 11. Then, when data is read from the host CPU 11, the data in the data buffer 21 is transferred to the host CPU 11 and the empty flag FLG is asserted (activated).
[0016]
As described above, in the direct memory access device in which the operation clock of the host CPU 11 and the operation clock of the DMA interface 14 are synchronized and the DMA request signal DREQ is level-input, the DMA request signal DREQ is active and the empty flag FLG is set. When active, DMA read access is performed and data read from the external device 13 is stored in the data buffer 21. When the empty flag FLG is inactive, a read request is issued to the host CPU 11. By transferring the data in the data buffer 21 to the host CPU 11 and asserting the empty flag FLG, data from the external device 13 can be read first without waiting for the DMA permission signal DACK from the host CPU 11. It is possible to Misr, can greatly reduce the time occupied by host CPU11 side of the data bus 15 at the time of the external device 13 side of the read access.
[0017]
In addition, at the time of read access of the external device 13, the data fetched from the external device 13 is not directly transferred to the host CPU 11, but instead of waiting for the DMA permission signal DACK from the host CPU 11, the DMA By returning DACK and prefetching data in advance, that is, by reading data from the external device 13 and storing it in the data buffer 21, there is also an advantage that the data transfer time can be reduced in the case of continuous read access or the like. .
[0018]
In the present embodiment, an example has been described in which the DMA request signal DREQ is a level input signal in a direct memory access device in which the operation clock of the host CPU 11 and the operation clock of the DMA interface 14 are synchronized. The present invention is also applicable to a pulse type signal that issues a DMA request at the timing when the DMA request signal DREQ is input, that is, a pulse input signal.
[0019]
In a direct memory access device in which the operation clock of the host CPU 11 and the operation clock of the DMA interface 14 are synchronized, when the DMA request signal DREQ is pulse input, as shown in the timing chart of FIG. The read access is started at the rising timing of the data request signal DREQ when the empty flag FLG is active. However, there is no activation only by the empty flag FLG.
[0020]
[Second embodiment]
FIG. 4 is a block diagram showing a configuration example of a direct memory access device according to the second embodiment of the present invention. In the drawing, the same parts as those in FIG. 1 are denoted by the same reference numerals.
[0021]
In the direct memory access device according to the present embodiment, the operation clock of the host CPU 11 and the operation clock of the DMA interface 14 are asynchronous, and the level of the DMA request signal DREQ is input. Here, the operation clock of the DMA interface 14 is CLK1, and the operation clock of the host CPU 11 is CLK2. As the operation clock on the host CPU 11 side and the operation clock on the DMA interface 14 side are asynchronous, the DMA interface 14 sets the data buffer 21 and the empty flag generation unit 22 for both CLK1 and CLK2, respectively. The prepared structure is adopted.
[0022]
That is, the DMA interface 14 includes, as the data buffer 21 and the empty flag generation unit 22, the first data buffer 21-1 and the first empty flag generation unit 22-1 operated by the operation clock CLK 1 on the DMA interface 14 side, and the host CPU 11. It has a second data buffer 21-2 and a second empty flag generation unit 22-2 that operate with the operation clock CLK2 on the side. The configuration other than the DMA interface 14 is the same as that of the direct memory access device according to the first embodiment.
[0023]
Next, the operation of the DMA interface 14 in the direct memory access device according to the second embodiment having the above configuration will be described with reference to the timing chart of FIG.
[0024]
When the DMA request signal DREQ from the external device 15 is active and the first empty flag FLG1 generated by the first empty flag generator 22-1 is active, that is, when the data buffer 21-1 becomes empty, the host CPU 11 Without waiting for the DMA permission signal DACK of the external device 13, a DMA read access to the external device 13 is generated by returning the DMA permission signal DACK to the external device 13, and the data is fetched from the external device 13 to acquire the data buffer. 21-1 and negates the first empty flag FLG (inactivates it).
[0025]
Next, when the first empty flag FLG1 is inactive and the second empty flag FLG2 generated by the second empty flag generator 22-2 is active, that is, when the second empty flag generator 22-2 is empty, the first Data is transferred from the data buffer 21-1 to the second data buffer 21-2, the first empty flag FLG1 is asserted (activated), and the second empty flag FLG2 is negated.
[0026]
When the first data buffer 21-1 becomes empty and the first empty flag FLG1 is asserted, read access to the external device 13 is performed. By this read access, data is fetched from the external device 13 and stored in the data buffer 21-1, and when the second empty flag generator 22-2 is empty, the first data buffer 21-1 to the second data buffer 21- 2 is repeated.
[0027]
On the other hand, when the second empty flag FLG2 is inactive, that is, when it is Full, a read request is issued to the host CPU 11, and when data is read from the host CPU 11, the data in the second data buffer 21-2 is transferred to the host CPU 11 side. To assert the second empty flag FLG2. After the data in the second data buffer 21-2 is transferred to the host CPU 11, when the first empty flag FLG1 is inactive and the second empty flag FLG2 is active, the second data from the first data buffer 21-1 is transmitted. The data is transferred to the buffer 21-2.
[0028]
As described above, the DMA interface 14 prepares the data buffers 21 (21-1 and 21-2) and the empty flag generators 22 (22-1 and 22-2) for the operation clocks CLK1 and CLK2, respectively. Then, at the time of read access of the external device 13, data is read ahead from the external device 13 and relayed by the data buffers 21-1 and 21-2 without waiting for the DMA permission signal DACK from the host CPU 11, Even when the operation clock of the host CPU 11 and the operation clock of the DMA interface 14 are asynchronous, the occupation of the data bus 15 of the host CPU 11 at the time of read access of the external device 13 is the same as in the case of synchronization. Time can be greatly reduced and continuous read access etc. If, it is possible to shorten the transfer time of the data.
[0029]
【The invention's effect】
As described above, according to the present invention, at the time of read access on the external device side, data can be pre-read from the external device without waiting for the DMA permission signal from the host CPU. The occupation time of the data bus can be significantly reduced, and the data transfer time can be reduced in the case of continuous read access or the like.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating a configuration example of a direct memory access device according to a first embodiment of the present invention.
FIG. 2 is a timing chart in the case of a level input in the direct memory access device according to the first embodiment.
FIG. 3 is a timing chart in the case of pulse input in the direct memory access device according to the first embodiment.
FIG. 4 is a block diagram illustrating a configuration example of a direct memory access device according to a second embodiment of the present invention.
FIG. 5 is a timing chart for a level input in a direct memory access device according to a second embodiment.
FIG. 6 is a block diagram showing a conventional example of a direct memory access device.
FIG. 7 is a timing chart of a direct memory access device according to a conventional example.
[Explanation of symbols]
11 Host CPU, 12 DMA Controller, 13 External Device, 14 DMA Interface (I / F), 21, 21-1, 21-2 Data Buffer, 22, 22-1, 22-2 Empty Flag Generation unit, 23: DMA timing generation unit

Claims (11)

ホストCPUと、
前記ホストCPUが搭載されたチップ外に設けられた外部デバイスと、
前記ホストCPU側と前記外部デバイス側との間に介在するDMA(ダイレクトメモリアクセス)インターフェイスとを備え、
前記DMAインターフェイスは、
データを一時的に格納するバッファと、
前記バッファが空であるか否かを示すエンプティフラグを生成するフラグ生成手段とを有し、
前記外部デバイスからのDMA要求信号がアクティブでかつ前記エンプティフラグがアクティブのとき、前記外部デバイスからデータを取り込んで前記バッファに格納し、前記エンプティフラグがインアクティブのとき前記ホストCPUに対してリード要求を行い、前記ホストCPUからのリードに対して前記バッファ内のデータを前記ホストCPU側に転送しかつ前記エンプティフラグをアサートする
ことを特徴とするダイレクトメモリアクセス装置。
A host CPU;
An external device provided outside the chip on which the host CPU is mounted;
A DMA (Direct Memory Access) interface interposed between the host CPU and the external device;
The DMA interface comprises:
A buffer for temporarily storing data,
Flag generating means for generating an empty flag indicating whether the buffer is empty,
When the DMA request signal from the external device is active and the empty flag is active, data is fetched from the external device and stored in the buffer. When the empty flag is inactive, a read request is issued to the host CPU. And transferring the data in the buffer to the host CPU in response to a read from the host CPU and asserting the empty flag.
前記DMA要求信号は、入力される期間に亘ってDMA要求を出すレベルタイプの信号である
ことを特徴とする請求項1記載のダイレクトメモリアクセス装置。
2. The direct memory access device according to claim 1, wherein the DMA request signal is a level type signal for issuing a DMA request over an input period.
前記DMA要求信号は、入力されるタイミングでDMA要求を出すパルスタイプの信号である
ことを特徴とする請求項1記載のダイレクトメモリアクセス装置。
2. The direct memory access device according to claim 1, wherein the DMA request signal is a pulse type signal that issues a DMA request at an input timing.
前記ホストCPU側の動作クロックと前記DMAインターフェイス側の動作クロックとが非同期である
ことを特徴とする請求項1記載のダイレクトメモリアクセス装置。
2. The direct memory access device according to claim 1, wherein an operation clock of the host CPU and an operation clock of the DMA interface are asynchronous.
前記バッファおよび前記フラグ生成手段は、前記DMAインターフェイス側の動作クロックで動作する第1バッファおよび第1フラグ生成手段と、前記ホストCPU側の動作クロックで動作する第2バッファおよび第2フラグ生成手段とからなり、
前記DMAインターフェイスは、
前記外部デバイスからのDMA要求信号がアクティブでかつ前記第1フラグ生成手段で生成される第1エンプティフラグがアクティブのとき、前記外部デバイスからデータを取り込んで前記第1バッファに格納しかつ前記第1エンプティフラグをネゲートし、
前記第1エンプティフラグがインアクティブでかつ前記第2フラグ生成手段で生成される第2エンプティフラグがアクティブのとき、前記第1バッファから前記第2バッファに対してデータの転送を行い、前記第1エンプティフラグをアサートしかつ前記第2エンプティフラグをネゲートし、
前記ホストCPU側からリードがあったとき、前記第2バッファのデータを前記ホストCPU側に転送して前記第2エンプティフラグをネゲートする
ことを特徴とする請求項4記載のダイレクトメモリアクセス装置。
The buffer and the flag generator include a first buffer and a first flag generator that operate with an operation clock of the DMA interface, and a second buffer and a second flag generator that operate with an operation clock of the host CPU. Consisting of
The DMA interface comprises:
When a DMA request signal from the external device is active and a first empty flag generated by the first flag generation means is active, data is fetched from the external device and stored in the first buffer, and Negate the empty flag,
When the first empty flag is inactive and the second empty flag generated by the second flag generating means is active, data is transferred from the first buffer to the second buffer, Asserting an empty flag and negating said second empty flag;
5. The direct memory access device according to claim 4, wherein when a read is made from the host CPU, the data in the second buffer is transferred to the host CPU and the second empty flag is negated.
前記DMAインターフェイスは、前記第1バッファから前記第2バッファに対してデータの転送を行った後、前記第1エンプティフラグをアサートしたら、前記外部デバイスからデータを取り込んで前記第1バッファに格納し、前記第2エンプティフラグがアクティブのとき、前記第1バッファから前記第2バッファに対してデータの転送を行う
ことを特徴とする請求項5記載のダイレクトメモリアクセス装置。
The DMA interface, after transferring data from the first buffer to the second buffer, when asserting the first empty flag, fetches data from the external device and stores the data in the first buffer, 6. The direct memory access device according to claim 5, wherein when the second empty flag is active, data is transferred from the first buffer to the second buffer.
前記DMAインターフェイスは、前記第2バッファのデータを前記ホストCPU側に転送した後、前記第1エンプティフラグがインアクティブでかつ第2エンプティフラグがアクティブのとき、前記第1バッファから前記第2バッファに対してデータの転送を行う
ことを特徴とする請求項5記載のダイレクトメモリアクセス装置。
After transferring the data of the second buffer to the host CPU side, the DMA interface transfers the data from the first buffer to the second buffer when the first empty flag is inactive and the second empty flag is active. 6. The direct memory access device according to claim 5, wherein data is transferred to the direct memory access device.
ホストCPUと、前記ホストCPUが搭載されたチップ外に設けられた外部デバイスと、前記ホストCPU側と前記外部デバイス側との間に介在し、データを一時的に格納するバッファおよび前記バッファが空であるか否かを示すエンプティフラグを生成するフラグ生成手段とを有するDMA(ダイレクトメモリアクセス)インターフェイスとを備えたダイレクトメモリアクセス装置の制御方法であって、
前記外部デバイスからのDMA要求信号がアクティブでかつ前記エンプティフラグがアクティブのとき、前記外部デバイスからデータを取り込んで前記バッファに格納し、
前記エンプティフラグがインアクティブのとき前記ホストCPUに対してリード要求を行い、前記ホストCPUからリードがあったとき前記バッファ内のデータを前記ホストCPU側に転送しかつ前記エンプティフラグをアサートする
ことを特徴とするダイレクトメモリアクセス装置の制御方法。
A host CPU, an external device provided outside the chip on which the host CPU is mounted, and a buffer interposed between the host CPU and the external device for temporarily storing data and the buffer being empty. A direct memory access (DMA) interface having flag generation means for generating an empty flag indicating whether or not an
When the DMA request signal from the external device is active and the empty flag is active, fetch data from the external device and store it in the buffer;
When the empty flag is inactive, a read request is made to the host CPU, and when there is a read from the host CPU, the data in the buffer is transferred to the host CPU and the empty flag is asserted. A method for controlling a direct memory access device.
前記ダイレクトメモリアクセス装置が、前記ホストCPU側の動作クロックと前記DMAインターフェイス側の動作クロックとが非同期で、前記バッファおよび前記フラグ生成手段が、前記DMAインターフェイス側の動作クロックで動作する第1バッファおよび第1フラグ生成手段と、前記ホストCPU側の動作クロックで動作する第2バッファおよび第2フラグ生成手段とからなる場合において、
前記外部デバイスからのDMA要求信号がアクティブでかつ前記第1フラグ生成手段で生成される第1エンプティフラグがアクティブのとき、前記外部デバイスからデータを取り込んで前記第1バッファに格納しかつ前記第1エンプティフラグをネゲートし、
次いで前記第1エンプティフラグがインアクティブでかつ前記第2フラグ生成手段で生成される第2エンプティフラグがアクティブのとき、前記第1バッファから前記第2バッファに対してデータの転送を行い、前記第1エンプティフラグをアサートしかつ前記第2エンプティフラグをネゲートし、
次いで前記第2エンプティフラグがインアクティブのとき前記ホストCPUに対してリード要求を行い、前記ホストCPU側からリードがあったとき前記第2バッファのデータを前記ホストCPU側に転送して前記第2エンプティフラグをアサートする
ことを特徴とする請求項8記載のダイレクトメモリアクセス装置の制御方法。
A first buffer in which the operation clock of the host CPU and the operation clock of the DMA interface are asynchronous with each other, and the buffer and the flag generation unit operate with the operation clock of the DMA interface; In the case of comprising a first flag generating means, a second buffer and a second flag generating means operating on the operation clock of the host CPU,
When a DMA request signal from the external device is active and a first empty flag generated by the first flag generation means is active, data is fetched from the external device and stored in the first buffer, and Negate the empty flag,
Next, when the first empty flag is inactive and the second empty flag generated by the second flag generating means is active, data is transferred from the first buffer to the second buffer, Asserting one empty flag and negating said second empty flag;
Next, when the second empty flag is inactive, a read request is made to the host CPU, and when a read is made from the host CPU, the data in the second buffer is transferred to the host CPU and 9. The control method for a direct memory access device according to claim 8, wherein an empty flag is asserted.
前記第1バッファから前記第2バッファに対してデータの転送を行った後、前記第1エンプティフラグをアサートしたら、前記外部デバイスからデータを取り込んで前記第1バッファに格納し、前記第2エンプティフラグがアクティブのとき、前記第1バッファから前記第2バッファに対してデータの転送を行う
ことを特徴とする請求項9記載のダイレクトメモリアクセス装置の制御方法。
After the data is transferred from the first buffer to the second buffer, when the first empty flag is asserted, data is fetched from the external device and stored in the first buffer, and the second empty flag is stored. 10. The method according to claim 9, wherein data is transferred from the first buffer to the second buffer when is active.
前記第2バッファのデータを前記ホストCPU側に転送した後、前記第1エンプティフラグがインアクティブでかつ第2エンプティフラグがアクティブのとき、前記第1バッファから前記第2バッファに対してデータの転送を行う
ことを特徴とする請求項9記載のダイレクトメモリアクセス装置の制御方法。
After transferring the data in the second buffer to the host CPU, when the first empty flag is inactive and the second empty flag is active, the data is transferred from the first buffer to the second buffer. 10. The method for controlling a direct memory access device according to claim 9, wherein:
JP2002303674A 2002-10-18 2002-10-18 Direct memory access device and its control method Pending JP2004139361A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002303674A JP2004139361A (en) 2002-10-18 2002-10-18 Direct memory access device and its control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002303674A JP2004139361A (en) 2002-10-18 2002-10-18 Direct memory access device and its control method

Publications (1)

Publication Number Publication Date
JP2004139361A true JP2004139361A (en) 2004-05-13

Family

ID=32451341

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002303674A Pending JP2004139361A (en) 2002-10-18 2002-10-18 Direct memory access device and its control method

Country Status (1)

Country Link
JP (1) JP2004139361A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009110168A1 (en) * 2008-03-03 2009-09-11 パナソニック株式会社 Dma transfer device
JP2010244580A (en) * 2005-06-15 2010-10-28 Panasonic Corp External device access apparatus

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010244580A (en) * 2005-06-15 2010-10-28 Panasonic Corp External device access apparatus
WO2009110168A1 (en) * 2008-03-03 2009-09-11 パナソニック株式会社 Dma transfer device

Similar Documents

Publication Publication Date Title
TWI312937B (en) Wait aware memory arbiter
JP4265195B2 (en) Semiconductor device
US6055584A (en) Processor local bus posted DMA FlyBy burst transfers
EP2302519B1 (en) Dynamic frequency memory control
JP2004171209A (en) Shared memory data transfer device
JPH06139189A (en) Common bus arbitrating mechanism
US7669028B2 (en) Optimizing data bandwidth across a variable asynchronous clock domain
JP2006113689A (en) Bus bridge device and data transfer method
JP2001188748A (en) Data transferring device
JP3444154B2 (en) Memory access control circuit
US6047336A (en) Speculative direct memory access transfer between slave devices and memory
JP2004139361A (en) Direct memory access device and its control method
US6032238A (en) Overlapped DMA line transfers
JPH0830546A (en) Bus controller
JP2005524175A (en) Method for fetching data from non-volatile memory in an integrated circuit and corresponding integrated circuit
US5235694A (en) Multi i/o device system using temporary store of ram data when associated communicating i/o devices are operating at various clocking phases
US7609192B1 (en) Control of analog to digital conversion for analog I/O boards
JP2004094945A (en) Interface between host computer and slave device having latency greater than that of host computer
JP2006276979A (en) Data processing method, data processor and image forming apparatus
JP4633334B2 (en) Information processing apparatus and memory access arbitration method
JP3420114B2 (en) Data transfer method
US20070234098A1 (en) Self-timed clock-controlled wait states
US6952216B2 (en) High performance graphics controller
JP2806405B2 (en) Microprocessor
JP2010140440A (en) Bus arbitration device