JP2004220486A - Memory control device - Google Patents

Memory control device Download PDF

Info

Publication number
JP2004220486A
JP2004220486A JP2003009450A JP2003009450A JP2004220486A JP 2004220486 A JP2004220486 A JP 2004220486A JP 2003009450 A JP2003009450 A JP 2003009450A JP 2003009450 A JP2003009450 A JP 2003009450A JP 2004220486 A JP2004220486 A JP 2004220486A
Authority
JP
Japan
Prior art keywords
memory
address
cpu
access
write
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
JP2003009450A
Other languages
Japanese (ja)
Inventor
Toru Aoki
青木  透
Mamiko Akizuki
麻水子 秋月
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP2003009450A priority Critical patent/JP2004220486A/en
Publication of JP2004220486A publication Critical patent/JP2004220486A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a low-cost memory control device for reading a memory from a CPU at a high speed. <P>SOLUTION: This memory control device starts a memory read access at the time of setting an address and stores the read data in FIFO in a signal processor so as to perform the memory read access from the CPU at a high speed. The memory write is performed via FIFO and only when there in no vacant space in the FIFO, a wait signal to the CPU is made effective so as to perform the memory write from the CPU at a high speed. <P>COPYRIGHT: (C)2004,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、例えばコンピュータの外部記憶装置等に適用し得るメモリ制御装置に関する。
【0002】
【従来の技術】
従来のメモリ制御装置は、先読みアドレスを作るためのアドレスカウンタと、このアドレスカウンタによりカウントアップされたカウンタアドレスとリクエストアドレスとを比較するアドレスコンパレータと、前記アドレスカウンタと前記アドレスコンパレータを制御するカウンタコントローラと、前記カウンタアドレスと前記リクエストアドレスをセレクトして出力を行うアドレスセレクトドライバとを備え、一回目のCPUからのメモリリードアクセス時に、アクセスアドレスを前記アドレスカウンタにロードし、メモリアドレスとすることによってCPUが次のリクエストを発生するまでの間に、連続したメモリアドレスに格納されたデータを先読みすることができるので、無駄なアイドル状態を削減してメモリへのアクセス性能を向上することができた。(例えば、特許文献1参照)
また、他の方法として画像メモリアクセス制御方式は、画像メモリに対して、CPUがリードアクセスを行う場合には、CPUからメモリへのアドレスをあらかじめ設定しておき、リードアクセスの有無にかかわらず、CPUリードモード信号の切り替えにより、FIFOコントローラがメモリコントローラに対してリードアクセス要求を出し、メモリコントローラの制御により先に設定しておいたアドレスを更新しながら画像メモリから読み込んだデータをFIFOに格納しておく。コンピュータがリードアクセスを行う際のデータの転送は、このFIFOから行う事により、処理の高速化をはかっていた。(例えば、特許文献2参照)さらに他の方法として、CPUからのリードアクセスを開始する際に、アクセスアドレスの下位桁の一部をカウンタにセットして、CPUがデータを読み込むタイミングで更新する。前記カウンタの出力をメモリへのアドレスとして用いて、メモリアクセスを行い、得たデータはラッチに記憶する。このようにすると、メモリからデータを先読みすることになり、高速なアクセスを実現できた。(例えば特許文献3参照)
【0003】
【特許文献1】
特開平6−161868号公報(第2頁、第1図)
【特許文献2】
特開平7−44697号公報(第1−2頁、第1図)
【特許文献3】
特開平9−34827号公報(第1−2頁、第1図)
【0004】
【発明が解決しようとする課題】
CPUからメモリへのライトアクセスの場合は、メモリ制御装置がライトデータをCPUから受け取った時点で、CPUのバスを開放できるので、ある程度のFIFOをメモリ制御装置内に持つことによって、CPUから見れば高速にメモリにアクセスすることができる。しかし、メモリリードアクセスの場合、CPUからのメモリリードアドレスを受け取ってから、メモリ制御装置はメモリにリードアクセスし、メモリから出力されるリードデータをCPUバスに出力するまで、CPUのバスを開放できないので、CPUからメモリへのリードアクセスには、ライトアクセスに比べ長いアクセス時間が必要であった。そこで、CPUからのメモリリード時、特許文献1〜3では、メモリからあらかじめリードデータをメモリ制御装置内のFIFOに先読みしておくことによって、CPUからのメモリリードアクセスを高速に行っていた。
【0005】
しかし、特許文献1及び3におけるメモリリードデータの先読み方法では、CPUのメモリへのアクセスがバーストアクセス時には有効であるが、ランダムアクセス時はメモリへのアクセスアドレスが不連続となる為、CPUがメモリリードアクセスを開始してから、メモリ制御装置がメモリに対してCPUから受け取ったアドレスを出力し、メモリが出力したリードデータをメモリ制御装置経由でCPUに転送して、CPUのメモリリードアクセスが終了となるので、CPUからメモリへのリードアクセスには長い時間が必要であった。
【0006】
また、特許文献2では、CPUからのリードモード信号の切り換えによってメモリからデータをリードする為、メモリリードを行う期間と、メモリライトの期間が明確に分離されている場合は有効であるが、メモリへのリードアクセスとライトが混在するようなシステムにおいては、適用することができなかった。
【0007】
さらに近年、メモリの大容量化が進み、メモリのアドレスバスやデータバスのビット幅が、CPUのアドレスバスやデータバスのビット幅より広くなる為、CPUからメモリのアドレスやデータを直接出力できないという問題や、CPUからのメモリのアドレスやデータを直接メモリ制御装置経由でメモリと接続すると、メモリ制御装置の端子数が多くなり、メモリ制御装置のコストが高くなるという問題が生じている。
【0008】
本発明は、前記従来の課題を解決するもので、CPUからのメモリリードアクセスを高速化し、CPUのアドレスバスのビット幅によるメモリ容量の制限を無くすとともに、メモリ制御装置の端子数を削減して低コストなメモリ制御装置を提供する。
【0009】
【課題を解決するための手段】
前記従来の課題を解決する為に、本発明は、信号処理手段から書き込まれたメモリアドレスを格納するアドレス格納手段と、メモリから読み出されたデータを格納するリードデータ格納手段と、前記信号処理手段からのメモリアクセス要求信号の調停及び、メモリとのインタフェース信号を生成する前記メモリインタフェース手段と、前記メモリインタフェース手段に対して前記信号処理手段のメモリアクセス要求信号を生成するメモリアクセス要求手段を備え、前記信号処理手段が前記アドレス格納手段にアドレスを書き込むことにより、前記メモリアクセス要求手段が、前記メモリインタフェース手段に対してメモリリードアクセス要求を行うことを特徴としたものである。
【0010】
本発明によれば、前記信号処理手段からのメモリリードアクセスの高速化をはかるとともに、前記信号処理手段とメモリ制御装置間のバス信号の本数を削減して、低コストのメモリ制御装置を提供できる。
【0011】
【発明の実施の形態】
請求項1に記載の発明は、CPUとメモリとの間のアクセスを制御するメモリ制御装置において、前記CPUが所定のメモリアドレスを書き込むアドレス格納手段と、前記メモリから読み出されたデータを格納するリードデータ格納手段と、前記メモリとのアクセス信号を生成するメモリインタフェース手段と、前記CPUが前記メモリインタフェース手段に対するメモリアクセス要求信号を生成するメモリアクセス要求手段とを備え、前記メモリアクセス要求手段は、前記アドレス格納手段にメモリアドレスが書き込まれると、前記メモリインタフェース手段にメモリリードアクセス要求を行うことを特徴とするメモリ制御装置であり、CPUが前記メモリにアクセスする際に、CPUからのメモリリードアクセスの高速化をはかるとともに、CPUとメモリ制御装置間のバス信号の本数を削減して、低コストのメモリ制御装置を提供できる。
【0012】
請求項2に記載の発明は、前記メモリアドレスの最下位バイトが前記CPUから前記アドレス格納手段に書き込まれた時、前記メモリアクセス要求手段が、前記メモリインタフェース手段にメモリリードアクセス要求を行うことを特徴とする請求項1記載のメモリ制御装置であり、無駄な先読みの為のメモリアクセスを減少させることができる。
【0013】
請求項3に記載の発明は、前記CPUからの前記メモリへのアクセスの一つ前のアクセスがメモリリードアクセスである場合のみ、前記CPUが前記アドレス格納手段にアドレスを書き込むことにより、前記メモリアクセス要求手段は、前記メモリインタフェース手段にメモリリードアクセス要求を行うことを特徴とする、請求項1記載のメモリ制御装置であり、無駄な先読みの為のメモリアクセスを減少させることができる。
【0014】
請求項4に記載の発明は、前記アドレス格納手段は、前記CPUにより前記メモリに対するアドレスが書き込まれ、前記メモリインタフェース手段が前記メモリからデータを読み出す毎に、前記アドレス格納手段のメモリアドレスに所定の値を加算することを特徴とする請求項1記載のメモリ制御装置であり、メモリアドレスが自動的に生成されるので、CPUは前記メモリの連続するアドレスにアクセスする際には、アクセスするメモリアドレスを毎回設定する必要がなくなり、CPUのメモリアクセスに要する時間を短縮することができる。
【0015】
請求項5に記載の発明は、前記アドレス格納手段は、前記メモリに対するアドレスが前記CPUにより書き込まれ、前記メモリインタフェース手段が前記メモリからデータを読み出す毎に、前記アドレス格納手段のメモリアドレスに所定の値を減算することを特徴とする、請求項1記載のメモリ制御装置であり、CPUは前記メモリの連続するアドレスにアクセスする際には、アクセスするメモリアドレスを毎回設定する必要がなくなるので、CPUのメモリアクセスに要する時間を短縮することができる。
【0016】
請求項6に記載の発明は、前記リードデータ格納手段は、1バイト以上のFIFOから構成され、前記CPUからのメモリリード後に前記FIFO内にリードデータを格納する為の空き領域が生じた時は、前記メモリアクセス要求手段が、前記メモリインタフェース手段にメモリリードアクセス要求を行うことを特徴とする請求項1記載のメモリ制御装置であり、CPUのメモリアクセスに要する時間を短縮することができる。
【0017】
請求項7に記載の発明は、前記CPUが書き込んだデータを格納するライトデータ格納手段を備え、前記CPUが前記ライトデータ格納手段にライトデータを書き込み、ライトデータ格納手段に格納されたデータが、所定のライトアクセス条件を満たす時、前記メモリアクセス要求手段が、前記メモリインタフェース手段に対してメモリライトアクセス要求を行うことを特徴とする、請求項1記載のメモリ制御装置であり、複数バイトのライトデータを前記メモリに対してバーストライトできるので、メモリライトに要する時間を短縮できる。
【0018】
請求項8に記載の発明は、前記リードデータ格納手段は、前記ライトデータ格納手段を兼用していることを特徴とする請求項7記載のメモリ制御装置であり、低コストでデータ格納手段を構成することができる。
【0019】
請求項9に記載の発明は、前記ライトデータ格納手段は、バーストライトデータ格納手段とランダムライトデータ格納手段を備え、前記メモリアクセス要求手段は、前記CPUが前記バーストライトデータ格納手段にデータをライトした時、前記ライトアクセス条件を満たした場合にメモリライトアクセス要求を行い、前記CPUが前記ランダムライトデータ格納手段にデータをライトした場合は、即座にメモリライトアクセス要求を行なうことを特徴とする、請求項7記載のメモリ制御装置であり、データ格納手段に格納されたライトデータをすべて、前記メモリに書き込むことができる。
【0020】
請求項10に記載の発明は、前記バーストライトデータ格納手段は、前記ランダムライトデータ格納手段を兼用していることを特徴とする請求項9記載のメモリ制御装置であり、データ格納手段の回路規模を小さくすることができる。
【0021】
請求項11に記載の発明は、前記ライトアクセス条件は、所定のバイト数のライトデータを前記ライトデータ格納手段に格納完了時であることを特徴とする、請求項7、請求項9または請求項10記載のメモリ制御装置であり、複数バイトのライトデータを前記メモリに対してバーストライトできるので、前記メモリを占有する時間を短縮できる。
【0022】
請求項12に記載の発明は、前記ライトアクセス条件は、2のN乗(Nは所定の値の自然数)から1を引いた値のメモリアドレスにライトすべきライトデータを前記ライトデータ格納手段に格納完了時でであることを特徴とする、請求項7、請求項9または請求項10記載のメモリ制御装置であり、前記メモリを占有する時間を短縮でき、高速なメモリ制御装置を提供できる。
【0023】
請求項13に記載の発明は、前記ライトアクセス条件は、前記CPUのメモリライトアクセスとその一つ前のメモリライトアクセスとの経過時間を計測する経過時間計測手段を備え、所定の時間内に前記CPUからのメモリアクセスが発生しない場合とすることを特徴とする、請求項7、請求項9または請求項10記載のメモリ制御装置であり、データ格納手段に格納されたライトデータはすべて、前記メモリに書き込むことができる。
【0024】
請求項14に記載の発明は、前記アドレス格納手段は、メモリアドレス発生手段と設定アドレス保持手段を備え、前記CPUから前記設定アドレス保持手段にメモリアドレスが設定された時、前記ライトデータ格納手段にライトデータが格納されている場合は、前記メモリアクセス要求手段が前記メモリインタフェース手段に対してメモリライトアクセス要求を行うことを特徴とする、請求項7、請求項9または請求項10記載のメモリ制御装置であり、データ格納手段に格納されたライトデータはすべて、前記メモリに書き込むことができる。
【0025】
請求項15に記載の発明は、前記CPUに対して、ウェイト信号を出力するウェイト信号生成手段を備え、前記CPUからの前記アドレス格納手段に対するメモリアドレスを設定した時に前記メモリへのライトデータが前記ライトデータ格納手段に格納されている場合、または前記CPUからの前記ライトデータ格納手段に対するデータ書き込みを行なった時に前記ライトデータ格納手段にライトデータを格納する空間がない場合に前記ウェイト信号生成手段は前記CPUに対してウェイト信号を生成することを特徴とする、請求項7、請求項9または請求項10記載のメモリ制御装置であり、データ格納手段にメモリデータを書き込むことができる時には、CPUに対するウェイト信号が有効にならないので、CPUは高速にメモリライトアクセスすることができる。
【0026】
以下に本発明の実施の形態について、図面を参照しながら説明する。
【0027】
(実施の形態1)
本発明の請求項1、請求項2、請求項4、請求項5、請求項6、請求項8、請求項14に記載された発明の実施の形態について図1、図2および図3を用いて説明する。図1はメモリ、CPU、メモリ制御装置の接続を示しており、1はCPU、2はデータを格納するメモリ、3はCPU1からメモリ2へのアクセスを制御するメモリ制御装置、31はCPU1から入力される信号を内部のシステムクロックに同期化する同期化回路、32はメモリ2に対する制御信号を生成するメモリインタフェースブロック、33は同期化回路31経由でCPU1によって設定されたアドレスをもとにメモリインタフェースブロック32へのアドレスを生成するアドレス生成ブロック、34はメモリインタフェースブロック32に対するメモリアクセス要求信号を生成するリクエスト生成ブロック、35はCPU1によって書き込まれたライトデータや、メモリ2から読み出されたメモリリードデータを格納する12バイトのデータFIFOである。
【0028】
図2は、アドレス生成ブロック33のブロック図を示しており、331はCPU1から書き込まれたメモリ2への下位アドレスを一時的に格納する下位アドレスレジスタ、332はCPU1から書き込まれたメモリ2への上位アドレスを一時的に格納する上位アドレスレジスタ、333はメモリインタフェースブロック32へ出力するメモリアクセスアドレスの下位アドレスを生成する下位アドレスカウンタ、334はメモリインタフェースブロック32へ出力するメモリアクセスアドレスの上位アドレスを生成する上位アドレスカウンタであり、上位アドレスレジスタ332、下位アドレスレジスタ331およびデータFIFO35は、CPU1のアドレス空間にマッピングされている。
【0029】
図3は、下位アドレスレジスタ331に対してCPU1がメモリ2に対する下位アドレスを設定した時を起点とするメモリアクセスアドレス信号生成のフローチャートを示している。
【0030】
CPU1からメモリ2へのリードアクセスに関して説明する。CPU1はメモリ2への上位アドレスを上位アドレスレジスタ332に設定後、メモリ2への下位アドレスを下位アドレスレジスタ331に設定する。図3の処理1に示すように、CPU1から下位アドレスレジスタ331にアドレスが設定された時にメモリ2に書き込まれていないライトデータがデータFIFO35に例えば4バイト存在している場合、リクエスト生成ブロック34はメモリインタフェースブロック32に対してメモリライトの為にメモリアクセス要求信号を有効にし、メモリインタフェースブロック32によってアクセス調停後、メモリアクセスが許可されると、メモリインタフェースブロック32に対して下位アドレスカウンタ333および上位アドレスカウンタ334からメモリアドレス、データFIFO35から4バイトのメモリライトデータを転送後、上位アドレスレジスタ332、下位アドレスレジスタ331に格納されている値を上位アドレスカウンタ334、下位アドレスカウンタ333にそれぞれロードし、リクエスト生成ブロック34はメモリリードの為にメモリアクセス要求信号を有効にする。
【0031】
また、CPU1から下位アドレスレジスタ331にアドレスが設定された時にデータFIFO35にメモリ2へのライトデータが格納されていない場合は、上位アドレスレジスタ332、下位アドレスレジスタ331に格納されている値を上位アドレスカウンタ334、下位アドレスカウンタ333にそれぞれロードし、リクエスト生成ブロック34はメモリインタフェースブロック32に対して、メモリリードの為にメモリアクセス要求信号を有効にする。メモリインタフェースブロック32は、リクエスト生成ブロック34からのメモリリード要求信号を優先順位に従って調停後、リクエスト生成ブロック34に対してメモリリード許可信号を有効にする。メモリアクセスが許可されると、上位アドレスカウンタ334及び下位アドレスカウンタ333は、メモリリードアドレスをメモリインタフェースブロック32に出力する。メモリインタフェースブロック32は、受け取ったメモリリードアドレスをもとにメモリ2に対して8バイトのメモリリードアクセスを行う。メモリ2から読みだされた8バイトのリードデータは、メモリインタフェースブロック32によって、データFIFO35に転送され、データFIFO35に格納される。CPU1がメモリリードデータを読み出す際は、データFIFO35がCPU1のアドレス空間にマッピングされているので、データFIFO35に対応するCPU1のアドレス空間に対してリード命令を発行すれば、データFIFO35に格納されているメモリリードデータを2バイトずつメモリ制御装置3から読み出すことができる。CPU1がデータFIFO35に格納されているデータを読み出すことによって、CPU1のメモリアクセスがメモリリードであることが確定するので、上位アドレスカウンタ334及び、下位アドレスカウンタ333は、アクセスアドレスを8バイト分、カウントアップして、次のメモリリードアクセスの為のメモリリードアドレスを準備する。
【0032】
また、図3において処理2として、処理1に続くCPU1からデータFIFO35へのリードアクセスを示す。CPU1がメモリ制御装置3からデータを読み出すことにより、データFIFO35に格納されているリードデータが読み出された結果、データFIFO35に8バイト以上の空き領域が発生した場合には、リクエスト生成ブロック34はメモリインタフェースブロック32に対してメモリリードの為にメモリアクセス要求信号を有効にする。メモリインタフェースブロック32によって、メモリアクセスが許可されると、上位アドレスカウンタ334及び、下位アドレスカウンタ333は、アドレスをメモリインタフェースブロック32に転送後、8バイト分カウントアップして次のメモリリードアクセスの為のメモリリードアドレスを準備する。本実施例に示すとおり、メモリに格納されているデータを先読みすることによって、CPU1からのメモリ2に対するリードアクセスを高速に行うことができる。
【0033】
なお、本実施例においては、上位アドレスカウンタ334及び下位アドレスカウンタ333は、次のメモリリードアクセスの為に8バイト分インクリメントしているが、次のメモリリードアクセスの為に8バイト分デクリメントしてもよい。
【0034】
また、CPU1によってデータFIFO35から一度に読み出されるバイト数、データFIFO35のバイト数、メモリ2に対してメモリインタフェースブロック32が一度にアクセスするバイト数などは、本実施例と異なっていてもよい。
【0035】
(実施の形態2)
本発明の請求項1、請求項2、請求項3に記載された発明の実施の形態について図1、図2、図4を用いて説明する。図4はリクエスト生成ブロック34のブロック図である。341は、CPU1が最後にメモリにアクセスした方向がメモリリード方向であるか、ライト方向であるかを記憶するアクセス方向レジスタ、342はメモリインタフェースブロック32に対して出力するメモリアクセス要求信号を生成する、REQ生成回路である。
【0036】
CPU1がデータFIFO35に対してライトまたはリードした時、アクセス方向レジスタ341にCPU1がリードしたかライトしたかの情報が格納される。アクセス方向レジスタ341に格納されている情報が、メモリリード方向である時、実施の形態1と同様な動作を行うので説明は省略し、アクセス方向レジスタ341に格納される情報が、メモリライト方向である時、つまり前のCPU1からメモリ2に対するアクセスがメモリライトである場合の動作について、以下に説明する。
【0037】
CPU1からメモリ2へのメモリリードアクセス時、CPU1はメモリ2への上位アドレスを上位アドレスレジスタ332に設定後、メモリ2への下位アドレスを下位アドレスレジスタ331に設定する。下位アドレスレジスタ331にアドレスが設定された時、メモリ2にまだ書き込まれていないライトデータがデータFIFO35に例えば2バイト存在している場合は、REQ生成回路342はメモリインタフェースブロック32に対してメモリライトの為にメモリアクセス要求信号を有効にし、メモリインタフェースブロック32によってアクセス調停後、メモリアクセスが許可されると、メモリインタフェースブロック32に対してデータFIFO35、上位アドレスカウンタ334及び下位アドレスカウンタ333から、2バイトのメモリライトデータおよびメモリリードアドレスをメモリインタフェースブロック32に転送し、上位アドレスレジスタ332、下位アドレスレジスタ331に格納されている値を上位アドレスカウンタ334、下位アドレスカウンタ333にそれぞれロードする。
【0038】
また、下位アドレスレジスタ331にアドレスが設定された時、データFIFO35にメモリ2へのライトデータが格納されていない場合は、上位アドレスレジスタ332、下位アドレスレジスタ331の値をそれぞれ上位アドレスカウンタ334、下位アドレスカウンタ333にロードする。次にCPU1からデータFIFO35へのリードアクセスが発生すると、REQ生成回路342はメモリインタフェースブロック32に対してメモリリードの為にメモリアクセス要求信号を有効にし、アクセスが許可されると、上位アドレスレジスタ332、下位アドレスレジスタ331からメモリインタフェースブロック32に対してメモリアドレスが転送される。メモリインタフェースブロック32は転送されたメモリアドレス及び連続するアドレスに格納されている計8バイトのデータをメモリ2から読み出して、データFIFO35に転送する。データFIFO35に格納されたメモリリードデータのうち、2バイトのメモリリードデータがCPU1によって読み出されると同時にアクセス方向レジスタ341にCPU1のアクセス方向としてリードアクセス方向が格納される。この後の動作は実施の形態1と同様にCPU1からのデータFIFO35のリードによって、データFIFO35に8バイト以上の空き領域が発生した場合には、REQ生成回路342はメモリインタフェースブロック32に対してメモリリードアクセスの為にメモリアクセス要求信号を有効にする。本実施例に示すとおり、CPU1からのアクセス方向(リードもしくはライト)が連続するようなシステムにおいては、メモリライトアクセスの次のメモリアクセスは、ライトアクセスである可能性が高いので、アドレス設定時に、データを先読み機能を無効にすることでCPU1からの無駄なメモリリードアクセスを減らすことができる。
【0039】
(実施の形態3)
本発明の請求項1、請求項7、請求項9、請求項10、請求項11に記載された発明の実施の形態について図1、図2を用いて説明する。
データFIFO35はCPU1の2個所のアドレス空間にマッピングされている。
片方のアドレスをバーストアクセス用アドレスとし、他方のアドレスをランダムアクセス用アドレスとする。CPU1からメモリ2に対して連続するアドレスにデータを格納する場合、バーストアクセス用アドレスに対してCPU1がデータをライトすると、ライトデータはデータFIFO35に格納される。CPU1からバーストアクセス用アドレスに対してライト命令を4回発行することによって、8バイトのデータがデータFIFO35に格納されると、リクエスト生成ブロック34は、メモリインタフェースブロック32に対してメモリライトの為にメモリアクセス要求信号を有効にする。メモリインタフェースブロック32でメモリアクセスの調停が行われ、メモリアクセスが許可されると、データFIFO35は、格納された8バイトのデータを順次、メモリインタフェースブロック32に対して出力する。メモリインタフェースブロック32は、受け取ったライトデータをメモリ2に書き込む。また、連続するデータの最後のバイトをライトする時や、連続していないアドレスへライトする場合には、ランダムアクセス用アドレスに対してCPU1がライト命令を発行する。CPU1がランダムアクセス用アドレスに対してライト命令を発行すると、リクエスト生成ブロック34は、データFIFO35に格納されているバイト数に関係なく、メモリインタフェースブロック32に対してメモリライトの為にメモリアクセス要求信号を有効にする。メモリインタフェースブロック32でメモリアクセスの調停が行われ、メモリアクセスが許可されると、データFIFO35はランダムアクセス用アドレスに対してCPU1がライトしたデータを含むデータFIFO35に格納されているデータをメモリインタフェースブロック32に転送する。メモリインタフェースブロック32は、受け取ったライトデータを、メモリ2のアドレス生成ブロック33から転送されたメモリアドレスが示す場所に書き込む。
【0040】
(実施の形態4)
本発明の請求項1、請求項7、請求項9、請求項10、請求項12、請求項13に記載された発明の実施の形態について図1、図5を用いて説明する。
【0041】
図5はリクエスト生成ブロック34のブロック図である。342はメモリインタフェースブロック32に対して出力するメモリアクセス要求信号を生成するREQ生成回路、343はCPU1がデータFIFO35にデータをライトした際にクリアされ、一定時間毎にカウントアップされるライトアクセスタイマーである。
【0042】
データFIFO35はCPU1のアドレス空間の2個所にマッピングされている。片方のアドレスをバーストアクセス用アドレスとし、他方のアドレスをランダムアクセス用アドレスとする。CPU1からメモリ2に対して連続するアドレスにデータを格納する場合、バーストアクセス用アドレスに対してCPU1がデータをライトし、ライトデータはデータFIFO35に格納される。アドレスの下位の3ビット全てが1であるようなメモリアドレスに対応するライトデータがデータFIFO35に格納された時に、メモリインタフェースブロック32に対してリクエスト生成ブロック34はメモリライトアクセスの為にメモリアクセス要求信号を有効にする。メモリインタフェースブロック32は調停後、アクセスを許可するとともに、アドレス生成ブロック33からメモリアクセスアドレスを、データFIFO35からメモリライトデータを受け取り、メモリ2に対してアドレスの下位の3ビットが0であるメモリアドレスから8バイトのアクセスを開始する。この時、バーストアクセスの開始時にアクセス開始アドレスの下位の3ビットが0でない場合やランダムアクセス時にもアドレスの下位の3ビットが0であるアドレスからメモリ2にアクセスする。ただし、本来データをライトすべきアドレス以外は、メモリ2に対するライトコマンドをマスクすることによって、目的のデータのみメモリ2に格納する。
【0043】
また、CPU1がライトデータをデータFIFO35にライトすると、ライトアクセスタイマー343が0にクリアされ、カウントアップを開始する。ライトアクセスタイマー343が所定の値までカウントアップしたにもかかわらず、データFIFO35にライトされたデータが、メモリ2に書き込まれていない時、REQ生成回路342はメモリインタフェースブロック32に対するメモリアクセス要求信号を有効にして、データFIFO35に格納されたデータをメモリ2に書き込む。
【0044】
なお、CPU1によってデータFIFO35に一度に書き込まれるバイト数、データFIFO35のバイト数、メモリアクセス要求信号を有効する時の判断にもちいるアドレスのビット数などは、本実施例と異なっていてもよい。
【0045】
(実施の形態5)
本発明の請求項15に記載された発明の実施の形態について図6を用いて説明する。1はCPU、2はデータを格納するメモリ、3はCPU1からメモリへのアクセスを制御するメモリ制御装置、31はCPU1から入力される信号を内部のシステムクロックに同期化する同期化回路、32はメモリ2に対する制御信号を生成するメモリインタフェースブロック、33は同期化回路31経由でCPU1によって設定されたアドレスをもとにメモリインタフェースブロック32へのアドレスを生成するアドレス生成ブロック、34はメモリインタフェースブロック32に対するメモリアクセス要求信号を生成するリクエスト生成ブロック、35はCPU1によって書き込まれたライトデータや、メモリ2から読み出されたメモリリードデータを格納する12バイトのデータFIFOであり、アドレス生成ブロック33とデータFIFO35はCPU1のアドレス空間にマッピングされている。36は、CPU1に対するウェイト信号を生成するウェイト生成回路である。CPU1からメモリ2へのライトアクセスに関して説明する。CPU1はメモリ2へのアドレスをメモリ生成ブロック33に設定する。
【0046】
次にCPU1はメモリ2へのライトデータをデータFIFO35にライトする。
データFIFO35に8バイトのライトデータが格納されると、リクエスト生成ブロック34はメモリインタフェースブロック32に対するメモリライトアクセスの為にメモリアクセス要求信号を有効にする。メモリインタフェースブロック32によって調停後、メモリアクセスが許可されると、アドレス生成ブロック33、データFIFO35はメモリ2に対するアドレス、8バイトのライトデータをメモリインタフェースブロック32に転送し、メモリインタフェースブロック32はメモリ2に対してデータを8バイトライトする。リクエスト生成ブロック34がメモリアクセス要求信号を有効にしてから、メモリアクセスが許可されるまでの間に、CPU1からのデータFIFO35への連続するライト命令によって、データFIFO35にデータを格納する為の領域が無くなった場合、CPU1がデータFIFO35に対するライト命令に対してウェイト生成回路36は、ウェイト信号を有効にする。メモリインタフェースブロック32によってメモリアクセスが許可されると、メモリ2へのライトデータをデータFIFO35からメモリインタフェースブロック32に転送できるので、データFIFO35の格納領域に空きができる。データFIFO35の格納領域に空きができると、ウェイト生成回路36はCPU1に対するウェイト信号を無効にする。CPU1は、ウェイト信号が無効になると、データFIFO35へのライト動作を完了する。
【0047】
【発明の効果】
以上のように本発明によれば、前記信号処理手段からのメモリリードアクセスの高速化をはかるとともに、前記信号処理手段とメモリ制御装置間のバス信号の本数を削減して、低コストのメモリ制御装置を提供できる。
【図面の簡単な説明】
【図1】本発明の実施の形態1〜4におけるメモリ制御装置のブロック図
【図2】本発明の実施の形態1〜3におけるアドレス生成ブロックのブロック図
【図3】本発明の実施の形態1におけるメモリリード時のフローチャート
【図4】本発明の実施の形態2におけるリクエスト生成ブロックのブロック図
【図5】本発明の実施の形態4におけるリクエスト生成ブロックのブロック図
【図6】本発明の実施の形態5におけるメモリ制御装置のブロック図
【符号の説明】
1 CPU
2 メモリ
3 メモリ制御装置
31 同期化回路
32 メモリインタフェース
33 アドレス生成ブロック
34 リクエスト生成ブロック
35 データFIFO
36 ウェイト生成回路
331 下位アドレスレジスタ
332 上位アドレスレジスタ
333 下位アドレスカウンタ
334 上位アドレスカウンタ
341 アクセス方向レジスタ
342 REQ生成回路
343 ライトアクセスタイマー
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a memory control device applicable to, for example, an external storage device of a computer.
[0002]
[Prior art]
A conventional memory control device includes an address counter for generating a pre-read address, an address comparator for comparing a request address with a counter address counted up by the address counter, and a counter controller for controlling the address counter and the address comparator. And an address select driver that selects and outputs the counter address and the request address, and at the time of a first memory read access from the CPU, loads an access address into the address counter and sets it as a memory address. Until the CPU generates the next request, data stored in consecutive memory addresses can be read ahead, so that unnecessary idle states can be reduced and memory access performance can be improved. I was able to. (For example, see Patent Document 1)
As another method, the image memory access control method is such that when the CPU performs read access to the image memory, an address from the CPU to the memory is set in advance, and regardless of the presence or absence of the read access, When the CPU read mode signal is switched, the FIFO controller issues a read access request to the memory controller, and stores the data read from the image memory in the FIFO while updating the previously set address under the control of the memory controller. Keep it. Data transfer when the computer performs read access is performed from this FIFO, thereby speeding up the processing. (For example, refer to Patent Document 2) As still another method, when starting read access from the CPU, a part of lower-order digits of an access address is set in a counter and updated at a timing when the CPU reads data. A memory access is performed using the output of the counter as an address to the memory, and the obtained data is stored in a latch. In this case, data is read ahead from the memory, and high-speed access can be realized. (For example, see Patent Document 3)
[0003]
[Patent Document 1]
JP-A-6-161868 (page 2, FIG. 1)
[Patent Document 2]
JP-A-7-44697 (page 1-2, FIG. 1)
[Patent Document 3]
JP-A-9-34827 (page 1-2, FIG. 1)
[0004]
[Problems to be solved by the invention]
In the case of write access from the CPU to the memory, the bus of the CPU can be released when the memory control device receives the write data from the CPU. Therefore, by having a certain amount of FIFO in the memory control device, The memory can be accessed at high speed. However, in the case of a memory read access, the memory controller cannot read the memory read address from the CPU until the memory controller accesses the memory and outputs read data output from the memory to the CPU bus. Therefore, read access from the CPU to the memory requires a longer access time than write access. Therefore, at the time of memory reading from the CPU, in Patent Literatures 1 to 3, memory read access from the CPU is performed at high speed by pre-reading read data from a memory into a FIFO in a memory control device.
[0005]
However, in the prefetching method of the memory read data described in Patent Documents 1 and 3, the access to the memory of the CPU is effective at the time of the burst access, but at the time of the random access, the access address to the memory becomes discontinuous. After the read access is started, the memory control device outputs the address received from the CPU to the memory, transfers the read data output from the memory to the CPU via the memory control device, and completes the memory read access of the CPU. Therefore, the read access from the CPU to the memory requires a long time.
[0006]
In Patent Document 2, since data is read from the memory by switching the read mode signal from the CPU, it is effective when the memory read period and the memory write period are clearly separated, It cannot be applied to a system in which read access and write access to the memory are mixed.
[0007]
Furthermore, in recent years, the capacity of memories has been increased, and the bit width of address buses and data buses of memories has become wider than the bit widths of address buses and data buses of CPUs. When the address and data of the memory from the CPU are directly connected to the memory via the memory control device, the number of terminals of the memory control device increases and the cost of the memory control device increases.
[0008]
The present invention solves the above-mentioned conventional problems by speeding up memory read access from the CPU, eliminating the limitation of the memory capacity due to the bit width of the address bus of the CPU, and reducing the number of terminals of the memory control device. To provide a low-cost memory control device.
[0009]
[Means for Solving the Problems]
In order to solve the above-mentioned conventional problems, the present invention provides an address storage unit for storing a memory address written from a signal processing unit, a read data storage unit for storing data read from a memory, The memory interface means for arbitrating a memory access request signal from the means and generating an interface signal with the memory; and a memory access request means for generating a memory access request signal of the signal processing means to the memory interface means. The signal processing means writes an address in the address storage means, and the memory access request means makes a memory read access request to the memory interface means.
[0010]
According to the present invention, it is possible to provide a low-cost memory control device by increasing the speed of memory read access from the signal processing means and reducing the number of bus signals between the signal processing means and the memory control device. .
[0011]
BEST MODE FOR CARRYING OUT THE INVENTION
According to a first aspect of the present invention, there is provided a memory control device for controlling access between a CPU and a memory, wherein the CPU stores address read means for writing a predetermined memory address, and data read from the memory. Read data storage means, memory interface means for generating an access signal to the memory, and memory access request means for the CPU to generate a memory access request signal to the memory interface means, the memory access request means, When a memory address is written to the address storage means, a memory read access request is made to the memory interface means. When the CPU accesses the memory, a memory read access from the CPU is performed. Speeding up , To reduce the number of bus signals between the CPU and the memory controller can provide a low-cost memory controller.
[0012]
According to a second aspect of the present invention, when the least significant byte of the memory address is written from the CPU to the address storage unit, the memory access request unit issues a memory read access request to the memory interface unit. The memory control device according to claim 1, wherein a memory access for useless prefetching can be reduced.
[0013]
The invention according to claim 3, wherein the CPU writes the address in the address storage means only when the access immediately before the access from the CPU to the memory is a memory read access, thereby providing the memory access. 2. The memory control device according to claim 1, wherein the request unit issues a memory read access request to the memory interface unit, and can reduce unnecessary memory access for prefetching.
[0014]
According to a fourth aspect of the present invention, the address storage means writes an address to the memory by the CPU, and stores a predetermined address in the memory address of the address storage means every time the memory interface reads data from the memory. 2. The memory control device according to claim 1, wherein the memory address is automatically generated, so that when the CPU accesses successive addresses of the memory, the CPU accesses the memory address. Need not be set each time, and the time required for the CPU to access the memory can be reduced.
[0015]
According to a fifth aspect of the present invention, the address storage means writes a predetermined address to the memory address of the address storage means each time the address to the memory is written by the CPU and the memory interface means reads data from the memory. 2. The memory control device according to claim 1, wherein the CPU does not need to set a memory address to be accessed each time a continuous address of the memory is accessed. The time required for memory access can be shortened.
[0016]
According to a sixth aspect of the present invention, the read data storage means comprises a FIFO of 1 byte or more, and when there is a free area for storing read data in the FIFO after memory read from the CPU. 2. The memory control device according to claim 1, wherein the memory access request unit issues a memory read access request to the memory interface unit, and a time required for a memory access of the CPU can be reduced.
[0017]
The invention according to claim 7, further comprising: write data storage means for storing the data written by the CPU, wherein the CPU writes the write data to the write data storage means, and the data stored in the write data storage means is: 2. The memory control device according to claim 1, wherein when a predetermined write access condition is satisfied, the memory access request unit issues a memory write access request to the memory interface unit. Since data can be burst-written to the memory, the time required for memory write can be reduced.
[0018]
The invention according to claim 8 is the memory control device according to claim 7, wherein the read data storage means is also used as the write data storage means, and comprises the data storage means at low cost. can do.
[0019]
According to a ninth aspect of the present invention, the write data storage means includes a burst write data storage means and a random write data storage means, and the memory access request means is such that the CPU writes data to the burst write data storage means. A memory write access request is made when the write access condition is satisfied, and a memory write access request is made immediately when the CPU writes data to the random write data storage means. 8. The memory control device according to claim 7, wherein all the write data stored in the data storage means can be written to the memory.
[0020]
The invention according to claim 10 is the memory control device according to claim 9, wherein the burst write data storage means is also used as the random write data storage means. Can be reduced.
[0021]
The invention according to claim 11, wherein the write access condition is a time when storage of write data of a predetermined number of bytes in the write data storage means is completed. 11. The memory control device according to 10, wherein a plurality of bytes of write data can be burst-written to the memory, so that the time for occupying the memory can be reduced.
[0022]
13. The write data storage means according to claim 12, wherein the write access condition is such that write data to be written to a memory address of a value obtained by subtracting 1 from 2 N (N is a natural number of a predetermined value) is stored in the write data storage means. The memory control device according to any one of claims 7, 9 and 10, wherein storage is completed, and the time for occupying the memory can be reduced, and a high-speed memory control device can be provided.
[0023]
The invention according to claim 13, wherein the write access condition includes an elapsed time measuring means for measuring an elapsed time between a memory write access of the CPU and a memory write access immediately before the write access condition, and the write access condition is set within a predetermined time. 11. The memory control device according to claim 7, wherein a memory access from a CPU does not occur, wherein all the write data stored in the data storage means is stored in the memory. Can be written to.
[0024]
The invention according to claim 14, wherein the address storage means includes a memory address generation means and a setting address holding means, and when a memory address is set in the setting address holding means from the CPU, the write data storage means 11. The memory control according to claim 7, wherein when write data is stored, the memory access request unit issues a memory write access request to the memory interface unit. The write data stored in the data storage means can be written to the memory.
[0025]
The invention according to claim 15, further comprising wait signal generation means for outputting a wait signal to the CPU, wherein when a memory address for the address storage means from the CPU is set, the write data to the memory is If the write signal is stored in the write data storage means, or if there is no space for storing the write data in the write data storage means when data is written from the CPU to the write data storage means, the wait signal generation means 11. The memory control device according to claim 7, wherein the wait signal is generated for the CPU, wherein when the memory data can be written to the data storage unit, the wait signal is transmitted to the CPU. Since the wait signal does not become valid, the CPU It is possible to access.
[0026]
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[0027]
(Embodiment 1)
An embodiment of the invention described in claim 1, claim 2, claim 4, claim 5, claim 6, claim 8, or claim 14 of the present invention will be described with reference to FIG. 1, FIG. 2, and FIG. Will be explained. FIG. 1 shows a connection between a memory, a CPU, and a memory control device, where 1 is a CPU, 2 is a memory for storing data, 3 is a memory control device for controlling access from the CPU 1 to the memory 2, and 31 is an input from the CPU 1. A synchronizing circuit for synchronizing a signal to be synchronized with an internal system clock; 32, a memory interface block for generating a control signal for the memory 2; 33, a memory interface based on an address set by the CPU 1 via the synchronizing circuit 31 An address generation block for generating an address to the block 32, a request generation block for generating a memory access request signal for the memory interface block 32, and a write data 35 written by the CPU 1 and a memory read read from the memory 2 12 bytes for storing data A data FIFO.
[0028]
FIG. 2 is a block diagram of the address generation block 33. A lower address register 331 temporarily stores a lower address to the memory 2 written from the CPU 1, and a reference numeral 332 denotes a lower address register to the memory 2 written from the CPU 1. An upper address register for temporarily storing the upper address, a lower address counter 333 for generating a lower address of the memory access address output to the memory interface block 32, and a higher address of the memory access address output to the memory interface block 32 This is an upper address counter to be generated. The upper address register 332, the lower address register 331, and the data FIFO 35 are mapped in the address space of the CPU 1.
[0029]
FIG. 3 shows a flowchart of generating a memory access address signal starting from when the CPU 1 sets a lower address for the memory 2 in the lower address register 331.
[0030]
A read access from the CPU 1 to the memory 2 will be described. After setting the upper address to the memory 2 in the upper address register 332, the CPU 1 sets the lower address to the memory 2 in the lower address register 331. As shown in processing 1 of FIG. 3, when write data that has not been written to the memory 2 when an address is set in the lower address register 331 from the CPU 1 has, for example, 4 bytes in the data FIFO 35, the request generation block 34 When the memory access request signal is enabled for the memory write to the memory interface block 32 and the memory access is permitted after the access arbitration by the memory interface block 32, the lower address counter 333 and the upper After transferring the memory address from the address counter 334 and the 4-byte memory write data from the data FIFO 35, the values stored in the upper address register 332 and the lower address register 331 are transferred to the upper address counter 33. , Respectively loaded into the lower address counter 333, a request generation block 34 to enable the memory access request signal for memory read.
[0031]
If the write data to the memory 2 is not stored in the data FIFO 35 when the address is set from the CPU 1 to the lower address register 331, the value stored in the upper address register 332 and the lower address register 331 is changed to the upper address. The request generation block 34 loads the counter 334 and the lower address counter 333, respectively, and makes the memory access request signal valid for the memory interface block 32 for the memory read. The memory interface block 32 arbitrates the memory read request signal from the request generation block 34 according to the priority order, and then makes the memory read permission signal valid for the request generation block 34. When the memory access is permitted, the upper address counter 334 and the lower address counter 333 output the memory read address to the memory interface block 32. The memory interface block 32 performs 8-byte memory read access to the memory 2 based on the received memory read address. The 8-byte read data read from the memory 2 is transferred to the data FIFO 35 by the memory interface block 32 and stored in the data FIFO 35. When the CPU 1 reads the memory read data, the data FIFO 35 is mapped in the address space of the CPU 1. Therefore, if the CPU 1 issues a read command to the address space of the CPU 1 corresponding to the data FIFO 35, the data is stored in the data FIFO 35. The memory read data can be read from the memory control device 3 every two bytes. The CPU 1 reads out the data stored in the data FIFO 35 to determine that the memory access of the CPU 1 is a memory read. Therefore, the upper address counter 334 and the lower address counter 333 count the access address by 8 bytes. Up to prepare a memory read address for the next memory read access.
[0032]
Also, in FIG. 3, a read access from the CPU 1 to the data FIFO 35 following the process 1 is shown as a process 2. When the CPU 1 reads the data from the memory control device 3 and the read data stored in the data FIFO 35 is read, and the free space of 8 bytes or more is generated in the data FIFO 35, the request generation block 34 A memory access request signal is enabled for the memory interface block 32 for a memory read. When memory access is permitted by the memory interface block 32, the upper address counter 334 and the lower address counter 333 transfer the address to the memory interface block 32, count up by 8 bytes, and perform the next memory read access. Prepare a memory read address for As shown in the present embodiment, by pre-reading data stored in the memory, read access from the CPU 1 to the memory 2 can be performed at high speed.
[0033]
In the present embodiment, the upper address counter 334 and the lower address counter 333 are incremented by 8 bytes for the next memory read access, but decremented by 8 bytes for the next memory read access. Is also good.
[0034]
The number of bytes read from the data FIFO 35 by the CPU 1 at a time, the number of bytes of the data FIFO 35, the number of bytes that the memory interface block 32 accesses the memory 2 at a time, and the like may be different from those in the present embodiment.
[0035]
(Embodiment 2)
Embodiments of the present invention described in claims 1, 2, and 3 of the present invention will be described with reference to FIGS. 1, 2, and 4. FIG. FIG. 4 is a block diagram of the request generation block 34. Reference numeral 341 denotes an access direction register for storing whether the last access to the memory by the CPU 1 is the memory read direction or the write direction, and 342 generates a memory access request signal to be output to the memory interface block 32. , REQ generation circuit.
[0036]
When the CPU 1 writes or reads the data FIFO 35, information indicating whether the CPU 1 has read or written is stored in the access direction register 341. When the information stored in the access direction register 341 is in the memory read direction, the same operation as in the first embodiment is performed, and therefore the description is omitted. The information stored in the access direction register 341 is stored in the memory write direction. An operation at a certain time, that is, when the previous access to the memory 2 from the CPU 1 is a memory write will be described below.
[0037]
At the time of a memory read access from the CPU 1 to the memory 2, the CPU 1 sets an upper address to the memory 2 in the upper address register 332, and then sets a lower address to the memory 2 in the lower address register 331. When an address is set in the lower address register 331, if there are, for example, 2 bytes of write data not yet written in the memory 2 in the data FIFO 35, the REQ generation circuit 342 sends a memory write to the memory interface block 32. When the memory access request signal is enabled for the memory interface block 32 and the memory access is permitted after the access arbitration by the memory interface block 32, the data FIFO 35, the upper address counter 334, and the lower address counter The byte memory write data and the memory read address are transferred to the memory interface block 32, and the values stored in the upper address register 332 and the lower address register 331 are transferred to the upper address counter. 34, respectively loaded into the lower address counter 333.
[0038]
When the address is set in the lower address register 331 and the write data to the memory 2 is not stored in the data FIFO 35, the values of the upper address register 332 and the lower address register 331 are respectively stored in the upper address counter 334 and the lower address register 334. Load the address counter 333. Next, when a read access from the CPU 1 to the data FIFO 35 occurs, the REQ generation circuit 342 enables a memory access request signal for memory read to the memory interface block 32, and when the access is permitted, the upper address register 332. , The memory address is transferred from the lower address register 331 to the memory interface block 32. The memory interface block 32 reads out a total of 8 bytes of data stored in the transferred memory address and consecutive addresses from the memory 2 and transfers the data to the data FIFO 35. Of the memory read data stored in the data FIFO 35, the 2-byte memory read data is read out by the CPU 1, and at the same time, the access direction register 341 stores the read access direction as the access direction of the CPU 1. The subsequent operation is similar to that of the first embodiment. When an empty area of 8 bytes or more is generated in the data FIFO 35 by reading the data FIFO 35 from the CPU 1, the REQ generation circuit 342 sends the memory interface block 32 to the memory interface block 32. Enables a memory access request signal for read access. As shown in the present embodiment, in a system in which the access direction (read or write) from the CPU 1 is continuous, there is a high possibility that the next memory access following the memory write access is a write access. By disabling the data prefetch function, useless memory read access from the CPU 1 can be reduced.
[0039]
(Embodiment 3)
Embodiments of the present invention described in claims 1, 7, 9, 10, and 11 of the present invention will be described with reference to FIGS.
The data FIFO 35 is mapped to two address spaces of the CPU 1.
One address is a burst access address, and the other address is a random access address. When data is stored at consecutive addresses from the CPU 1 to the memory 2, when the CPU 1 writes data to the burst access address, the write data is stored in the data FIFO 35. When eight bytes of data are stored in the data FIFO 35 by issuing a write instruction four times from the CPU 1 to the burst access address, the request generation block 34 sends the memory interface block 32 a memory write request. Enable the memory access request signal. When the arbitration of the memory access is performed in the memory interface block 32 and the memory access is permitted, the data FIFO 35 sequentially outputs the stored 8-byte data to the memory interface block 32. The memory interface block 32 writes the received write data to the memory 2. When writing the last byte of continuous data or when writing to a non-consecutive address, the CPU 1 issues a write instruction to a random access address. When the CPU 1 issues a write command to a random access address, the request generation block 34 sends a memory access request signal to the memory interface block 32 for memory write, regardless of the number of bytes stored in the data FIFO 35. Enable. When the arbitration of the memory access is performed in the memory interface block 32 and the memory access is permitted, the data FIFO 35 transfers the data stored in the data FIFO 35 including the data written by the CPU 1 to the random access address. 32. The memory interface block 32 writes the received write data to a location indicated by the memory address transferred from the address generation block 33 of the memory 2.
[0040]
(Embodiment 4)
Embodiments of the present invention described in claims 1, 7, 9, 10, 12, and 13 of the present invention will be described with reference to FIGS.
[0041]
FIG. 5 is a block diagram of the request generation block 34. Reference numeral 342 denotes an REQ generation circuit that generates a memory access request signal to be output to the memory interface block 32. Reference numeral 343 denotes a write access timer that is cleared when the CPU 1 writes data to the data FIFO 35 and counts up at regular intervals. is there.
[0042]
The data FIFO 35 is mapped to two locations in the address space of the CPU 1. One address is a burst access address, and the other address is a random access address. When storing data at consecutive addresses from the CPU 1 to the memory 2, the CPU 1 writes data to the burst access address, and the write data is stored in the data FIFO 35. When write data corresponding to a memory address in which all lower 3 bits of the address are 1 is stored in the data FIFO 35, the request generation block 34 sends a memory access request to the memory interface block 32 for memory write access. Enable the signal. After arbitration, the memory interface block 32 permits access, receives a memory access address from the address generation block 33, receives a memory write data from the data FIFO 35, and gives the memory 2 a memory address whose lower 3 bits of the address are 0. Starts 8-byte access. At this time, when the lower 3 bits of the access start address are not 0 at the start of the burst access or at the time of random access, the memory 2 is accessed from the address where the lower 3 bits of the address are 0. It should be noted that only the target data is stored in the memory 2 by masking the write command to the memory 2 except for the address where the data should be written.
[0043]
When the CPU 1 writes the write data to the data FIFO 35, the write access timer 343 is cleared to 0, and starts counting up. When the data written to the data FIFO 35 is not written to the memory 2 even though the write access timer 343 has counted up to a predetermined value, the REQ generation circuit 342 sends a memory access request signal to the memory interface block 32. Validate and write the data stored in the data FIFO 35 to the memory 2.
[0044]
Note that the number of bytes written to the data FIFO 35 by the CPU 1 at a time, the number of bytes of the data FIFO 35, the number of bits of an address used to determine when the memory access request signal is valid, and the like may be different from those in the present embodiment.
[0045]
(Embodiment 5)
An embodiment of the invention described in claim 15 of the present invention will be described with reference to FIG. 1 is a CPU, 2 is a memory for storing data, 3 is a memory control device for controlling access from the CPU 1 to the memory, 31 is a synchronization circuit for synchronizing a signal input from the CPU 1 with an internal system clock, 32 is A memory interface block for generating a control signal for the memory 2; 33, an address generation block for generating an address to the memory interface block 32 based on an address set by the CPU 1 via the synchronization circuit 31; A request generation block 35 for generating a memory access request signal for the CPU. Reference numeral 35 denotes a 12-byte data FIFO for storing write data written by the CPU 1 and memory read data read from the memory 2. F FO35 has been mapped to the CPU1 of the address space. Reference numeral 36 denotes a wait generation circuit that generates a wait signal for the CPU 1. A write access from the CPU 1 to the memory 2 will be described. The CPU 1 sets an address to the memory 2 in the memory generation block 33.
[0046]
Next, the CPU 1 writes the write data to the memory 2 to the data FIFO 35.
When the 8-byte write data is stored in the data FIFO 35, the request generation block 34 validates a memory access request signal for a memory write access to the memory interface block 32. When the memory access is permitted after the arbitration by the memory interface block 32, the address generation block 33 and the data FIFO 35 transfer the address to the memory 2 and the 8-byte write data to the memory interface block 32, and the memory interface block 32 Write 8 bytes of data to Between the time when the request generation block 34 validates the memory access request signal and the time when the memory access is permitted, an area for storing data in the data FIFO 35 is generated by a continuous write instruction from the CPU 1 to the data FIFO 35. When the CPU 1 runs out, the wait generation circuit 36 validates the wait signal in response to the CPU 1 writing a command to the data FIFO 35. When the memory access is permitted by the memory interface block 32, the write data to the memory 2 can be transferred from the data FIFO 35 to the memory interface block 32, so that the storage area of the data FIFO 35 becomes free. When there is free space in the storage area of the data FIFO 35, the wait generation circuit 36 invalidates the wait signal for the CPU 1. When the wait signal becomes invalid, the CPU 1 completes the write operation to the data FIFO 35.
[0047]
【The invention's effect】
As described above, according to the present invention, the speed of memory read access from the signal processing means is increased, and the number of bus signals between the signal processing means and the memory control device is reduced, thereby achieving low-cost memory control. Equipment can be provided.
[Brief description of the drawings]
FIG. 1 is a block diagram of a memory control device according to Embodiments 1 to 4 of the present invention.
FIG. 2 is a block diagram of an address generation block according to the first to third embodiments of the present invention.
FIG. 3 is a flowchart at the time of memory reading according to the first embodiment of the present invention;
FIG. 4 is a block diagram of a request generation block according to Embodiment 2 of the present invention.
FIG. 5 is a block diagram of a request generation block according to a fourth embodiment of the present invention.
FIG. 6 is a block diagram of a memory control device according to a fifth embodiment of the present invention.
[Explanation of symbols]
1 CPU
2 memory
3 Memory controller
31 Synchronization circuit
32 memory interface
33 address generation block
34 Request generation block
35 Data FIFO
36 weight generation circuit
331 Lower address register
332 upper address register
333 Lower address counter
334 upper address counter
341 Access Direction Register
342 REQ generation circuit
343 Write Access Timer

Claims (15)

CPUとメモリとの間のアクセスを制御するメモリ制御装置において、前記CPUが所定のメモリアドレスを書き込むアドレス格納手段と、前記メモリから読み出されたデータを格納するリードデータ格納手段と、前記メモリとのアクセス信号を生成するメモリインタフェース手段と、前記CPUが前記メモリインタフェース手段に対するメモリアクセス要求信号を生成するメモリアクセス要求手段とを備え、前記メモリアクセス要求手段は、前記アドレス格納手段にメモリアドレスが書き込まれると、前記メモリインタフェース手段にメモリリードアクセス要求を行うことを特徴とするメモリ制御装置。In a memory control device for controlling access between a CPU and a memory, an address storage means for writing a predetermined memory address by the CPU, a read data storage means for storing data read from the memory, Memory access means for generating a memory access request signal for the memory interface means, wherein the memory access request means writes a memory address to the address storage means. A memory read access request to the memory interface means. 前記メモリアドレスの最下位バイトが前記CPUから前記アドレス格納手段に書き込まれた時、前記メモリアクセス要求手段が、前記メモリインタフェース手段にメモリリードアクセス要求を行うことを特徴とする請求項1記載のメモリ制御装置。2. The memory according to claim 1, wherein when the least significant byte of the memory address is written from the CPU to the address storage unit, the memory access request unit issues a memory read access request to the memory interface unit. Control device. 前記CPUからの前記メモリへのアクセスの一つ前のアクセスがメモリリードアクセスである場合のみ、前記CPUが前記アドレス格納手段にアドレスを書き込むことにより、前記メモリアクセス要求手段は、前記メモリインタフェース手段にメモリリードアクセス要求を行うことを特徴とする、請求項1記載のメモリ制御装置。Only when the access before the access to the memory from the CPU is a memory read access, the CPU writes the address in the address storage means, so that the memory access requesting means is transmitted to the memory interface means. 2. The memory control device according to claim 1, wherein a memory read access request is issued. 前記アドレス格納手段は、前記CPUにより前記メモリに対するアドレスが書き込まれ、前記メモリインタフェース手段が前記メモリからデータを読み出す毎に、前記アドレス格納手段のメモリアドレスに所定の値を加算することを特徴とする、請求項1記載のメモリ制御装置。The address storage means is characterized in that an address for the memory is written by the CPU, and a predetermined value is added to a memory address of the address storage means each time the memory interface means reads data from the memory. The memory control device according to claim 1. 前記アドレス格納手段は、前記メモリに対するアドレスが前記CPUにより書き込まれ、前記メモリインタフェース手段が前記メモリからデータを読み出す毎に、前記アドレス格納手段のメモリアドレスに所定の値を減算することを特徴とする、請求項1記載のメモリ制御装置。The address storage means subtracts a predetermined value from the memory address of the address storage means each time an address for the memory is written by the CPU and the memory interface means reads data from the memory. The memory control device according to claim 1. 前記リードデータ格納手段は、1バイト以上のFIFOから構成され、前記CPUからのメモリリード後に前記FIFO内にリードデータを格納する為の空き領域が生じた時は、前記メモリアクセス要求手段が、前記メモリインタフェース手段にメモリリードアクセス要求を行うことを特徴とする請求項1記載のメモリ制御装置。The read data storage means is composed of a FIFO of 1 byte or more. When there is a free area for storing read data in the FIFO after memory read from the CPU, the memory access request means sets 2. The memory control device according to claim 1, wherein a memory read access request is issued to the memory interface means. 前記CPUが書き込んだデータを格納するライトデータ格納手段を備え、前記CPUが前記ライトデータ格納手段にライトデータを書き込み、ライトデータ格納手段に格納されたデータが、所定のライトアクセス条件を満たす時、前記メモリアクセス要求手段が、前記メモリインタフェース手段に対してメモリライトアクセス要求を行うことを特徴とする、請求項1記載のメモリ制御装置。A write data storage unit for storing the data written by the CPU, wherein the CPU writes the write data to the write data storage unit, and when the data stored in the write data storage unit satisfies a predetermined write access condition, 2. The memory control device according to claim 1, wherein the memory access request unit issues a memory write access request to the memory interface unit. 前記リードデータ格納手段は、前記ライトデータ格納手段を兼用していることを特徴とする、請求項7記載のメモリ制御装置。8. The memory control device according to claim 7, wherein said read data storage means also serves as said write data storage means. 前記ライトデータ格納手段は、バーストライトデータ格納手段とランダムライトデータ格納手段を備え、前記メモリアクセス要求手段は、前記CPUが前記バーストライトデータ格納手段にデータをライトした時、前記ライトアクセス条件を満たした場合にメモリライトアクセス要求を行い、前記CPUが前記ランダムライトデータ格納手段にデータをライトした場合は、即座にメモリライトアクセス要求を行なうことを特徴とする、請求項7記載のメモリ制御装置。The write data storage unit includes a burst write data storage unit and a random write data storage unit, and the memory access request unit satisfies the write access condition when the CPU writes data to the burst write data storage unit. 8. The memory control device according to claim 7, wherein a memory write access request is made when the data is written to the random write data storage means, and the memory write access request is made immediately when the CPU writes data to the random write data storage means. 前記バーストライトデータ格納手段は、前記ランダムライトデータ格納手段を兼用していることを特徴とする請求項9記載のメモリ制御装置。10. The memory control device according to claim 9, wherein said burst write data storage means also serves as said random write data storage means. 前記ライトアクセス条件は、所定のバイト数のライトデータを前記ライトデータ格納手段に格納完了時であることを特徴とする、請求項7、請求項9または請求項10記載のメモリ制御装置。11. The memory control device according to claim 7, wherein the write access condition is when storage of a predetermined number of bytes of write data in the write data storage unit is completed. 前記ライトアクセス条件は、2のN乗(Nは所定の値の自然数)から1を引いた値のメモリアドレスにライトすべきライトデータを前記ライトデータ格納手段に格納完了時でであることを特徴とする、請求項7、請求項9または請求項10記載のメモリ制御装置。The write access condition is when write data to be written to a memory address having a value obtained by subtracting 1 from 2 N (N is a natural number of a predetermined value) is completely stored in the write data storage means. The memory controller according to claim 7, 9 or 10, wherein 前記ライトアクセス条件は、前記CPUのメモリライトアクセスとその一つ前のメモリライトアクセスとの経過時間を計測する経過時間計測手段を備え、所定の時間内に前記CPUからのメモリアクセスが発生しない場合とすることを特徴とする、請求項7、請求項9または請求項10記載のメモリ制御装置。The write access condition includes an elapsed time measuring means for measuring an elapsed time between a memory write access of the CPU and a memory write access immediately before the CPU, and a memory access from the CPU does not occur within a predetermined time. The memory control device according to claim 7, wherein: 前記アドレス格納手段は、メモリアドレス発生手段と設定アドレス保持手段を備え、前記CPUから前記設定アドレス保持手段にメモリアドレスが設定された時、前記ライトデータ格納手段にライトデータが格納されている場合は、前記メモリアクセス要求手段が前記メモリインタフェース手段に対してメモリライトアクセス要求を行うことを特徴とする、請求項7、請求項9または請求項10記載のメモリ制御装置。The address storage unit includes a memory address generation unit and a setting address holding unit. When a memory address is set in the setting address holding unit from the CPU, when write data is stored in the write data storage unit, 11. The memory control device according to claim 7, wherein the memory access request unit issues a memory write access request to the memory interface unit. 前記CPUに対して、ウェイト信号を出力するウェイト信号生成手段を備え、前記CPUからの前記アドレス格納手段に対するメモリアドレスを設定した時に前記メモリへのライトデータが前記ライトデータ格納手段に格納されている場合、または前記CPUからの前記ライトデータ格納手段に対するデータ書き込みを行なった時に前記ライトデータ格納手段にライトデータを格納する空間がない場合に前記ウェイト信号生成手段は前記CPUに対してウェイト信号を生成することを特徴とする、請求項7、請求項9または請求項10記載のメモリ制御装置。Wait signal generating means for outputting a wait signal to the CPU, wherein when a memory address from the CPU to the address storage means is set, write data to the memory is stored in the write data storage means. In the case where the write data is written from the CPU to the write data storage means and the write data storage means has no space for storing the write data, the wait signal generation means generates a wait signal to the CPU. The memory control device according to claim 7, wherein the memory control device performs the operation.
JP2003009450A 2003-01-17 2003-01-17 Memory control device Pending JP2004220486A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003009450A JP2004220486A (en) 2003-01-17 2003-01-17 Memory control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003009450A JP2004220486A (en) 2003-01-17 2003-01-17 Memory control device

Publications (1)

Publication Number Publication Date
JP2004220486A true JP2004220486A (en) 2004-08-05

Family

ID=32898946

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003009450A Pending JP2004220486A (en) 2003-01-17 2003-01-17 Memory control device

Country Status (1)

Country Link
JP (1) JP2004220486A (en)

Similar Documents

Publication Publication Date Title
US20040107265A1 (en) Shared memory data transfer apparatus
US7581054B2 (en) Data processing system
KR100768049B1 (en) Bus control system for integrated circuit device with improved bus access efficiency
JP3976927B2 (en) Bus control device
JP3444154B2 (en) Memory access control circuit
JP3803196B2 (en) Information processing apparatus, information processing method, and recording medium
JP2000215149A (en) Controller for composite device
JPH0556548B2 (en)
JP3824122B2 (en) DMA device
JPH0830546A (en) Bus controller
US6938118B1 (en) Controlling access to a primary memory
JP7468112B2 (en) INTERFACE CIRCUIT AND METHOD FOR CONTROLLING INTERFACE CIRCUIT - Patent application
JP2002024156A (en) Dma controller and transfer method therefor
JP2004220486A (en) Memory control device
JP2000215154A (en) Dma controller
JPH06250970A (en) Memory controller
JP3206656B2 (en) Prefetch device and prefetch method on bus
JP2594611B2 (en) DMA transfer control device
JP3270149B2 (en) Data transfer device
JP2001229074A (en) Memory controller and information processor and memory control chip
JP3669616B2 (en) Microcomputer and data processing system
JP2003085125A (en) Memory controller and memory control method
JP2806405B2 (en) Microprocessor
JP2001188749A (en) Bus controller
JP2966038B2 (en) Digital data processing unit arbitration apparatus and method