JP3614946B2 - Memory buffer device - Google Patents

Memory buffer device Download PDF

Info

Publication number
JP3614946B2
JP3614946B2 JP23765495A JP23765495A JP3614946B2 JP 3614946 B2 JP3614946 B2 JP 3614946B2 JP 23765495 A JP23765495 A JP 23765495A JP 23765495 A JP23765495 A JP 23765495A JP 3614946 B2 JP3614946 B2 JP 3614946B2
Authority
JP
Japan
Prior art keywords
data
memory
buffer
store
address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP23765495A
Other languages
Japanese (ja)
Other versions
JPH0962571A (en
Inventor
淳 河井
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Electric Industry 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 Oki Electric Industry Co Ltd filed Critical Oki Electric Industry Co Ltd
Priority to JP23765495A priority Critical patent/JP3614946B2/en
Publication of JPH0962571A publication Critical patent/JPH0962571A/en
Application granted granted Critical
Publication of JP3614946B2 publication Critical patent/JP3614946B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Memory System (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、計算機におけるメモリ読み出し、およびメモリ書き込みのためのメモリバッファ装置に関する。
【0002】
【従来の技術】
既存技術による計算機では、メモリ操作は基本的に1語、半語、あるいは1/4 語単位で任意のメモリアドレスに対してデータ読み出し(ロード命令実行)、およびデータ書き込み(ストア命令実行)を行う。このため、小規模の計算機では1語のメモリレジスタを設置し、ロード命令実行ではメモリ装置から読み出したデータをこのレジスタに格納し、CPU(中央処理装置)はこれを内部に取り込み、また、ストア命令実行では書き込むべきデータを一旦レジスタに格納し、これをメモリ装置に書き込んでいる。
このため、ロード命令実行では、CPUの要求毎にメモリアクセス時間が命令実行時間にそのまま反映され、ストア命令実行では、CPUからレジスタに書き込みデータを格納するまでの時間が命令実行時間に反映される。但し、ストア命令実行直後にロード命令、あるいはストア命令を実行する場合には、前のストア命令実行に伴うメモリ書き込み時間の間、次のメモリ操作は待たされる。
【0003】
大規模の計算機ではキャッシュメモリを設置し、これを介在させてロード命令実行、およびストア命令実行を行う。これによりCPUはキャッシュメモリとの間で1語単位のデータ授受を行ない、また、メモリ装置はキャッシュメモリとの間で連続するメモリアドレスに配置される複数語のデータ(以下データブロックと称す)授受を行う。これにより、ロード命令で要求されるデータがキャッシュメモリに存在する場合(以下ロードキャッシュヒットと称す)には、キャッシュメモリからの高速なデータ応答により短時間でロード命令が完了し、また、ストア命令では書き込むべきデータを含むデータブロックがキャッシュメモリに存在する場合(以下ストアキャッシュヒットと称す)には、キャッシュメモリへのデータ書き込みのみ実行することでストア命令を完了させることが可能である。
【0004】
ロード命令実行においてロードキャッシュヒットでない場合(以下ロードキャッシュミスと称す)、あるいはストア命令実行においてストアキャッシュヒットでない場合(以下ストアキャッシュミスと称す)には小規模の計算機と同様にメモリ装置のアクセス時間が命令実行時間、あるいは直後のメモリ操作に反映される。
【0005】
【発明が解決しようとする課題】
上記のように、従来技術による計算機におけるメモリ操作では、小規模の計算機ではロード命令毎にメモリ装置のアクセス時間が命令実行時間に直接反映され、また、ストア命令実行に伴うメモリ書き込み動作のためにこれに連続するロード命令、あるいはストア命令の実行は待たされてしまうため、メモリ操作命令の実行時間による性能低下の問題が大きい。かつ、1語単位のメモリ操作であるためDRAMデバイスに用意される高速ページアクセス等の連続語に渡るメモリ操作によるメモリスループットの向上は活かされない。
特に、最近の高動作周波数のCPUではCPU内部のみで実行される命令実行時間と、メモリ操作命令の実行時間の差が大きくなる傾向で、このことがCPU動作周波数の向上にもかかわらずプログラム実行性能が延びない原因となっている。
【0006】
一方、大規模の計算機ではキャッシュメモリを設置することにより上記CPU動作とメモリ動作のギャップを埋めているが、キャッシュメモリをCPUと同一のLSIに内蔵することによるチップサイズ、チップコスト、および消費電力の増大、あるいはキャッシュメモリをCPU−LSI外部に設置することによる装置コスト、装置容積、および消費電力の増大が問題となっている。
更に、CPU動作周波数の向上に伴い、キャッシュメモリのアクセス時間がこれに追従できず、キャッシュメモリを設置しながらもメモリ操作命令実行のためのクロックサイクル数の増大を招いている。
【0007】
このような点から、ローコスト化および消費電力の低減化が図れ、かつ、プログラム実行性能を向上させることのできるメモリバッファ装置を実現することが望まれていた。
【0008】
【課題を解決するための手段】
第1発明のメモリバッファ装置は、前述の課題を解決するために、メモリ装置からデータ読み出しのためのロードバッファ部と、メモリ装置への書き込みのためのストアバッファ部とを備え、ロードバッファ部は、一メモリブロック分のデータを格納するための複数語の独立に読み書き可能なレジスタを有するロードデータバッファ部と、中央処理装置からのメモリ装置へのデータ読み出し要求に対して、レジスタ内のいずれかに該当データが存在する場合は、これを中央処理装置に返送し、どのレジスタにも該当データが存在しない場合は、メモリ装置より、読み出し要求のデータのメモリアドレスから連続して同一メモリブロックの最終アドレスまでのデータを読み出して、これらを順次、レジスタに格納するロードバッファ制御部とからなり、ストアバッファ部は、一メモリブロック分のデータとして複数語を格納する先入れ先出しバッファを備えたストアデータバッファ部と、中央処理装置からのメモリ装置への書き込み要求に対して、先入れ先出しバッファ内に、該当データが存在する場合はこれを更新すると共に、格納位置を最後尾とし、該当データの同一メモリブロックのデータが存在する場合は、該当データを最後尾に格納し、先入れ先出しバッファ内のデータが、該当データのメモリブロックとは異なるメモリブロックであった場合は、先入れ先出しバッファに格納されているデータを全てメモリ装置に書き込むと共に、該当データを先入れ先出しバッファの先頭位置に格納するストアバッファ制御部とからなることを特徴とするものである。
【0009】
第1発明のメモリバッファ装置がこのように構成されていることにより、ロードバッファ部は、中央処理装置からのメモリ装置へのデータ読み出し要求に対して、レジスタ内のいずれかに該当データが存在する場合は、これを中央処理装置に返送する。一方、どのレジスタにも該当するデータが存在しない場合は、メモリ装置より、読み出し要求のデータのメモリアドレスから連続して同一メモリブロックの最終アドレスまでのデータを読み出して、これらを順次、レジスタに格納する。
また、ストアバッファ部は、中央処理装置からのメモリ装置への書き込み要求に対して、先入れ先出しバッファ内に、該当データが存在する場合はこれを更新すると共に、格納位置を最後尾とする。
書き込み要求のデータの同一メモリブロックのデータが、先入れ先出しバッファ内に存在する場合は、該当データをその最後尾に格納する。
一方、先入れ先出しバッファ内のデータが、該当データのメモリブロックとは異なるメモリブロックであった場合は、先入れ先出しバッファに格納されているデータを全てメモリ装置に書き込むと共に、その該当データを先入れ先出しバッファの先頭位置に格納する。
【0010】
第2発明のメモリバッファ装置は、前述の課題を解決するために、メモリ装置からデータ読み出しのためのロードバッファ部と、メモリ装置への書き込みのためのストアバッファ部とを備え、ロードバッファ部は、一メモリブロック分のデータを格納するための複数語の独立に読み書き可能なレジスタを有するロードデータバッファ部と、中央処理装置からのメモリ装置へのデータ読み出し要求に対して、レジスタ内のいずれかに該当データが存在する場合は、これを中央処理装置に返送し、どのレジスタにも該当データが存在しない場合は、メモリ装置より、読み出し要求のデータのメモリアドレスを含む同一メモリブロック全体のデータを読み出して、これらを順次、レジスタに格納するロードバッファ制御部とからなり、ストアバッファ部は、一メモリブロック分のデータとして複数語を格納する先入れ先出しバッファを備えたストアデータバッファ部と、中央処理装置からのメモリ装置への書き込み要求に対して、先入れ先出しバッファ内に、該当データが存在する場合はこれを更新すると共に、格納位置を最後尾とし、該当データの同一メモリブロックのデータが存在する場合は、該当データを最後尾に格納し、先入れ先出しバッファ内のデータが、該当データのメモリブロックとは異なるメモリブロックであった場合は、先入れ先出しバッファに格納されているデータを全てメモリ装置に書き込むと共に、該当データを先入れ先出しバッファの先頭位置に格納するストアバッファ制御部とからなることを特徴とするものである。
【0011】
第2発明のメモリバッファ装置がこのように構成されていることにより、ロードバッファ部は、中央処理装置からのメモリ装置へのデータ読み出し要求に対して、レジスタ内のいずれかに該当データが存在する場合は、これを中央処理装置に返送する。一方、どのレジスタにも該当するデータが存在しない場合は、メモリ装置より、読み出し要求のデータのメモリアドレスを含む同一メモリブロック全体のデータを読み出して、これらを順次、レジスタに格納する。
また、ストアバッファ部の動作は、第1発明と同様である。
【0012】
第3発明のメモリバッファ装置は、前述の課題を解決するために、第1または第2発明のメモリバッファ装置において、中央処理装置からのメモリ装置へのデータ書き込み要求に対して、該当データが、ロードデータバッファ部内のレジスタのいずれかに存在する場合は、このデータを更新するロードバッファ制御部を備えたことを特徴とするものである。
【0013】
第3発明がこのように構成されていることにより、中央処理装置からのメモリ装置へのデータ書き込み要求があった場合、該当データが、ロードデータバッファ部内のレジスタのいずれかに存在した場合は、その都度、メモリ装置に書き込まず、ロードデータバッファ部内のデータのみを更新する。
【0014】
【発明の実施の形態】
以下、本発明の実施の形態を図面を用いて詳細に説明する。
《実施形態1》
[構成]
図1は本発明のメモリバッファ装置の実施形態1および後述する実施形態2を示す構成図である。
図の装置は、メモリバッファ装置を構成するロードバッファ部100とストアバッファ部200、および中央処理装置(以下、CPUという)300とメモリ装置400を示している。
【0015】
ロードバッファ部100は、主としてCPU300からのロード命令(メモリ読み出し命令)実行時に働き、ストアバッファ部200は、CPU300からのストア命令(メモリ書き込み命令)実行時に働く。
即ち、ロードバッファ部100は、一メモリブロック分のデータを格納するための複数語の独立に読み書き可能なレジスタを有するロードデータバッファ部101と、CPU300からのメモリ読み出し要求に対して、複数のレジスタ内のいずれかに該当データが存在する場合は、これをCPU300に返送し、どのレジスタにも該当データが存在しない場合は、メモリ装置400より、読み出し要求のデータのメモリアドレスから連続して同一メモリブロックの最終アドレスまでのデータを読み出して、これらを順次、レジスタに格納するロードバッファ制御部102とからなる。
【0016】
ロード命令実行時はCPU300からロードバッファ部100に対してリクエスト信号をアサートし(“1”を出力し)、リード/ライト信号をネゲートし(“0”を出力し)、更に所定のメモリアドレスになるようにアドレスを出力する。ロードバッファ部100ではこれに応えて、アクノレッジ信号をアサートすると共に、CPU300の要求するロードデータをCPU300に出力する。ロード命令実行時で、メモリ装置400からデータ読み出しを行う場合にはロードバッファ部100からメモリ装置400に対してメモリリクエストをアサートし、メモリリード/ライト信号をネゲートし、更に所定のメモリアドレスになるようにメモリアドレスを出力する。
メモリ装置400はこれに応えて、メモリアクノレッジ信号をアサートすると共に、ロードバッファ部100の要求するリードデータをロードバッファ部100に出力する。
【0017】
また、ストアバッファ部200は、一メモリブロック分のデータとして複数語を格納する先入れ先出しバッファを備えたストアデータバッファ部201と、CPU300からメモリ装置400への書き込み要求に対して、先入れ先出しバッファ内に、該当データが存在する場合はこれを更新すると共に、格納位置を最後尾とし、該当データの同一メモリブロックのデータが存在する場合は、該当データを最後尾に格納し、先入れ先出しバッファ内のデータが、該当データのメモリブロックとは異なるメモリブロックであった場合は、先入れ先出しバッファに格納されているデータを全てメモリ装置400に書き込むと共に、該当データを先入れ先出しバッファの先頭位置に格納するストアバッファ制御部202とを備えている。
【0018】
ストア命令実行時はCPU300からストアバッファ部200に対してリクエスト信号をアサートし(“1”を出力し)、リード/ライト信号をアサートし(“1”を出力し)、書き込むべきデータ、即ち、ストアデータを出力し、更に所定のメモリアドレスになるようにアドレスを出力する。ストアバッファ部200ではこれに応えて、アクノレッジ信号をアサートしてCPU300に出力する。ストア命令実行時で、メモリにデータ書き込みを行う場合にはストアバッファ部200からメモリ装置400に対してメモリリクエストをアサートし、メモリリード/ライト信号をアサートし、書き込むべきデータとなるようにライトデータを出力し、更に所定のメモリアドレスになるようにメモリアドレスを出力する。メモリ装置400はこれに応えて、メモリアクノレッジ信号をアサートしてロードバッファ部100に出力する。
【0019】
図2は、ロードバッファ部100の構成図である。
ロードバッファ部100は、上記のように、ロードデータバッファ部101と、ロードバッファ制御部102とで構成されている。
ロードデータバッファ部101は、本実施形態1では、4語のデータレジスタ(LB0〜3)、ロードバッファ入力セレクタ101a、およびロードバッファ出力セレクタ101bとで構成されるが、本発明においてはデータ語数は4語に限定されるものではなく、1語以上任意の語数をとることが可能である。
【0020】
実施形態1および実施形態2では、ロードデータバッファ部101は4語のメモリデータを一時的に格納することが可能で、メモリ装置400から読み出した1語のデータ、あるいは連続的に読み出した2〜4語のデータを格納する。CPU300からのロード命令実行時に、これらのデータレジスタLB0〜3内に保存されているデータが、CPU300からのアドレスで指定されるメモリアドレスに格納されているデータのコピーを含む場合には、メモリ装置400からデータ読み出しは行わずに4つのデータレジスタLB0〜3の出力のうち、CPU300で指定されるデータを格納する1つをロードバッファ出力セレクタ101bにて選択し、ロードデータとしてCPU300に出力する。
【0021】
また、ストア命令実行時において、そのストアデータのメモリアドレスと同一のメモリアドレスからデータを読み出し、データレジスタLB0〜3にそのデータを格納してある場合には、データの一致性を保つために新たなストアデータを該当レジスタにも格納する必要がある。本実施形態では、以下これをストアバイパス動作と記す。ロードバッファ入力セレクタ101aは、通常のメモリ装置400からの読み出し時のリードデータとストアバイパス動作時のCPU300からのストアデータとのいずれかを選択してデータレジスタLB0〜3に出力するものである。
【0022】
ロードバッファ制御部102は、CPU300およびメモリ装置400に対する制御信号の入出力を行うと共に、ロードデータバッファ部101の制御を行う機能を有している。ロードバッファ制御部102からロードデータバッファ部101には、ストアバイパス信号、LB0〜3セット、およびロードアドレスオフセット信号が出力される。ストアバイパス信号はロードバッファ入力セレクタ101aへの入力選択信号で“0”のときリードデータを、“1”のときストアデータを選択してLB0〜3に出力する。LB0〜3セット信号はそれぞれデータレジスタLB0〜3へのデータセット信号であり、この信号の立ち上がりエッジで入力データが新たに格納される。CPU300からのアドレスの下位2ビット(以下、スモールアドレスと記す)はロードバッファ出力セレクタ101bへの選択信号となり、LB0〜3の出力のうち1つを選択する。
【0023】
図3は、ロードバッファ制御部102の構成図である。
図4、図5は、それぞれ図3におけるロードデータバッファ有効フラグ部およびLB0〜3セット信号生成部の構成図である。
ロードバッファ制御部102は、CPU300、およびメモリ装置400に対する制御信号の入出力を行うと共に、ロードデータバッファ部101の制御を行うもので、メモリアドレス一致検査部102a、ロードデータバッファ有効フラグ(以下Vフラグと記す)部102b、LB0〜3セット信号生成部102c、およびシーケンス制御部とから構成される。
【0024】
即ち、これらの図に示すロードバッファ制御部102は、アンド回路1〜21、オア回路31〜35、バッファ41〜44、ブロックアドレスバッファ45、オフセットアドレスバッファ46、タグレジスタ51、V0レジスタ(V0)〜V3レジスタ(V3)、メモリリクエストレジスタ52、スモールアドレスセレクタ61、Vフラグセレクタ62、スモールアドレスデコーダ71、オフセットアドレスデコーダ72、スモールアドレスデコーダ73、オフセットアドレスカウンタ81、比較器91を備えている。
【0025】
尚、図3中、A1はアクノレッジ、A2はラージアドレス(ブロックアドレス)、A3はリード/ライト、A4はリクエスト、A5はスモールアドレスを示す。また、B1はメモリブロックアドレス、B2はメモリオフセットアドレス、B3はメモリリクエスト、B4はメモリリード/ライト、B5はメモリビジー、B6はストアバイパス、B7はメモリアクノレッジ、B8〜B11はLB0セット〜LB3セットを示している。
【0026】
メモリアドレス一致検査部102aは、タグレジスタ51および比較器91とで構成される。
タグレジスタ51は、CPU300から入力されるアドレスのうち下位2ビットを除く信号(ラージアドレス)を一時的に格納するレジスタで、ロードデータバッファ部101に格納される1〜4語のデータのメモリ装置400上に配置されているブロックアドレスを保持する。比較器91は、Ex−NOR回路であり、タグレジスタ51に格納されるラージアドレス(ブロックアドレス)と、CPU300から入力されるアドレスのうち下位2ビットを除く値を比較し、両者が一致するか否かを検査する。つまり、ロード命令、あるいはストア命令実行時にCPU300から入力されるブロックアドレスに配置されるデータの一部あるいは全部(4語)のコピーがロードデータバッファ部101に格納されているか否かを検査するものである。以下、上記検査結果が一致する場合をロードデータバッファヒット、そうでない場合をロードデータバッファミスと記す。
【0027】
Vフラグ部102bは、図4に示すように、V0〜3レジスタ(V0〜3)、スモールアドレスセレクタ61、スモールアドレスデコーダ71、アンド回路3〜6、およびVフラグセレクタ62とで構成される。
V0〜3レジスタ(V0〜V3)は、ロードデータバッファ部101のLB0〜3に格納されるメモリデータのコピーのうち、その内容が有効であるか否かをそれぞれ示すためのV0〜3フラグを格納する部分で、ロードデータヒット時にCPU300から入力されるアドレスの下位2ビット(以下スモールアドレスと記す)で指定されるデータレジスタ、即ち、LB0〜3のうちのいずれか1つに対して該当するVフラグが“1”である場合にはそのデータレジスタの内容が有効であることを示すものである。
【0028】
一方、該当するVフラグが“0”である場合には、ロードデータヒット時であってもCPU300の要求するデータはデータレジスタLB0〜3には格納されておらず、メモリ装置400にアクセスを行い、データを読み出す必要がある。スモールアドレスセレクタ61は、V0〜3レジスタV0〜V3のうち、Vフラグをセットすべきレジスタを選択するための2ビットの選択信号を選択するもので、メモリ装置400から読み出したデータを、データレジスタLB0〜3に格納する時には、オフセットアドレスカウンタ81(シーケンス制御部)の出力を選択し、また、前記ストアバイパス動作時にはCPU300から入力されるスモールアドレスを選択する。スモールアドレスデコーダ71は、スモールアドレスセレクタ61の出力をデコードする。アンド回路3〜6は、スモールアドレスデコーダ71の出力(4出力のうち1つが“1”となる)とシーケンス制御部のオア回路31の出力(後述)との論理積をそれぞれとるもので、これらの出力はV0〜3レジスタV0〜V3のセット入力にそれぞれ接続される。
【0029】
オア回路31出力がアサートされた時点でアンド回路3〜6のうちのいずれか1出力が“1”となり、この信号の立ち上がり時に該当するV0〜3レジスタV0〜V3のうち1つが“1”にセットされる。V0〜3レジスタV0〜V3の前記以外の3つはそれ以前の内容を保存する。V0〜3レジスタV0〜V3のリセット入力はシーケンス制御部のアンド回路9の出力(メモリリクエストレジスタ52のセット入力:後述)に接続され、このアンド回路9の出力がアサートされた立ち上がり時点でV0〜3の内容は全て“0”となる。
Vフラグセレクタ62は、V0〜3レジスタV0〜V3の4つの出力のうち1つを選択して出力するもので、CPU300から入力されるスモールアドレスを選択信号とする。前記ロードバッファヒット時に、このVフラグセレクタ63の出力が“1”の場合にはCPU300がロード命令で要求するメモリデータのコピーが該当するロードデータバッファ部101に格納されていることを示す。
【0030】
LB0〜3セット信号生成部102cは、図5に示すように、オフセットアドレスデコーダ72、スモールアドレスデコーダ73、アンド回路14〜21、およびオア回路32〜35とで構成され、ロードデータバッファLB0〜3へのデータセット信号を生成するものである。
【0031】
オフセットアドレスデコーダ72は、シーケンス制御部のオフセットアドレスカウンタ81の2ビットの出力をデコードするものである。尚、オフセットアドレスカウンタ81はメモリ装置400に対して読み出しを行う時のメモリアドレスの下位2ビットとなるもので、実際にメモリ装置400からデータを読み出すメモリブロック内の位置(以下、これをメモリオフセットと記す)を示す。
【0032】
アンド回路14〜17は、オフセットアドレスデコーダ72の出力(4つの出力のうちいずれか1出力が“1”となる)と、シーケンス制御部のアンド回路11(後述)出力との論理積をそれぞれとるもので、メモリ装置400から読み出したリードデータをデータレジスタLB0〜3の該当レジスタに格納するためのセット信号を生成する。
【0033】
スモールアドレスデコーダ73は、CPU300から入力される2ビットのスモールアドレスをデコードするもので、ストアバイパス動作時のメモリブロック内のデータ書き込み位置(メモリオフセット)に相当するデータレジスタLB0〜3のうちの1つを選択するものである。
【0034】
アンド回路18〜21は、スモールアドレスデコーダ73の出力(4つの出力のうちいずれか1出力が“1”となる)と、シーケンス制御部のアンド回路13(後述)出力との論理積をそれぞれとるもので、ストアバイパス動作時にCPU300から入力されるストアデータをバイパスしてデータレジスタLB0〜3の該当レジスタに格納するためのセット信号を生成する。
オア回路32〜35は、アンド回路14〜17、およびアンド回路18〜21の出力の論理和をそれぞれとるもので、オア回路32〜35の出力がLB0〜3セット信号としてデータレジスタLB0〜3にそれぞれ出力される。
【0035】
シーケンス制御部は、CPU300およびメモリ装置400に対する制御信号の入出力、メモリ装置400に対する読み出し動作制御を行うと共に、ロードデータバッファ部101の動作制御を行うもので、図3に示すアンド回路1〜2,7〜13、メモリリクエストレジスタ52、バッファ41〜44、ブロックアドレスバッファ45、オフセットアドレスバッファ46、オア回路31、オフセットアドレスカウンタ81で構成される。
【0036】
シーケンス制御部では、先ず、アンド回路1でCPU300からのリクエスト信号と、リード/ライト信号の反転信号との論理積をとり、リードリクエスト信号を生成する。尚、リード/ライト信号は、“0”の場合はリード、“1”の場合はライトを示している。従って、リードリクエスト信号が“1”の時、CPU300からのロード命令実行であることを認識する。
【0037】
また、アンド回路2ではCPU300からのリクエスト信号、リード/ライト信号、およびメモリアドレス一致検査部102aの比較器91出力(以下、この出力をタグマッチ信号と記す)との論理積をとり、ストアバイパス信号を生成する。ストアバイパス信号がアサートされる場合にはストアバイパス動作を行う。即ち、ライト指示でかつ、ブロックアドレスが一致したため、ストアバイパス動作を行うものである。
【0038】
アンド回路7は、アドレス一致検査部102aの比較器91出力と、Vフラグ部102bのVフラグセレクタ62出力であるバリッド信号との論理積をとる。アンド回路7の出力が“1”の場合は、CPU300から入力されるアドレスに配置されるメモリ装置400内のデータのコピーがデータレジスタLB0〜3の該当レジスタに存在することを示す。即ち、ロードデータバッファヒットで、かつ、Vフラグが“1”である。
【0039】
アンド回路8では、アンド回路7の出力と、アンド回路1の出力(リードリクエスト信号)との論理積をとる。アンド回路8の出力が“1”の場合にはメモリ装置400からのデータ読み出しは行わず、この信号をバッファ41で駆動アクノレッジ信号としてCPU300に出力する。この時、図2のロードバッファ部100内のロードバッファ出力セレクタ101bでは、データレジスタLB0〜3のうち、CPU300から入力されるスモールアドレスで指定されるデータレジスタ出力を選択し、ロードデータとしてCPU300に出力する。
【0040】
ここで、アクノレッジ信号とリクエスト信号とはハンドシェイクの関係にある。即ち、CPU300にてリクエスト信号がアサートされ、メモリバッファ装置が動作を行う。これが完了した時点でメモリバッファ装置にてアクノレッジ信号がアサートされる。CPU300ではアクノレッジ信号がアサートされたことによりリクエスト信号をネゲートする。メモリバッファ装置ではリクエスト信号がネゲートされたことによりアクノレッジ信号をネゲートする。CPU300ではアクノレッジ信号がネゲートされている状態において、次のメモリリクエストをアサートする。
このようにメモリリクエスト信号、およびアクノレッジ信号は、CPU300、およびメモリバッファ装置間の1語のデータアクセス毎の動作の同期をとるために使用される。
【0041】
アンド回路9では、アンド回路7の出力の反転信号と、アンド回路1の出力であるリードリクエスト信号、およびメモリビジィの反転信号との論理積をとる。この出力は、CPU300からのロード命令で読み出す必要のあるデータがロードデータバッファ部101に存在せず、かつ、その時点でメモリ装置400がアクセス可能な状態にあることを示す。
メモリビジィ信号はロードバッファ部100およびストアバッファ部200との共通信号である。そして、両者のうちいずれかがメモリ装置400にアクセス中である時にアサートされるアンド回路9の出力の立ち上がり時点で、メモリリクエストレジスタ52が“1”にセットされる(以下、“1”にセットされることを単にセットされると記し、“0”にセットされることをリセットされると記す)。つまり、ロードデータバッファミスであるため、CPU300の要求するデータをメモリ装置400から読み出す必要があり、メモリリクエストレジスタ52をセットすることでメモリ装置400に起動をかける。
【0042】
アンド回路9の出力は、更にタグレジスタ51のクロック入力、V0〜3レジスタV0〜V3のリセット入力、およびオフセットアドレスカウンタ81のロード入力に接続される。タグレジスタ51は、アンド回路9の出力のアサート時点、即ち、メモリリクエストレジスタ52のセット時点でCPU300から入力されるラージアドレスを新たに格納する。
タグレジスタ51の出力は、メモリリクエストレジスタ52の出力であるMリクエスト信号がアサートされている間ブロックアドレスバッファ45により駆動され、メモリブロックアドレスとしてメモリ装置400に出力される。また、V0〜3レジスタはメモリ装置400に対する新たなメモリアクセスを開始する時点、即ち、アンド回路9の出力のアサート時点に全てクリアされ、その内容は“0”となる。
【0043】
オフセットアドレスカウンタ81は、アンド回路9の出力のアサート時点にCPU300から入力される2ビットのスモールアドレスをセットする。オフセットアドレスカウンタ81の出力は、オフセットアドレスバッファ46により駆動され、メモリ装置400にメモリオフセットアドレスとして出力される。また、この信号はオフセットアドレスデコーダ72に入力され、メモリ装置400からのリードデータをロードデータバッファ部101に格納する時のLB0〜3の選択信号となる。更に、この信号はスモールアドレスセレクタ61に入力され、メモリ装置400に対するリードアクセスを行った際のVフラグをセットする時のV0〜3レジスタV0〜V3の選択信号となる。
【0044】
メモリリクエストレジスタ52の出力であるMリクエスト信号は、アンド回路12において、メモリアクノレッジの反転信号との論理積をとり、バッファ42により駆動され、メモリリクエスト信号としてメモリ装置400に出力される。メモリアクノレッジ信号はメモリ装置400から入力される信号で、この信号がアサートされるとメモリ装置400での所定の動作が完了したことを示す。また、メモリリクエスト信号はロードバッファ部100およびストアバッファ部200との共通信号であり、両者のうちいずれかがメモリ装置400に対してアクセス要求していることを示す。
【0045】
メモリリクエスト信号とメモリアクノレッジ信号はハンドシェイクの関係にある。即ち、メモリバッファ装置(ロードバッファ部100またはストアバッファ部200)にてメモリリクエスト信号がアサートされ、メモリ装置400が動作を行う。これが完了した時点でメモリ装置400にてメモリアクノレッジ信号がアサートされる。メモリバッファ装置ではメモリアクノレッジ信号がアサートされたことにより、メモリリクエスト信号をネゲートする。メモリ装置400ではメモリリクエスト信号がネゲートされたことにより、メモリアクノレッジ信号をネゲートする。メモリバッファ装置ではメモリアクノレッジ信号がネゲートされている状態において次のメモリリクエストをアサートする。このようにメモリリクエスト信号、およびメモリアクノレッジ信号は、メモリバッファ装置、およびメモリ装置400の間の1語のデータアクセス毎の動作の同期をとるために使用される。従って、前記2つの信号は毎メモリサイクルにオンオフする。
【0046】
Mリクエストの反転信号はバッファ43により駆動され、メモリリード/ライト信号としてメモリ装置400に出力される。メモリリード/ライト信号はMリクエスト信号が“1”の間“0”となる。また、Mリクエスト信号はバッファ44により駆動され、メモリビジィ信号をアサートする。メモリリード/ライト信号、およびメモリビジィ信号は毎メモリサイクルにオンオフせず、Mリクエスト信号がアサートされている間駆動され続ける。これらは、メモリバッファ装置とメモリ装置400の間のメモリブロック内の連続メモリアクセスを行うために1〜4メモリサイクルの間アサートされる。
【0047】
Mリクエスト信号は、更にアンド回路11の入力、およびスモールアドレスセレクタ61の選択入力に接続される。アンド回路11ではMリクエスト信号とメモリアクノレッジ信号との論理積がとられる。この出力はリードアクノレッジ信号としてこの信号がアサートされたことによりメモリ装置400におけるリードアクセス動作が完了したことを示す。スモールアドレスセレクタ61は、V0〜3レジスタのうち、いずれか1つを選択して、これをセットするもので、メモリ装置400に対するリードアクセスの時にはオフセットアドレスカウンタ81の出力を選択し、ストアバイパスの時にはCPU300から入力されるスモールアドレスを選択してスモールアドレスデコーダ71に出力する。このための選択信号としてMリクエスト信号が使用される。
【0048】
アンド回路11の出力であるリードアクノレッジ信号は、アンド回路10の入力、オア回路31の入力、オフセットアドレスカウンタ81のクロック入力、およびアンド回路14〜17の入力に接続される。アンド回路10ではリードアクノレッジ信号とオフセットアドレスデコーダ72の出力3(入力信号が“11”の時アサートされる)との論理積をとる。アンド回路10の出力はリードダン信号で、この信号のアサートにより、メモリ装置400からCPU300が要求するデータからリードアクセスを始めてそのメモリブロックの最大メモリアドレス、即ち、メモリアドレスの下位2ビットが“11”まで連続してリードアクセスが完了したことを示す。
【0049】
リードダン信号はメモリリクエストレジスタ52のリセット入力に入力され、この信号の立ち上がり時点でメモリリクエストレジスタ52はリセットされる。そして出力のMリクエスト信号はネゲートされる。
オア回路31ではリードアクノレッジ信号とアンド回路13の出力の論理和がとられる。オア回路31の出力は、Vフラグ部102bのアンド回路3〜6に入力され、V0〜3レジスタV0〜V3へのセット入力のアサートされるタイミング信号となる。
【0050】
アンド回路11の出力であるリードアクノレッジ信号は、メモリ装置400に対してリードアクセスを行う場合のVフラグのセットタイミング信号として使用される。オフセットアドレスカウンタ81は、メモリ装置400に出力するオフセットアドレスの生成を行うと共に、連続してメモリアクセスを行う時のサイクル数を計数するために使用する。本実施形態1では、メモリアクセスはロードバッファミスとなったメモリアドレスからそのメモリブロックの最大アドレスまでに配置されるデータを連続してリードアクセスしてロードデータバッファ部101に格納するとしている。
【0051】
アンド回路13は、ストアバイパス信号とアクノレッジ信号との論理積をとる。この時のアクノレッジ信号はストア命令実行時にストアバッファ部200で駆動されアサートされる。アンド回路13の出力は、オア回路31の入力およびLB0〜3セット信号生成部102cのアンド回路18〜21の入力に接続される。オア回路31へは、ストアバイパス時のVフラグのセットタイミング信号として入力される。アンド回路18〜21ではストアバイパス時にCPU300から入力されるストアデータをバイパスしてロードデータバッファ部101に格納するためのLB0〜3セット信号をアサートするタイミング信号となる。
【0052】
図6は、ストアバッファ部200の構成図である。
上述したように、ストアバッファ部200は、ストアデータバッファ部201と、ストアバッファ制御部202とで構成される。
ストアデータバッファ部201はキュー(FIFO:先入れ先出しメモリ)で構成される。本実施形態では4語のデータレジスタ(SB0〜3)、4つのスモールアドレスレジスタ(各2ビット:SB0〜3A)、および3つのデータセレクタ(SB1〜3B)を直列に接続して、ストアデータとその書き込み先メモリアドレスの下位2ビット、即ち、スモールアドレスとを格納するキューの部分、およびCPU300から入力されたスモールアドレスの内容とスモールアドレスレジスタSB0〜3Aに格納される既にキューに入れられているスモールアドレスの内容との比較を行うマッチャSB0〜3Cとで構成されるが、本発明においてはデータ語数は4語に限定されるものではなく、1語以上任意の語数をとることが可能である。
【0053】
CPU300からのストア命令実行時に入力されるラージアドレス、即ち、メモリアドレスの下位2ビットを除いた値と、前記キューに保存されているデータの書き込み先メモリブロックのアドレス、即ちメモリブロックアドレスが等しい場合には、メモリ装置400に対してデータ書き込みは行わずにキューの最後尾に新たなストアデータと書き込み先メモリブロック内のオフセットアドレス(以下、単にオフセットアドレスと記す)、即ち、CPU300から入力されるスモールアドレスの内容を書き込む。
【0054】
この時、既にキューに格納されているデータ、およびオフセットアドレスは1語分キューの先頭方向にシフトされる。メモリブロックアドレス、およびオフセットアドレスの両方がそれぞれCPU300から入力されるラージアドレス、およびスモールアドレスに等しい場合、即ち、ストア命令で与えられたメモリアドレスと同一のメモリアドレスへのストアデータが既にキューに格納されている場合には、そのデータは後続するストアデータで上書きされる。即ち、実際にメモリ装置400には書き込まれずに同一メモリアドレスに対する新たなストアデータがキューに格納される。
【0055】
ラージアドレスとメモリブロックアドレスの一致検査はストアバッファ制御部202にて行われ、スモールアドレスとメモリオフセットアドレスの一致検査はマッチャSB0〜3Cにて行われる。マッチャSB0〜3Cのうちいずれかで一致が確認された場合には、一致したストアバッファSB(データレジスタSB0〜3、およびスモールアドレスレジスタSB0〜3Aに対する総称とする)に相当するマッチャSB0〜3Cのいずれかがアサートされる。
データセレクタSB0〜3Bは、キューに新たなデータを格納する場合には、そのストアバッファSBへの入力に対してはCPU300から入力されるストアデータ、およびスモールアドレスを選択し、それ以外のストアバッファSBに対しては1つ後ろのストアバッファSBの出力を選択して出力する。
【0056】
ストアバッファ制御部202は、CPU300、およびメモリ装置400に対する制御信号の入出力を行うと共に、ストアデータバッファ部201の制御を行う。
ストアバッファ制御部202からストアデータバッファ部201には、SB0〜3クロック信号、およびSB1〜3セット信号が出力され、ストアデータバッファ部201からストアバッファ制御部202には、SB0〜3マッチ信号が出力される。SB0〜3クロック信号は、データレジスタSB0〜3、およびスモールアドレスレジスタSB0〜3Aの各レジスタに対するクロック信号である。データレジスタSB0〜3、およびスモールアドレスレジスタSB0〜3Aは、クロック信号の立ち上がり時点で入力を格納する。SB1〜3セット信号はデータセレクタSB1〜3Bの選択信号で、“1”の時、CPU300から入力されるストアデータ、およびスモールアドレスを選択し、“0”の時、直列に接続される後続のレジスタの出力を選択する。SB0〜3マッチ信号は、マッチャSB0〜3Cの出力信号でマッチャの入力同士が一致した場合には“1”となる。
【0057】
図7は、ストアバッファ制御部202の構成図である。
図8は、図7におけるストアバッファ信号生成部202bの構成図である。
これらの図において、ストアバッファ制御部202は、CPU300、およびメモリ装置400に対する制御信号の入出力を行うと共に、ストアデータバッファ部201の制御を行うもので、メモリアドレス一致検査部202a、ストアバッファ信号生成部202b、およびシーケンス制御部とから構成される。
【0058】
即ち、これらの図に示すストアバッファ制御部202は、アンド回路1〜18、オア回路31〜40、バッファ41〜43、ブロックアドレスバッファ44、タグレジスタ51、メモリリクエストレジスタ52、セレクタ63〜66、ライトバッファテールデコーダ74、ライトバッファポインタ82、比較器91を備えている。
尚、図7中、A1は、ラージアドレス、A2はアクノレッジ、A3はリクエスト、A4はリード/ライト、A5〜A8はSB0マッチ〜SB3マッチであり、B1はメモリブロックアドレス、B2はメモリリードライト、B3はメモリビジー、B4はメモリリクエスト、B5はメモリアクノレッジ、B6〜B8はSB1セット〜SB3セット、B9〜B12はSB0クロック〜SB3クロックを示している。
【0059】
メモリアドレス一致検査部202aは、図3に示すロードバッファ制御部102のメモリアドレス一致検査部102aと同一の構成で動作も同様であるため、タグレジスタ51と比較器91からなる構成の図示および動作の説明は省略する。
【0060】
ストアバッファ信号生成部202bは、SB0〜3クロック、およびSB1〜3セット信号を生成する回路であり、図8に示すように、ライトバッファテールデコーダ74、アンド回路12〜14、オア回路35〜40、セレクタ63〜66、およびアンド回路15〜18で構成される。
ライトバッファテールデコーダ74は2−4デコーダであり、シーケンス制御部のライトバッファポインタ82で計数されるストアバッファSBで構成されるライトデータバッファキューの最後尾位置を示す2ビットの入力信号をデコードするもので、4つの出力のうちアサートされた1つに相当するストアバッファSBがキューの最後尾となる。
【0061】
アンド回路12〜14は、SB1〜3セット信号を生成するもので、ライトバッファテールデコーダ74の1〜3出力(入力が“01”、“10”、“11”の時それぞれアサートされる)と、シーケンス制御部のアンド回路1の出力(後述)との論理積をそれぞれとるものである。ここで、アンド回路12〜14の出力のうち“1”の信号がある場合には、図6のデータセレクタSB1〜3Bにおいて、CPU300から入力されるストアデータ、およびスモールアドレスが選択され、データレジスタSB1〜3、およびスモールアドレスレジスタSB1〜3Aの該当レジスタに入力される。
【0062】
一方、データレジスタSB0、およびスモールアドレスレジスタSB0Aは、キューの入り口に設置されるため、後続のレジスタは入力に接続されない。従って、データレジスタSB0、およびスモールアドレスレジスタSB0Aにデータを格納する場合には常にCPU300から入力されるストアデータ、およびスモールアドレスが入力となる。
【0063】
オア回路35〜37は、キューに新たなデータを格納する場合、およびキューの内容をシフトアウトしてメモリ装置400に書き込む場合に、ストアバッファSBに出力するSB0〜3クロック信号発生の選択を行う論理をとる部分である。新たなデータをキューに格納する場合にはライトバッファポインタ82の値の示すレジスタよりも先に接続される、即ち、キューの先頭方向にあるストアバッファSBに対してクロック信号を供給する。また、キューの内容をシフトアウトしてメモリ装置400に書き込みを行う場合についても、外部から新たに書き込むべきデータがCPU300から入力されない限りは、既にキューに格納されているデータのみを先頭方向にシフトする。従って、この場合にもライトバッファポインタ82の値の示すレジスタよりも先に接続される、即ち、キューの先頭方向にあるストアバッファSBに対してクロック信号を供給する。オア回路35〜37においてこのような論理をとることにより、キューの内容をメモリ装置400に書き込む際にも無効なデータがキューに格納されることはなくなる。
【0064】
オア回路38〜40では、既にキューに格納されているデータのメモリ装置400内の書き込みメモリアドレスと同一のメモリアドレスに対するストア命令実行の場合のSB0〜3クロック信号発生の選択を行う。この場合は、キュー内容の上書きを行うため、ストアデータバッファ部201から入力されるSB0〜3マッチのうちアサートされる1〜4つの信号に応じてSB0〜3クロック信号が生成される。
【0065】
即ち、ストアバッファSB0のみアサートされる場合にはSB0クロックのみが生成され、ストアバッファSB1のみ、あるいはストアバッファSB0、SB1の両方がアサートされる場合には、SB0クロック、およびSB1クロックが生成され、ストアバッファSB2のみ、ストアバッファSB2、SB1の両方、あるいはストアバッファSB2、SB1、およびSB0の3つがアサートされる場合には、SB0クロック、SB1クロック、およびSB2クロックの3つが生成され、そして、ストアバッファSB3のみ、ストアバッファSB3、SB2の両方、ストアバッファSB3、SB2、SB1の3つ、あるいはストアバッファSB3、SB2、SB1、およびストアバッファSB0の全てがアサートされる場合にはSB0クロック、SB1クロック、SB2クロック、およびSB3クロックの全てが生成される。
【0066】
これにより、新たに書き込むデータがライトバッファテール信号(ライトバッファポインタ82の出力)により示されるキューの最後尾に格納され、そして元のストアデータは後続のストアデータに上書きされることになる。
セレクタ63〜66は、前記2系統のSB0〜3クロック発生選択回路を経て生成される信号の選択回路で、シーケンス制御部のアンド回路3の出力(後述)が“1”の場合、即ち、キューに格納されているストアデータの上書き時には、オア回路38〜40の出力、およびSB3マッチ信号が選択され、アンド回路15〜18に出力される。一方、アンド回路3の出力が“0”の場合、即ち、キューに新たなストアデータを格納する場合、あるいはキューに格納されているストアデータを順次連続してメモリ装置400に書き込む場合には、ライトバッファテールデコーダ74の0出力、およびオア回路35〜37出力が選択されて、アンド回路15〜18に入力される。アンド回路15〜18は、これらセレクタ63〜66の出力と、シーケンス制御部のオア回路34の出力(後述)との論理積をとり、ストアデータバッファ部201に出力するためのSB0〜3クロックを生成する。オア回路34の出力は、ストアバッファSBに与えるクロックのアサートタイミングを決定する信号である。
【0067】
シーケンス制御部は、CPU300、およびメモリ装置400に対する制御信号の入出力、メモリ装置400に対する書き込み動作制御を行うと共に、ストアデータバッファ部の動作制御を行う。このシーケンス制御部は、図7に示すアンド回路1〜11、オア回路31〜34、メモリリクエストレジスタ52、バッファ41〜43、ブロックアドレスバッファ44、ライトバッファポインタ82で構成される。
【0068】
シーケンス制御部では、先ず、アンド回路1で、CPU300からのリクエスト信号と、リード/ライト信号との論理積をとり、ライトリクエスト信号を生成する。ライトリクエスト信号が“1”の時、CPU300からのストア命令実行であることを認識する。また、オア回路31は、ストアデータバッファ部201から入力されるSB0〜3マッチ信号全ての論理和をとる。オア回路31の出力はオフセットアドレスマッチ信号で、ストアデータバッファ部201(キュー)に新たにCPU300から書き込み要求のあるメモリアドレスの下位2ビット、即ち、スモールアドレスと同一のメモリブロック内アドレス、更に言い替えれば、メモリオフセットアドレスに対するストアデータがキューに既に格納されている時にこの信号がアサートされる。
【0069】
アンド回路2は、メモリアドレス一致検査部202aの比較器91出力と、オア回路31の出力するオフセットアドレスマッチの反転信号との論理積をとる。アンド回路2の出力は、タグマッチ信号が“1”、即ち、タグレジスタ51に格納されているメモリブロックアドレスの内容とCPU300から入力されるラージアドレスの内容は同一であるが、スモールアドレスと前記キューのスモールアドレスレジスタSB0〜3Aに格納されるメモリオフセットアドレスの内容は一致しないことを意味する。つまり、キューに格納されるストアデータと同一のメモリブロックの新たなブロック内オフセットアドレスに書き込むストア命令が実行された場合である。この場合には、入力されるストアデータ、およびスモールアドレスの内容をキューに格納する。この時の格納先ストアバッファSBは、ライトバッファポインタ82の出力であるライトバッファテール信号により示される。
【0070】
アンド回路3は、メモリアドレス一致検査部202aの比較器91の出力と、前記のオフセットアドレスマッチ信号との論理積をとる。アンド回路3の出力は、CPU300から入力されたアドレスとタグレジスタ51、およびキューに格納されているメモリアドレスが一致する場合にアドレスマッチ信号としてアサートされる。この場合には、既にキューに格納されているストアデータを上書きし、新たにCPU300から入力されるストアデータをライトバッファテール信号で指定されるキューの最後尾に格納する。
【0071】
アンド回路4は、メモリアドレス一致検査部202aの比較器91の出力の反転信号、アンド回路1の出力であるライトリクエスト信号、およびメモリビジィ信号との論理積をとる。メモリビジィ信号は、ロードバッファ部100でも説明したように、ロードバッファ部100、およびストアバッファ部200との共通信号である。
【0072】
アンド回路5は、アンド回路1の出力とアンド回路2の出力との論理積をとり、エンキュー信号を出力する。アンド回路6は、アンド回路1の出力とアンド回路3の出力との論理積をとり、オーバライト信号を出力する。アンド回路3の出力は、ストアバッファ信号生成部202bのセレクタ63〜66に対する選択信号として使用される。前記エンキュー信号は、オア回路34、およびオア回路32に出力される。前記オーバライト信号はオア回路34に入力される。オア回路34は、これら2つの信号とアンド回路10の出力(後述)との論理和をとるもので、シフトタイミング信号を出力する。
【0073】
シフトタイミング信号は、ストアバッファ信号生成部202bのアンド回路15〜18に入力され、SB0〜3クロック信号のアサートタイミングを与える。シフトタイミング信号は、更にアンド回路7に出力される。アンド回路7は、前記のライトリクエスト信号と、シフトタイミング信号との論理積をとり、バッファ41により駆動され、アクノレッジ信号としてCPU300に出力する。アンド回路4の出力は、メモリリクエストレジスタ52のセット入力(S入力)、およびオア回路32に出力される。メモリリクエストレジスタ52では、セット入力の立ち上がり時点でセットされ、Mリクエスト信号をアサートする。Mリクエスト信号は、前記ロードバッファ制御部102のMリクエスト信号と同様に、メモリ装置400に対する書き込みアクセスを行うための起動信号となる。
【0074】
Mリクエスト信号は、ブロックアドレスバッファ44のイネーブル信号としてタグレジスタ51の出力を駆動し、メモリラージアドレスをメモリ装置400に出力し、バッファ42により駆動され、メモリリード/ライト信号をメモリ装置400に出力し、アンド回路11に出力され、メモリ装置400から入力されるメモリアクノレッジの反転信号との論理積をとり、バッファ43により駆動され、メモリリクエスト信号としてメモリ装置400に出力される。
【0075】
メモリリクエスト信号、およびメモリアクノレッジ信号は、前記ロードバッファ部100で記したようにハンドシェイク信号である。Mリクエスト信号は更にアンド回路10に出力される。アンド回路10は、Mリクエスト信号とメモリアクノレッジ信号との論理積をとり、ライトアクノレッジ信号を出力する。ライトアクノレッジ信号は、ストアバッファ部200から出力されたメモリ書き込みアクセス要求のためのリクエスト信号に対する動作が完了したことを示す信号で、この信号の立ち上がり時点で前記メモリ動作が完了したと認識される。
【0076】
アンド回路10の出力、即ち、ライトアクノレッジ信号は、オア回路34、アンド回路8、および、アンド回路9に出力される。オア回路34は、シフトタイミング信号を生成するもので、ライトアクノレッジ信号がアサートされ、オア回路34に入力される場合には、メモリ装置400への書き込みアクセスが完了したことを示すもので、この時、シフトタイミング信号はアサートされ、アンド回路15〜18に出力されて、SB0〜3クロック信号のアサートタイミングを与える。また、シフトタイミング信号はアンド回路7に出力される。
ライトアクノレッジ信号がアサートされることによりシフトタイミング信号がアサートされ、そしてアンド回路7にてライトリクエストとの論理積出力がアサートされた場合は、メモリ装置400への書き込みを伴うストア命令実行に対するアクノレッジ信号がアサートされ、バッファ41で駆動され、CPU300に出力される。この場合のアクノレッジ信号は、ストアデータバッファ(キュー)の先頭の1語がメモリ装置400に書き込み完了した時点でアサートされる。
【0077】
アンド回路10の出力、即ち、ライトアクノレッジ信号は、アンド回路8にてライトバッファテールデコーダ74の3出力、即ち、ラストアクセス信号と論理積がとられ、また、アンド回路9にて前記ラストアクセスの反転信号との論理積がとられる。アンド回路8の出力は、メモリ装置400へのストアデータバッファ(キュー)に格納されている古い(新たにCPU300が書き込み要求しているデータの書き込み先メモリデータブロックとは異なる)メモリデータブロックに対する書き込みの最後のメモリアクセスの完了時にアサートされる。また、アンド回路9の出力は、上記メモリ書き込みの最後以外のメモリアクセスの完了時にアサートされる。アンド回路8の出力はライトダン信号で、メモリリクエストレジスタ52のリセット入力、およびオア回路33に出力される。また、アンド回路9の出力はオア回路32に出力される。
【0078】
メモリリクエストレジスタ52は、リセット入力の立ち上がり時点でリセットされる。メモリリクエストレジスタ52がリセットされることで、Mリクエスト信号がネゲートされ、これによりメモリ装置400に対する1〜4回のメモリ書き込みを終了させると共に、メモリビジィ信号をネゲートする。オア回路32は前記アンド回路4の出力、即ち、メモリリクエストレジスタ52へのセット入力となる信号と、アンド回路9の出力との論理和をとるもので、出力はライトバッファポインタ82へのアップ入力に接続される。また、オア回路33は、前記アンド回路5の出力、即ち、エンキュー信号と、アンド回路8の出力、即ち、ライトダン信号との論理和をとるもので、出力はライトバッファポインタ82へのダウン入力に接続される。
【0079】
ライトバッファポインタ82は、ストアデータバッファ(キュー)の最後尾を示すための2ビットのライトバッファテール信号を生成するものである。以下にライトバッファポインタ82による計数動作を示す。ストアデータバッファは先頭位置(出口)から3、2、1、0の順に番号付けされる。したがってキューの構造上の入り口(最後尾とは限らない;最後尾は動作時のキューの入り口)は0である。また、キューの最後尾は通常次にデータを書き込むことのできるSBを示している。したがって、ライトバッファポインタはデータの挿入時に更新され(1つ番号が小さくなる)、次のデータ挿入に備え、またデータのメモリ装置400への書き出し時に更新される(1つ番号が大きくなる)。
【0080】
[a.初期状態、即ち、電源投入直後]
データは何も書き込まれていないので3となる。
[b.タグレジスタの内容と同一のメモリブロックへのストア命令実行時]
(b−1.スモールアドレスがスモールアドレスレジスタSB0〜3Aのいずれかと同一の場合):データの上書きを行うので増減なし。
(b−2.スモールアドレスがスモールアドレスレジスタSB0〜3Aのいずれとも同一でない場合):データの挿入を行うので1減じられる。
【0081】
[c.タグレジスタの内容と異なるメモリブロックへのストア命令実行時]
▲1▼先ず、1増加される(キューへのデータ挿入、および元のキュー内容の先頭方向へのシフト、即ち、1語のキュー内容のシフトアウトへのポインタ準備)。
▲2▼メモリ装置400への書き込みアクセスを行い、メモリアクノレッジがアサートされる毎に1増加される(キュー内容のシフトアウトへのポインタ準備。新たなメモリブロックへの書き込みデータが挿入される)。そして、ポインタの値が3になるまで増加は続く。
▲3▼ポインタの値が3の時のメモリ書き込みアクセス時のメモリアクノレッジ信号のアサート時に1減じられ2となり、メモリ書き込みアクセスは終了する。即ち、以前のメモリブロックへの書き込みデータが全てメモリ装置400に書き込まれ、新たなメモリブロックへの書き込みデータがキューの先頭まで進み、ポインタの値は次のデータの挿入に備えて2となる(キューの先頭から2番目のSB2を示す)。
【0082】
上記説明において、b−1の時にはアンド回路5の出力、即ち、エンキュー信号がアサートされ、c−▲1▼の時には、アンド回路4の出力がアサートされ、c−▲2▼の時にはアンド回路9の出力がアサートされ、そしてc−▲3▼の時にはアンド回路8の出力、即ち、ライトダン信号がアサートされて、オア回路32、あるいはオア回路33を経てライトバッファポインタ82のアップ入力、あるいはダウン入力に出力され、ライトバッファポインタ82にて必要な計数動作を行う。
【0083】
[動作]
図9〜11は、本実施形態1の動作を示す説明図であり、図9が、ロード時の動作、図10、11がストア時の動作を示している。
ロード命令実行時は、ロードバッファ部100のタグレジスタ51の内容とCPU300から入力されるラージアドレスの内容の一致、あるいは不一致、および上記ラージアドレスの一致の場合のVフラグの内容(“1”の時有効、“0”の時無効)により動作が異なる。
【0084】
ストア命令実行時は、ストアバッファ部200のタグレジスタ51の内容とCPU300から入力されるラージアドレスの内容の一致、あるいは不一致、および、これらとキューに格納されているメモリオフセットアドレスとCPU300から入力されるスモールアドレスの内容の一致、あるいは不一致の組み合わせにより動作が異なる。更に、上記ストア命令実行時においてロードバッファ部100のタグレジスタ51の内容とCPU300から入力されるラージアドレスの内容が一致、あるいは不一致の場合で更に動作が異なる。図9〜11にはこれらの各々の組み合わせと動作が記されている。
【0085】
図12、図13は、本実施形態1および後述する実施形態2におけるロード命令実行時のタイムチャートである。
図12はバッファヒットの場合の動作で、この場合はメモリ装置400に対して読み出しアクセスは行われず、ロードデータバッファ部101内の必要なデータが選択されCPU300に出力される。図12において、リクエスト信号とアクノレッジ信号はハンドシェイクの関係にある。また、ラージアドレス、スモールアドレス、およびリード/ライト信号はリクエスト信号がアサートされている間正しい値となっている。ロードデータはアクノレッジ信号の立ち上がり時点で正しい値となっている。
【0086】
図13はバッファミスの場合の動作で、この場合はメモリ装置400に対して読み出しアクセスを行い、CPU300の要求するデータをCPU300に出力すると共に、ロードデータバッファ部101に格納する。更に、CPU300はメモリ装置400に読み出しアクセスを行ったメモリアドレス以降、そのメモリブロック(実施形態1、および後述する実施形態2では4語で構成される)の最後のデータまで連続してメモリ装置400から読み出し、ロードデータバッファ部101の該当レジスタに格納する。CPU300に対するアクノレッジ信号のアサートおよびロードデータの出力は、最初のメモリ読み出しアクセスでメモリ装置400から読み出したデータが入力された時点、即ち、最初のメモリリクエスト信号のアサートに対するメモリアクノレッジ信号のアサート時に確定する。
【0087】
図13ではスモールアドレスの内容が“00”の場合、即ち、当該メモリブロックの最初に配置されるデータに対してのロード命令実行時の動作を示す。この場合には、ロードバッファミスとなったメモリブロックの最初に配置されるデータから読み出しアクセスを行い、4語のメモリブロック全部を連続して読み出し、ロードデータバッファ部101の該当レジスタに順次格納する。図13でリクエスト信号とアクノレッジ信号はハンドシェイクの関係にある。また、ラージアドレス、スモールアドレス、およびリード/ライト信号はリクエスト信号がアサートされている間正しい値となっている。更に、メモリブロックアドレス、メモリオフセットアドレス、メモリリード/ライト信号はメモリリクエスト信号がアサートされている間正しい値となっている。そして、メモリリードデータはメモリアクノレッジ信号の立ち上がり時点、およびLB0〜3セット信号の立ち上がり時点で正しい値となっている。また、ロードデータはアクノレッジ信号の立ち上がり時点で正しい値となっている。
【0088】
図14、15は、本実施形態1および後述する実施形態2のストア命令実行時のタイムチャートである。
図14はバッファヒットの場合で、この場合にはメモリ装置400に対する書き込みアクセスは行われず、ストアデータバッファ(キュー)に書き込みデータを格納するのみの動作を行う。図14でリクエスト信号とアクノレッジ信号はハンドシェイクの関係にある。また、ラージアドレス、スモールアドレス、リード/ライト信号、およびストアデータはリクエスト信号がアサートされている間正しい値となっている。
【0089】
図15はバッファミスの場合の動作で、この場合はメモリ装置400に対して連続して書き込みアクセスを行い、既にキューに格納されていた書き込みデータをメモリ装置400の当該メモリブロックに対して書き込みアクセスを行うと共に、CPU300から入力されるストアデータを新たにキューに格納する。CPU300に対するアクノレッジ信号のアサートは、最初のメモリ書き込みアクセスでキューの先頭にあるデータをメモリ装置400に書き込み完了した時点、即ち、最初のメモリリクエスト信号のアサートに対するメモリアクノレッジ信号のアサート時に確定する。図15でリクエスト信号とアクノレッジ信号はハンドシェイクの関係にある。また、ラージアドレス、スモールアドレス、リード/ライト信号、およびストアデータはリクエスト信号がアサートされている間正しい値となっている。更に、メモリブロックアドレス、メモリオフセットアドレス、メモリリード/ライト信号、およびメモリライトデータはメモリリクエスト信号がアサートされている間、およびSB0〜3クロックの立ち上がり時点で正しい値となっている。
【0090】
[効果]
以上のように、本実施形態1は、複数語のロードデータバッファ部101、および複数語のストアデータバッファ部201(キュー)、およびこれらの制御部とからメモリバッファ装置を構成しているため、例えば、キャッシュメモリに比べてデータ格納のための別途のメモリ部を必要としない等、小規模の回路でメモリバッファ装置を構成することができる。その結果、CPU300の高動作周波数化に対して十分追従可能な動作速度が確保できると共に、CPU300と本発明のメモリバッファ装置とを含むLSIのチップ面積を、従来技術によるCPUとキャッシュメモリで構成されるLSIに比べ大幅に削減することが可能で、ローコスト化および消費電力の低減化を図ることができる。
【0091】
また、ロード命令実行時でバッファミスが発生した場合は、メモリ装置400から複数語のメモリアクセス動作を行うため、CPU300のメモリ装置400へのアクセス頻度を軽減でき、メモリスループットの向上を図ることができ、従って、プログラム実行性能の向上に寄与することができる。
【0092】
更に、本実施形態1では、ロード命令実行時でバッファミスが発生した場合に、そのメモリアドレスから連続して同一メモリブロックの最終アドレスまでの読み出しアクセスを行い、ロードバッファ部100に格納するようにしたので、次のような効果がある。
ミスを起こしたメモリアドレスから先の(メモリアドレスが増加する方向の)データのみを連続アクセスすることにより、例えば、配列演算といった前方参照頻度の高いプログラムの実行に対しては、ブロック全体を常に読みだす場合に比べてメモリアクセスサイクルを低減することができる。即ち、メモリ参照は直前のメモリ参照の対象アドレスから連続して、あるいは数語離れた前方(メモリアドレスの増加する方向)に対して行われる確率が高い場合には、直前のメモリ参照の対象アドレスよりも後方(メモリアドレスの減少する方向)のデータアクセスは稀であり、これらのデータを不必要にメモリ装置400から読み出すことがないからである。
【0093】
《実施形態2》
[構成]
本実施形態2において、全体構成は、図1に示した構成および図2に示した構成と図面上は同様である。また、ストアバッファ部については、図6、7、8に示した構成と同様であるため、これらの構成については省略する。
本実施形態が上記実施形態1と異なるのは、ロードバッファ制御部の構成であり、以下のようになっている。
【0094】
図16は、実施形態2におけるロードバッファ制御部の構成図である。
即ち、本実施形態では、上記実施形態1のロードバッファ制御部102に対し、メモリアクセスカウンタ83を新たに設置する点が異なる。この点以外の構成については実施形態1と同様であるため、対応する部分に同一符号を付してその説明を省略する。
【0095】
本実施形態2と上記実施形態1との違いはロード命令実行時にバッファミスとなった場合の動作のみである。このような場合、実施形態1ではミスを発生したメモリアドレスから連続して当該メモリブロックの最終アドレスのデータまでをメモリ装置400から連続読み出しアクセスしてロードデータバッファ部101の該当レジスタに格納する動作を行った。これに対し、実施形態2ではミスを発生したメモリアドレスから連続して当該メモリブロックの最終アドレスのデータ、および当該メモリブロックの先頭アドレスのデータからミスを発生したメモリアドレスの直前のメモリアドレスのデータまで、即ち、1メモリブロック全体のデータをメモリ装置400から読み出しアクセスして、ロードデータバッファ部101の該当レジスタに格納する動作を行う。
【0096】
このために、図16に示すようにオフセットアドレスカウンタ81、およびメモリアクセスカウンタ83の2つのカウンタを設置する。オフセットアドレスカウンタ81は、読み出しアクセスを行うメモリブロック内のオフセットアドレスを生成し、また、1メモリブロック分のデータ読み出しアクセスを行うためのアクセスサイクル数を計数する。そして、メモリアクセスカウンタ83のカウントクロック入力はオフセットアドレスカウンタ81のカウントクロック入力と同一信号で、図3に示すロードバッファ制御部102のリードアクノレッジ信号と同一である。
【0097】
メモリアクセスカウンタ83のロード入力はオフセットアドレスカウンタ81のロード入力と同一信号で、図3に示すロードバッファ制御部102のメモリリクエストレジスタ52へのセット入力と同一である。この時、メモリアクセスカウンタ83には必ず“00”がロードされる。メモリアクセスカウンタ83のキャリー出力は、この2ビットのカウンタがオーバフローした時、即ち、4となった時にアサートされる。これにより1メモリブロック分のデータである4語のデータがメモリ装置400から連続して読み出されたことが認識される。この信号はラストアクセス信号で、アンド回路10でリードアクノレッジ信号と論理積がとられ、その出力がメモリリクエストレジスタ52のリセット信号となり、メモリリクエストレジスタ52をリセットする。尚、ラストアクセス信号は図3に示す実施形態1のロードバッファ制御部102と同一の役割である。
このメモリアクセスカウンタ83を設置することにより、バッファミスの場合には必ずミスを発生したメモリブロック全体、即ち、4語のデータアクセスを連続してメモリ装置400に対して行う。
【0098】
図17〜19は、本実施形態2の動作を示す説明図であり、図17がロード時の動作、図18、19がストア時の動作を示している。
本実施形態2のメモリバッファ装置の動作は、図9〜11に示す実施形態1のメモリバッファ装置の動作と比べてロード命令実行時の動作のみ異なる。
実施形態2では、ロードバッファミスの場合に必ずミスとなったメモリアドレスを含むメモリブロック全体(4語)をメモリ装置400から読み出しアクセスし、ロードデータバッファ部101の該当レジスタに格納するため、以降のメモリアクセスにおいて、ロードVフラグは必ず“1”となる。従って、ロードバッファ部100のタグレジスタ51の内容がCPU300から入力されるラージアドレスの内容と一致する場合には必ずバッファヒットとなり、この場合にはロードデータバッファ部101の該当レジスタからデータをCPU300に出力する。
【0099】
一方、上記タグレジスタ51の内容とCPU300から入力されるラージアドレスの内容が一致しない場合にはバッファミスであるため、ミスとなったメモリアドレスから連続してメモリ装置400から1メモリブロック分のデータを読み出し、最初に読み出したリードデータをCPU300に出力すると共に、1メモリブロック分のデータ(4語)をロードデータバッファ部101の該当レジスタに格納する。ストア命令実行時の動作は図9〜11に示す実施形態1のメモリバッファ装置の動作と同一である。
【0100】
また、実施形態2におけるロード命令実行時およびストア命令実行時の各信号のタイミングについては、図12〜図15で示した状態と同様であるため、その説明は省略する。但し、実施形態2では、スモールアドレスの内容が“00”〜“11”のいずれの値の場合であってもロードバッファミスとなったメモリブロックの最初に配置されるデータから読み出しアクセスを行い、4語のメモリブロック全部を連続して読み出しロードデータバッファの該当レジスタに順次格納する。
【0101】
[効果]
以上のように、実施形態2では、上記実施形態1と同様に、ローコスト化および消費電力の低減化を図ることができるといった効果を奏すると共に、ロード命令実行時でバッファミスが発生した場合に、ミスとなったメモリアドレスを含む1メモリブロック全体のデータの読み出しアクセスを行ってロードバッファ部100に格納するようにしたので、次のような効果がある。
ミスを起こしたメモリアドレスを含むメモリブロック全体を連続アクセスすることにより、例えば、スタックを用いた演算といった前方参照頻度と後方参照頻度とが同程度に高いプログラムの実行に対しては、ブロック全体を常に読みだすことで全体のバッファミス回数を低減することができる。即ち、メモリ参照は直前のメモリ参照の対象アドレスから連続して、あるいは数語離れた前方(メモリアドレスの増加する方向)、および後方(メモリアドレスの減少する方向)に対して同程度のメモリアクセス確率がある場合には、1度に連続アクセスしてバッファに格納することが可能である最大語数のデータをメモリ装置400から連続してアクセスすることで、メモリスループットを最大とすることができる。
【0102】
【発明の効果】
以上説明したように、第1発明のメモリバッファ装置によれば、複数語のレジスタを有するロードデータバッファ部と、複数語の先入れ先出しバッファを有するストアデータバッファ部、およびこれらの制御部とから構成しているため、例えば、キャッシュメモリに比べてデータ格納のための別途のメモリ部を必要としない等、小規模の回路でメモリバッファ装置を構成することができる。その結果、CPUの高動作周波数化に対して十分追従可能な動作速度が確保できると共に、CPUと本発明のメモリバッファ装置とを含むLSIのチップ面積を、従来技術によるCPUとキャッシュメモリで構成されるLSIに比べ大幅に削減することが可能で、ローコスト化および消費電力の低減化を図ることができる。
【0103】
また、ロード命令実行時でバッファミスが発生した場合は、メモリ装置から複数語のメモリアクセス動作を行うため、CPUのメモリ装置へのアクセス頻度を軽減でき、メモリスループットの向上を図ることができ、従って、プログラム実行性能の向上に寄与することができる。
【0104】
更に、ロード命令実行時でバッファミスが発生した場合に、そのメモリアドレスから連続して同一メモリブロックの最終アドレスまでの読み出しアクセスを行い、ロードバッファ部に格納するようにしたので、次のような効果がある。
ミスを起こしたメモリアドレスから先の(メモリアドレスが増加する方向の)データのみを連続アクセスすることにより、例えば、配列演算といった前方参照頻度の高いプログラムの実行に対しては、ブロック全体を常に読みだす場合に比べてメモリアクセスサイクルを低減することができる。
【0105】
第2発明のメモリバッファ装置によれば、第1発明と同様に、複数語のレジスタを有するロードデータバッファ部と、複数語の先入れ先出しバッファを有するストアデータバッファ部、およびこれらの制御部とから構成しているため、第1発明と同様の効果がある。また、ロード命令実行時でバッファミスが発生した場合に、ミスとなったメモリアドレスを含む1メモリブロック全体のデータの読み出しアクセスを行ってロードバッファ部に格納するようにしたので、次のような効果がある。即ち、ミスを起こしたメモリアドレスを含むメモリブロック全体を連続アクセスすることにより、例えば、スタックを用いた演算といった前方参照頻度と後方参照頻度とが同程度に高いプログラムの実行に対しては、ブロック全体を常に読みだすことで全体のバッファミス回数を低減することができる。
【0106】
第3発明のメモリバッファ装置によれば、中央処理装置からのデータ書き込み要求に対して、該当データが、ロードデータバッファ部内のレジスタのいずれかに存在する場合は、このデータを更新するようにしたので、このような場合は、メモリ装置にアクセスする必要がなく、従って、プログラム実行性能を向上させることができる。
【図面の簡単な説明】
【図1】本発明のメモリバッファ装置の実施形態1、2を示す構成図である。
【図2】本発明のメモリバッファ装置のロードバッファ部の構成図である。
【図3】本発明のメモリバッファ装置の実施形態1のロードバッファ制御部の構成図である。
【図4】本発明のメモリバッファ装置の実施形態1におけるロードデータバッファ有効フラグ部の構成図である。
【図5】本発明のメモリバッファ装置の実施形態1におけるLB0〜3セット信号生成部の構成図である。
【図6】本発明のメモリバッファ装置の実施形態1におけるストアバッファ部の構成図である。
【図7】本発明のメモリバッファ装置の実施形態1におけるストアバッファ制御部の構成図である。
【図8】本発明のメモリバッファ装置の実施形態1におけるストアバッファ信号生成部の構成図である。
【図9】本発明のメモリバッファ装置の実施形態1における動作(ロード時)の説明図である。
【図10】本発明のメモリバッファ装置の実施形態1における動作(ストア時)の説明図(その1)である。
【図11】本発明のメモリバッファ装置の実施形態1における動作(ストア時)の説明図(その2)である。
【図12】本発明のメモリバッファ装置におけるロード命令実行時のタイムチャート(バッファヒット)である。
【図13】本発明のメモリバッファ装置におけるロード命令実行時のタイムチャート(バッファミス)である。
【図14】本発明のメモリバッファ装置におけるストア命令実行時のタイムチャート(バッファヒット)である。
【図15】本発明のメモリバッファ装置におけるストア命令実行時のタイムチャート(バッファミス)である。
【図16】本発明のメモリバッファ装置の実施形態2におけるロードバッファ制御部の構成図である。
【図17】本発明のメモリバッファ装置の実施形態2における動作(ロード時)の説明図である。
【図18】本発明のメモリバッファ装置の実施形態2における動作(ストア時)の説明図(その1)である。
【図19】本発明のメモリバッファ装置の実施形態2における動作(ストア時)の説明図(その2)である。
【符号の説明】
100 ロードバッファ部
101 ロードデータバッファ部
102 ロードバッファ制御部
200 ストアバッファ部
201 ストアデータバッファ部
202 ストアバッファ制御部
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a memory buffer device for memory reading and memory writing in a computer.
[0002]
[Prior art]
In computers based on existing technology, memory operations are basically performed by reading data (load instruction execution) and writing data (store instruction execution) to an arbitrary memory address in units of one word, half word, or 1/4 word. . For this reason, a small-scale computer has a one-word memory register, and when executing a load instruction, the data read from the memory device is stored in this register, and the CPU (central processing unit) takes it in and stores it. In instruction execution, data to be written is temporarily stored in a register and written in a memory device.
For this reason, in the load instruction execution, the memory access time is reflected on the instruction execution time as it is for each CPU request, and in the store instruction execution, the time until the write data is stored in the register from the CPU is reflected in the instruction execution time. . However, when a load instruction or a store instruction is executed immediately after execution of the store instruction, the next memory operation is waited for the memory write time associated with execution of the previous store instruction.
[0003]
In a large-scale computer, a cache memory is installed, and load instructions and store instructions are executed through the cache memory. As a result, the CPU exchanges data in units of words with the cache memory, and the memory device exchanges data of a plurality of words (hereinafter referred to as data blocks) arranged at continuous memory addresses with the cache memory. I do. As a result, when the data requested by the load instruction exists in the cache memory (hereinafter referred to as a load cache hit), the load instruction is completed in a short time by a high-speed data response from the cache memory, and the store instruction In the case where a data block including data to be written exists in the cache memory (hereinafter referred to as a store cache hit), the store instruction can be completed by executing only the data write to the cache memory.
[0004]
When the load instruction is not a load cache hit (hereinafter referred to as a load cache miss), or when the store instruction is not a store cache hit (hereinafter referred to as a store cache miss), the memory device access time is the same as in a small computer. Is reflected in the instruction execution time or the memory operation immediately after.
[0005]
[Problems to be solved by the invention]
As described above, in the memory operation in the computer according to the prior art, the access time of the memory device is directly reflected in the instruction execution time for each load instruction in a small-scale computer, and for the memory write operation accompanying the store instruction execution Since execution of a load instruction or a store instruction that is continuous to this is awaited, there is a large problem of performance degradation due to execution time of a memory operation instruction. In addition, since the memory operation is performed in units of one word, the improvement of the memory throughput due to the memory operation over continuous words such as high-speed page access prepared in the DRAM device cannot be utilized.
In particular, in recent high operating frequency CPUs, there is a tendency for the difference between the instruction execution time executed only inside the CPU and the execution time of the memory operation instruction to increase, and this is the reason for the program execution despite the improvement of the CPU operating frequency. This is the reason why performance does not increase.
[0006]
On the other hand, in a large-scale computer, the cache memory is installed to fill the gap between the CPU operation and the memory operation. However, the chip size, chip cost, and power consumption by incorporating the cache memory in the same LSI as the CPU. The increase in device cost, the device volume, and the power consumption due to the increase of the cache memory or the outside of the CPU-LSI is a problem.
Further, with the improvement of the CPU operating frequency, the access time of the cache memory cannot follow this, and the number of clock cycles for executing the memory operation instruction is increased while the cache memory is installed.
[0007]
In view of the above, it has been desired to realize a memory buffer device that can reduce cost and power consumption and can improve program execution performance.
[0008]
[Means for Solving the Problems]
In order to solve the above-described problem, a memory buffer device according to a first aspect of the present invention includes a load buffer unit for reading data from a memory device, and a store buffer unit for writing to the memory device. , A load data buffer unit having a plurality of words independently readable and writable registers for storing data for one memory block, and any one of the registers in response to a data read request from the central processing unit to the memory device Is returned to the central processing unit, and if there is no corresponding data in any register, the memory device continuously sends the final data of the same memory block from the memory address of the read request data. Load buffer control unit that reads data up to address and stores them sequentially in registers The store buffer unit has a store data buffer unit including a first-in first-out buffer for storing a plurality of words as data for one memory block, and a write request to the memory device from the central processing unit in the first-in first-out buffer. When the corresponding data exists, it is updated, and the storage position is the last, and when the data of the same memory block of the corresponding data exists, the corresponding data is stored at the last, and the data in the first-in first-out buffer is When the memory block is different from the memory block of the corresponding data, the storage block control unit writes all the data stored in the first-in first-out buffer to the memory device and stores the data at the head position of the first-in first-out buffer. It is characterized by this.
[0009]
Since the memory buffer device according to the first aspect of the present invention is configured in this way, the load buffer unit has corresponding data in any of the registers in response to a data read request from the central processing unit to the memory device. If so, return it to the central processing unit. On the other hand, if there is no corresponding data in any register, the data from the memory address of the read request data to the last address of the same memory block is read from the memory device, and these are sequentially stored in the register. To do.
In response to a write request from the central processing unit to the memory device, the store buffer unit updates the corresponding data if it exists in the first-in first-out buffer, and sets the storage position at the end.
If the data in the same memory block as the write request data exists in the first-in first-out buffer, the corresponding data is stored at the end thereof.
On the other hand, if the data in the first-in first-out buffer is a memory block different from the memory block of the corresponding data, all the data stored in the first-in first-out buffer is written to the memory device, and the corresponding data is stored at the head position of the first-in first-out buffer. To store.
[0010]
In order to solve the above-described problem, the memory buffer device of the second invention includes a load buffer unit for reading data from the memory device, and a store buffer unit for writing to the memory device. , A load data buffer unit having a plurality of words independently readable and writable registers for storing data for one memory block, and any one of the registers in response to a data read request from the central processing unit to the memory device Is returned to the central processing unit, and if the corresponding data does not exist in any register, the entire memory block including the memory address of the read request data is read from the memory device. It consists of a load buffer control unit that reads and stores them in registers in sequence. The store data buffer unit has a first-in first-out buffer that stores a plurality of words as data for one memory block, and the corresponding data exists in the first-in first-out buffer in response to a write request from the central processing unit to the memory device. If the data is stored in the first-in / first-out buffer, the data is stored at the tail and the data is stored in the first-in first-out buffer. When the memory block is different from the block, it is characterized by comprising a store buffer control unit for writing all the data stored in the first-in first-out buffer to the memory device and storing the corresponding data at the head position of the first-in first-out buffer. To do.
[0011]
Since the memory buffer device according to the second aspect of the present invention is configured as described above, the load buffer unit has corresponding data in any of the registers in response to a data read request from the central processing unit to the memory device. If so, return it to the central processing unit. On the other hand, if there is no corresponding data in any register, the entire memory block including the memory address of the read request data is read from the memory device, and these are sequentially stored in the register.
The operation of the store buffer unit is the same as in the first invention.
[0012]
In order to solve the above-described problem, the memory buffer device of the third invention is the memory buffer device of the first or second invention, wherein the corresponding data in response to a data write request from the central processing unit to the memory device, In the case where it exists in any of the registers in the load data buffer unit, a load buffer control unit for updating this data is provided.
[0013]
Since the third invention is configured as described above, when there is a data write request from the central processing unit to the memory device, when the corresponding data exists in any of the registers in the load data buffer unit, Each time, only the data in the load data buffer unit is updated without writing to the memory device.
[0014]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
Embodiment 1
[Constitution]
FIG. 1 is a block diagram showing Embodiment 1 of the memory buffer device of the present invention and Embodiment 2 described later.
The illustrated apparatus shows a load buffer unit 100 and a store buffer unit 200, a central processing unit (hereinafter referred to as a CPU) 300, and a memory device 400 that constitute a memory buffer device.
[0015]
The load buffer unit 100 mainly works when executing a load instruction (memory read instruction) from the CPU 300, and the store buffer unit 200 works when executing a store instruction (memory write instruction) from the CPU 300.
That is, the load buffer unit 100 includes a load data buffer unit 101 having a plurality of words independently readable and writable registers for storing data for one memory block, and a plurality of registers in response to a memory read request from the CPU 300. If the corresponding data exists in any of the registers, it is returned to the CPU 300. If no corresponding data exists in any register, the memory device 400 continuously reads the same memory from the memory address of the data requested to be read. The load buffer control unit 102 reads out data up to the last address of the block and stores them sequentially in a register.
[0016]
When executing a load instruction, the CPU 300 asserts a request signal to the load buffer unit 100 (outputs “1”), negates a read / write signal (outputs “0”), and further sets a predetermined memory address. The address is output as follows. In response to this, the load buffer unit 100 asserts an acknowledge signal and outputs the load data requested by the CPU 300 to the CPU 300. When data is read from the memory device 400 when the load instruction is executed, a memory request is asserted from the load buffer unit 100 to the memory device 400, a memory read / write signal is negated, and a predetermined memory address is obtained. The memory address is output as follows.
In response to this, the memory device 400 asserts a memory acknowledge signal and outputs read data requested by the load buffer unit 100 to the load buffer unit 100.
[0017]
The store buffer unit 200 includes a store data buffer unit 201 having a first-in first-out buffer that stores a plurality of words as data for one memory block, and a write request from the CPU 300 to the memory device 400 in the first-in first-out buffer. When the corresponding data exists, it is updated, and the storage position is the last, and when the data of the same memory block of the corresponding data exists, the corresponding data is stored at the last, and the data in the first-in first-out buffer is When the memory block is different from the memory block of the corresponding data, all the data stored in the first-in first-out buffer is written in the memory device 400, and the corresponding data is stored at the head position of the first-in first-out buffer; It has.
[0018]
When executing a store instruction, the CPU 300 asserts a request signal to the store buffer unit 200 (outputs “1”), asserts a read / write signal (outputs “1”), and writes data to be written, that is, Store data is output, and an address is output so that a predetermined memory address is obtained. In response to this, the store buffer unit 200 asserts an acknowledge signal and outputs it to the CPU 300. When data is written to the memory at the time of execution of the store instruction, the memory request is asserted from the store buffer unit 200 to the memory device 400, the memory read / write signal is asserted, and the write data is set to become the data to be written. And a memory address is output so that a predetermined memory address is obtained. In response to this, the memory device 400 asserts a memory acknowledge signal and outputs it to the load buffer unit 100.
[0019]
FIG. 2 is a configuration diagram of the load buffer unit 100.
The load buffer unit 100 includes the load data buffer unit 101 and the load buffer control unit 102 as described above.
In the first embodiment, the load data buffer unit 101 includes a four-word data register (LB0 to LB3), a load buffer input selector 101a, and a load buffer output selector 101b. In the present invention, the number of data words is as follows. The number of words is not limited to four, and an arbitrary number of one or more words can be taken.
[0020]
In the first and second embodiments, the load data buffer unit 101 can temporarily store four words of memory data. One word of data read from the memory device 400 or two to two of the data read continuously. Stores 4 words of data. When the data stored in the data registers LB0 to LB3 includes a copy of the data stored in the memory address specified by the address from the CPU 300 when the load instruction is executed from the CPU 300, the memory device Data is not read from 400, and one of the outputs of the four data registers LB0 to LB3 for storing data specified by the CPU 300 is selected by the load buffer output selector 101b and output to the CPU 300 as load data.
[0021]
In addition, when the store instruction is executed, when data is read from the same memory address as that of the store data and stored in the data registers LB0 to LB3, a new one is stored to maintain data consistency. Store data must also be stored in the corresponding register. In the present embodiment, this is hereinafter referred to as a store bypass operation. The load buffer input selector 101a selects either read data at the time of reading from the normal memory device 400 or store data from the CPU 300 at the time of store bypass operation, and outputs the selected data to the data registers LB0 to LB3.
[0022]
The load buffer control unit 102 has a function of inputting / outputting control signals to / from the CPU 300 and the memory device 400 and controlling the load data buffer unit 101. A store bypass signal, LB 0 to 3 sets, and a load address offset signal are output from the load buffer control unit 102 to the load data buffer unit 101. The store bypass signal is an input selection signal to the load buffer input selector 101a. When it is “0”, read data is selected, and when it is “1”, store data is selected and output to LB0-3. The LB0 to 3 set signals are data set signals to the data registers LB0 to LB3, respectively, and input data is newly stored at the rising edge of this signal. The lower two bits (hereinafter referred to as a small address) of the address from the CPU 300 serve as a selection signal to the load buffer output selector 101b, and selects one of the outputs of LB0 to LB3.
[0023]
FIG. 3 is a configuration diagram of the load buffer control unit 102.
4 and 5 are configuration diagrams of the load data buffer valid flag portion and the LB0 to 3 set signal generation portions in FIG. 3, respectively.
The load buffer control unit 102 inputs / outputs control signals to / from the CPU 300 and the memory device 400, and controls the load data buffer unit 101. The load address control unit 102a, a load data buffer valid flag (hereinafter referred to as V) (Denoted as a flag) unit 102b, LB0 to 3 set signal generation unit 102c, and a sequence control unit.
[0024]
That is, the load buffer control unit 102 shown in these drawings includes AND circuits 1 to 21, OR circuits 31 to 35, buffers 41 to 44, block address buffer 45, offset address buffer 46, tag register 51, and V0 register (V0). ~ V3 register (V3), memory request register 52, small address selector 61, V flag selector 62, small address decoder 71, offset address decoder 72, small address decoder 73, offset address counter 81, and comparator 91.
[0025]
In FIG. 3, A1 indicates an acknowledge, A2 indicates a large address (block address), A3 indicates a read / write, A4 indicates a request, and A5 indicates a small address. B1 is a memory block address, B2 is a memory offset address, B3 is a memory request, B4 is memory read / write, B5 is memory busy, B6 is store bypass, B7 is memory acknowledge, and B8 to B11 are LB0 set to LB3 set. Is shown.
[0026]
The memory address coincidence checking unit 102 a is configured by a tag register 51 and a comparator 91.
The tag register 51 is a register for temporarily storing a signal (large address) excluding the lower 2 bits of the address input from the CPU 300, and a memory device for data of 1 to 4 words stored in the load data buffer unit 101. The block address arranged on 400 is held. The comparator 91 is an Ex-NOR circuit, and compares the large address (block address) stored in the tag register 51 with the value excluding the lower 2 bits of the address input from the CPU 300, and the two match. Check for no. That is, it is checked whether or not a part or all (four words) of a copy of data arranged at a block address input from the CPU 300 at the time of execution of a load instruction or a store instruction is stored in the load data buffer unit 101. It is. Hereinafter, a case where the above inspection results match is referred to as a load data buffer hit, and a case where the result is not the case is referred to as a load data buffer miss.
[0027]
As shown in FIG. 4, the V flag unit 102 b includes V0 to 3 registers (V0 to 3), a small address selector 61, a small address decoder 71, AND circuits 3 to 6, and a V flag selector 62.
The V0 to 3 registers (V0 to V3) have V0 to 3 flags for indicating whether or not the contents of the copy of the memory data stored in the LB0 to LB3 of the load data buffer unit 101 are valid. This corresponds to the data register specified by the lower 2 bits (hereinafter referred to as the small address) of the address input from the CPU 300 when the load data hits, that is, one of LB0 to LB. When the V flag is “1”, this indicates that the contents of the data register are valid.
[0028]
On the other hand, if the corresponding V flag is “0”, the data requested by the CPU 300 is not stored in the data registers LB0 to 3 even when the load data hits, and the memory device 400 is accessed. Need to read data. The small address selector 61 selects a 2-bit selection signal for selecting a register in which the V flag is to be set from the V0 to 3 registers V0 to V3. When storing in LB0-3, the output of the offset address counter 81 (sequence control unit) is selected, and the small address input from the CPU 300 is selected during the store bypass operation. The small address decoder 71 decodes the output of the small address selector 61. The AND circuits 3 to 6 take logical products of the output of the small address decoder 71 (one of the four outputs is “1”) and the output of the OR circuit 31 of the sequence control unit (described later). Are connected to the set inputs of the V0-3 registers V0-V3, respectively.
[0029]
At the time when the output of the OR circuit 31 is asserted, one of the AND circuits 3 to 6 becomes “1”, and one of the corresponding V0 to 3 registers V0 to V3 becomes “1” at the rising edge of this signal. Set. The other three of the V0 to V3 registers V0 to V3 store the previous contents. The reset inputs of the V0 to 3 registers V0 to V3 are connected to the output of the AND circuit 9 of the sequence control unit (the set input of the memory request register 52: described later), and V0 to V0 when the output of the AND circuit 9 is asserted. The contents of 3 are all “0”.
The V flag selector 62 selects and outputs one of the four outputs of the V0-3 registers V0-V3, and uses the small address input from the CPU 300 as a selection signal. If the output of the V flag selector 63 is “1” at the time of the load buffer hit, it indicates that a copy of the memory data requested by the CPU 300 with the load instruction is stored in the corresponding load data buffer unit 101.
[0030]
As shown in FIG. 5, the LB0-3 set signal generation unit 102c includes an offset address decoder 72, a small address decoder 73, AND circuits 14-21, and OR circuits 32-35, and load data buffers LB0-3 LB0-3. A data set signal is generated.
[0031]
The offset address decoder 72 decodes the 2-bit output of the offset address counter 81 of the sequence control unit. The offset address counter 81 is the lower two bits of the memory address when reading data from the memory device 400. The offset address counter 81 is a position in the memory block where data is actually read from the memory device 400 (hereinafter referred to as the memory offset). ).
[0032]
The AND circuits 14 to 17 each perform a logical product of the output of the offset address decoder 72 (any one of the four outputs becomes “1”) and the AND circuit 11 (described later) of the sequence control unit. Therefore, a set signal for storing the read data read from the memory device 400 in the corresponding registers of the data registers LB0 to LB3 is generated.
[0033]
The small address decoder 73 decodes the 2-bit small address input from the CPU 300, and is one of the data registers LB0 to LB3 corresponding to the data write position (memory offset) in the memory block during the store bypass operation. To choose one.
[0034]
The AND circuits 18 to 21 each perform a logical product of the output of the small address decoder 73 (any one of the four outputs becomes “1”) and the AND circuit 13 (described later) of the sequence control unit. Therefore, a set signal for bypassing the store data input from the CPU 300 during the store bypass operation and storing it in the corresponding registers of the data registers LB0 to LB3 is generated.
The OR circuits 32 to 35 take the logical sum of the outputs of the AND circuits 14 to 17 and the AND circuits 18 to 21, respectively. The outputs of the OR circuits 32 to 35 are sent to the data registers LB0 to LB3 as LB0 to 3 set signals. Each is output.
[0035]
The sequence control unit performs input / output of control signals to / from the CPU 300 and the memory device 400, performs read operation control on the memory device 400, and controls operation of the load data buffer unit 101. The sequence circuits 1-2 shown in FIG. 7-13, memory request register 52, buffers 41-44, block address buffer 45, offset address buffer 46, OR circuit 31, and offset address counter 81.
[0036]
In the sequence control unit, first, the AND circuit 1 performs a logical product of the request signal from the CPU 300 and the inverted signal of the read / write signal to generate a read request signal. The read / write signal indicates read when “0” and write when “1”. Therefore, when the read request signal is “1”, it is recognized that the load instruction is executed from the CPU 300.
[0037]
In the AND circuit 2, the logical product of the request signal from the CPU 300, the read / write signal, and the output of the comparator 91 of the memory address match checking unit 102a (hereinafter, this output is referred to as a tag match signal) is obtained. Is generated. When the store bypass signal is asserted, a store bypass operation is performed. That is, the store bypass operation is performed because the write instruction and the block address match.
[0038]
The AND circuit 7 performs an AND operation between the output of the comparator 91 of the address match checking unit 102a and the valid signal that is the output of the V flag selector 62 of the V flag unit 102b. When the output of the AND circuit 7 is “1”, it indicates that a copy of the data in the memory device 400 arranged at the address input from the CPU 300 exists in the corresponding registers of the data registers LB0 to LB3. That is, the load data buffer hits and the V flag is “1”.
[0039]
The AND circuit 8 performs a logical product of the output of the AND circuit 7 and the output of the AND circuit 1 (read request signal). When the output of the AND circuit 8 is “1”, data reading from the memory device 400 is not performed, and this signal is output to the CPU 300 by the buffer 41 as a drive acknowledge signal. At this time, the load buffer output selector 101b in the load buffer unit 100 of FIG. 2 selects the data register output specified by the small address input from the CPU 300 from the data registers LB0 to LB3, and sends it to the CPU 300 as load data. Output.
[0040]
Here, the acknowledge signal and the request signal are in a handshake relationship. That is, the request signal is asserted by the CPU 300, and the memory buffer device operates. When this is completed, an acknowledge signal is asserted in the memory buffer device. The CPU 300 negates the request signal when the acknowledge signal is asserted. In the memory buffer device, the acknowledge signal is negated when the request signal is negated. In the state where the acknowledge signal is negated, the CPU 300 asserts the next memory request.
As described above, the memory request signal and the acknowledge signal are used to synchronize the operation for each data access of one word between the CPU 300 and the memory buffer device.
[0041]
In the AND circuit 9, the logical product of the inverted signal of the output of the AND circuit 7, the read request signal output from the AND circuit 1, and the inverted signal of the memory busy is obtained. This output indicates that the data that needs to be read by the load instruction from the CPU 300 does not exist in the load data buffer unit 101 and the memory device 400 is accessible at that time.
The memory busy signal is a signal common to the load buffer unit 100 and the store buffer unit 200. The memory request register 52 is set to “1” (hereinafter, set to “1”) when the output of the AND circuit 9 is asserted when either of them is accessing the memory device 400. That it is set is simply set, and that it is set to “0” is reset). In other words, since the load data buffer is missed, it is necessary to read out the data requested by the CPU 300 from the memory device 400, and the memory device 400 is activated by setting the memory request register 52.
[0042]
The output of the AND circuit 9 is further connected to the clock input of the tag register 51, the reset input of the V0-3 registers V0 to V3, and the load input of the offset address counter 81. The tag register 51 newly stores a large address input from the CPU 300 when the output of the AND circuit 9 is asserted, that is, when the memory request register 52 is set.
The output of the tag register 51 is driven by the block address buffer 45 while the M request signal output from the memory request register 52 is asserted, and is output to the memory device 400 as a memory block address. The V0-3 registers are all cleared when a new memory access to the memory device 400 is started, that is, when the output of the AND circuit 9 is asserted, and the contents thereof become “0”.
[0043]
The offset address counter 81 sets a 2-bit small address input from the CPU 300 when the output of the AND circuit 9 is asserted. The output of the offset address counter 81 is driven by the offset address buffer 46 and is output to the memory device 400 as a memory offset address. This signal is input to the offset address decoder 72, and becomes a selection signal for LB0 to LB3 when the read data from the memory device 400 is stored in the load data buffer unit 101. Further, this signal is input to the small address selector 61 and becomes a selection signal for the V0-3 registers V0-V3 when the V flag is set when read access to the memory device 400 is performed.
[0044]
The M request signal that is the output of the memory request register 52 is ANDed with the inverted signal of the memory acknowledge in the AND circuit 12, is driven by the buffer 42, and is output to the memory device 400 as a memory request signal. The memory acknowledge signal is a signal input from the memory device 400. When this signal is asserted, it indicates that a predetermined operation in the memory device 400 is completed. The memory request signal is a signal common to the load buffer unit 100 and the store buffer unit 200, and indicates that either of them requests access to the memory device 400.
[0045]
The memory request signal and the memory acknowledge signal have a handshake relationship. That is, the memory request signal is asserted in the memory buffer device (load buffer unit 100 or store buffer unit 200), and the memory device 400 operates. When this is completed, the memory device 400 asserts a memory acknowledge signal. In the memory buffer device, when the memory acknowledge signal is asserted, the memory request signal is negated. The memory device 400 negates the memory acknowledge signal when the memory request signal is negated. The memory buffer device asserts the next memory request in a state where the memory acknowledge signal is negated. As described above, the memory request signal and the memory acknowledge signal are used to synchronize operations for each data access of one word between the memory buffer device and the memory device 400. Therefore, the two signals are turned on and off every memory cycle.
[0046]
The inverted signal of the M request is driven by the buffer 43 and output to the memory device 400 as a memory read / write signal. The memory read / write signal is “0” while the M request signal is “1”. The M request signal is driven by the buffer 44 and asserts a memory busy signal. The memory read / write signal and the memory busy signal are not turned on / off every memory cycle, and are continuously driven while the M request signal is asserted. These are asserted for 1 to 4 memory cycles in order to make consecutive memory accesses in the memory block between the memory buffer device and the memory device 400.
[0047]
The M request signal is further connected to an input of the AND circuit 11 and a selection input of the small address selector 61. The AND circuit 11 performs an AND operation between the M request signal and the memory acknowledge signal. This output indicates that the read access operation in the memory device 400 is completed by asserting this signal as a read acknowledge signal. The small address selector 61 selects and sets any one of the V0 to V3 registers, selects the output of the offset address counter 81 at the time of read access to the memory device 400, and sets the store bypass. Sometimes a small address input from the CPU 300 is selected and output to the small address decoder 71. An M request signal is used as a selection signal for this purpose.
[0048]
The read acknowledge signal, which is the output of the AND circuit 11, is connected to the input of the AND circuit 10, the input of the OR circuit 31, the clock input of the offset address counter 81, and the inputs of the AND circuits 14-17. The AND circuit 10 performs a logical product of the read acknowledge signal and the output 3 of the offset address decoder 72 (asserted when the input signal is “11”). The output of the AND circuit 10 is a read signal, and by asserting this signal, read access is started from the data requested by the CPU 300 from the memory device 400 and the maximum memory address of the memory block, that is, the lower 2 bits of the memory address is “11”. Indicates that read access has been completed.
[0049]
The read signal is input to the reset input of the memory request register 52, and the memory request register 52 is reset when the signal rises. The output M request signal is negated.
In the OR circuit 31, the logical sum of the read acknowledge signal and the output of the AND circuit 13 is taken. The output of the OR circuit 31 is input to the AND circuits 3 to 6 of the V flag unit 102b, and becomes a timing signal for asserting the set input to the V0 to 3 registers V0 to V3.
[0050]
The read acknowledge signal that is the output of the AND circuit 11 is used as a V flag set timing signal when the memory device 400 is read-accessed. The offset address counter 81 is used to generate an offset address to be output to the memory device 400 and to count the number of cycles when memory access is continuously performed. In the first embodiment, in memory access, data arranged from the memory address in which a load buffer miss occurs to the maximum address of the memory block is continuously read-accessed and stored in the load data buffer unit 101.
[0051]
The AND circuit 13 takes a logical product of the store bypass signal and the acknowledge signal. The acknowledge signal at this time is driven and asserted by the store buffer unit 200 when the store instruction is executed. The output of the AND circuit 13 is connected to the input of the OR circuit 31 and the inputs of the AND circuits 18 to 21 of the LB0 to 3 set signal generation unit 102c. The OR circuit 31 is input as a V flag set timing signal during store bypass. The AND circuits 18 to 21 serve as timing signals for asserting LB0 to 3 set signals for bypassing store data input from the CPU 300 and storing in the load data buffer unit 101 during store bypass.
[0052]
FIG. 6 is a configuration diagram of the store buffer unit 200.
As described above, the store buffer unit 200 includes the store data buffer unit 201 and the store buffer control unit 202.
The store data buffer unit 201 includes a queue (FIFO: first-in first-out memory). In this embodiment, a 4-word data register (SB0-3), four small address registers (2 bits each: SB0-3A), and three data selectors (SB1-3B) are connected in series to store data The part of the queue that stores the lower 2 bits of the write destination memory address, that is, the small address, and the contents of the small address input from the CPU 300 and already stored in the small address registers SB0 to 3A. Although it is composed of matchers SB0 to 3C that perform comparison with the contents of the small address, in the present invention, the number of data words is not limited to four words, and it is possible to take an arbitrary number of one or more words. .
[0053]
When the large address input when executing the store instruction from the CPU 300, that is, the value excluding the lower 2 bits of the memory address, and the address of the write destination memory block of the data stored in the queue, that is, the memory block address are the same In this case, data is not written to the memory device 400, and new store data and an offset address in the write destination memory block (hereinafter simply referred to as an offset address), that is, input from the CPU 300 are input at the end of the queue. Write the contents of the small address.
[0054]
At this time, the data already stored in the queue and the offset address are shifted toward the head of the queue for one word. When both the memory block address and the offset address are equal to the large address and small address input from the CPU 300, that is, store data to the same memory address as the memory address given by the store instruction is already stored in the queue. If so, the data is overwritten with subsequent store data. That is, new store data for the same memory address is stored in the queue without actually being written to the memory device 400.
[0055]
The match check between the large address and the memory block address is performed by the store buffer control unit 202, and the match check between the small address and the memory offset address is performed by the matchers SB0 to 3C. When the match is confirmed in any of the matchers SB0 to 3C, the matchers SB0 to 3C corresponding to the matched store buffers SB (collectively referring to the data registers SB0 to 3 and the small address registers SB0 to 3A) are stored. Either is asserted.
When new data is stored in the queue, the data selectors SB0 to 3B select store data and small addresses input from the CPU 300 for the input to the store buffer SB, and other store buffers. For SB, the output of the next store buffer SB is selected and output.
[0056]
The store buffer control unit 202 inputs / outputs control signals to / from the CPU 300 and the memory device 400 and controls the store data buffer unit 201.
The store buffer control unit 202 outputs the SB0-3 clock signal and the SB1-3 set signal to the store data buffer unit 201, and the store data buffer unit 201 outputs the SB0-3 match signal to the store buffer control unit 202. Is output. The SB0-3 clock signals are clock signals for the data registers SB0-3 and small address registers SB0-3A. The data registers SB0 to SB3 and the small address registers SB0 to 3A store inputs at the rising edge of the clock signal. The SB1 to 3 set signals are selection signals for the data selectors SB1 to SB3. When “1”, the store data input from the CPU 300 and the small address are selected. When “0”, the subsequent signals connected in series are selected. Select the output of the register. The SB0-3 match signal is “1” when the matcher inputs match the output signals of the matchers SB0-3C.
[0057]
FIG. 7 is a configuration diagram of the store buffer control unit 202.
FIG. 8 is a configuration diagram of the store buffer signal generation unit 202b in FIG.
In these figures, the store buffer control unit 202 inputs / outputs control signals to / from the CPU 300 and the memory device 400 and controls the store data buffer unit 201. The memory address match check unit 202a, the store buffer signal The generation unit 202b and a sequence control unit are included.
[0058]
That is, the store buffer control unit 202 shown in these drawings includes AND circuits 1 to 18, OR circuits 31 to 40, buffers 41 to 43, block address buffer 44, tag register 51, memory request register 52, selectors 63 to 66, A write buffer tail decoder 74, a write buffer pointer 82, and a comparator 91 are provided.
In FIG. 7, A1 is a large address, A2 is an acknowledge, A3 is a request, A4 is a read / write, A5 to A8 are SB0 match to SB3 match, B1 is a memory block address, B2 is a memory read / write, B3 is a memory busy, B4 is a memory request, B5 is a memory acknowledge, B6 to B8 are SB1 set to SB3 set, and B9 to B12 are SB0 clock to SB3 clock.
[0059]
The memory address match checking unit 202a has the same configuration and operation as the memory address match check unit 102a of the load buffer control unit 102 shown in FIG. Description of is omitted.
[0060]
The store buffer signal generation unit 202b is a circuit that generates SB0-3 clocks and SB1-3 set signals. As shown in FIG. 8, the write buffer tail decoder 74, AND circuits 12-14, and OR circuits 35-40 , Selectors 63 to 66 and AND circuits 15 to 18.
The write buffer tail decoder 74 is a 2-4 decoder, and decodes a 2-bit input signal indicating the last position of the write data buffer queue composed of the store buffer SB counted by the write buffer pointer 82 of the sequence control unit. Therefore, the store buffer SB corresponding to one of the four outputs asserted is the tail of the queue.
[0061]
The AND circuits 12 to 14 generate SB1 to 3 set signals, and 1 to 3 outputs of the write buffer tail decoder 74 (asserted when the input is “01”, “10”, and “11”, respectively). The logical product with the output (described later) of the AND circuit 1 of the sequence control unit is obtained. Here, when there is a signal “1” among the outputs of the AND circuits 12 to 14, store data and small addresses input from the CPU 300 are selected in the data selectors SB 1 to 3 B of FIG. SB1 to SB3 and small address registers SB1 to 3A are input to corresponding registers.
[0062]
On the other hand, since the data register SB0 and the small address register SB0A are installed at the entrance of the queue, the subsequent registers are not connected to the input. Accordingly, when data is stored in the data register SB0 and the small address register SB0A, store data and a small address input from the CPU 300 are always input.
[0063]
The OR circuits 35 to 37 select generation of SB0 to 3 clock signals to be output to the store buffer SB when new data is stored in the queue and when the contents of the queue are shifted out and written to the memory device 400. This is the part that takes logic. When new data is stored in the queue, the clock signal is supplied to the store buffer SB connected before the register indicated by the value of the write buffer pointer 82, that is, in the head direction of the queue. Also, when the contents of the queue are shifted out and written to the memory device 400, only the data already stored in the queue is shifted in the head direction unless new data to be written from the outside is input from the CPU 300. To do. Therefore, also in this case, the clock signal is supplied to the store buffer SB connected before the register indicated by the value of the write buffer pointer 82, that is, in the head direction of the queue. By taking such logic in the OR circuits 35 to 37, invalid data is not stored in the queue even when the contents of the queue are written to the memory device 400.
[0064]
In the OR circuits 38 to 40, selection of SB0 to 3 clock signal generation in the case of executing a store instruction for the same memory address as the write memory address in the memory device 400 of data already stored in the queue is performed. In this case, in order to overwrite the queue contents, SB0-3 clock signals are generated in accordance with one to four signals asserted among the SB0-3 matches input from the store data buffer unit 201.
[0065]
That is, when only the store buffer SB0 is asserted, only the SB0 clock is generated, and when only the store buffer SB1 or both the store buffers SB0 and SB1 are asserted, the SB0 clock and the SB1 clock are generated. If only store buffer SB2, both store buffers SB2, SB1, or three store buffers SB2, SB1, and SB0 are asserted, three of SB0 clock, SB1 clock, and SB2 clock are generated and stored Only the buffer SB3, both the store buffers SB3 and SB2, the three store buffers SB3, SB2 and SB1, or the store buffer SB3, SB2, SB1 and the store buffer SB0 are all asserted when the SB0 clock is asserted. , SB1 clock, SB2 clock, and SB3 all clocks are generated.
[0066]
As a result, newly written data is stored at the tail end of the queue indicated by the write buffer tail signal (output of the write buffer pointer 82), and the original store data is overwritten on the subsequent store data.
The selectors 63 to 66 are selection circuits for signals generated through the two systems of SB0 to 3 clock generation selection circuits. When the output (described later) of the AND circuit 3 of the sequence control unit is “1”, that is, the queue When the store data stored in is overwritten, the outputs of the OR circuits 38 to 40 and the SB3 match signal are selected and output to the AND circuits 15 to 18. On the other hand, when the output of the AND circuit 3 is “0”, that is, when new store data is stored in the queue, or when the store data stored in the queue is sequentially written in the memory device 400, The 0 output of the write buffer tail decoder 74 and the OR circuits 35 to 37 are selected and input to the AND circuits 15 to 18. The AND circuits 15 to 18 AND the outputs of the selectors 63 to 66 and the output (described later) of the OR circuit 34 of the sequence control unit, and output SB0 to 3 clocks to be output to the store data buffer unit 201. Generate. The output of the OR circuit 34 is a signal that determines the assert timing of the clock supplied to the store buffer SB.
[0067]
The sequence control unit performs input / output of control signals to / from the CPU 300 and the memory device 400, controls writing operation to the memory device 400, and controls operation of the store data buffer unit. The sequence control unit includes AND circuits 1 to 11, OR circuits 31 to 34, a memory request register 52, buffers 41 to 43, a block address buffer 44, and a write buffer pointer 82 shown in FIG.
[0068]
In the sequence control unit, first, the AND circuit 1 calculates the logical product of the request signal from the CPU 300 and the read / write signal, and generates a write request signal. When the write request signal is “1”, it is recognized that the store instruction is executed from the CPU 300. In addition, the OR circuit 31 calculates the logical sum of all the SB0-3 match signals input from the store data buffer unit 201. The output of the OR circuit 31 is an offset address match signal, and the store data buffer unit 201 (queue) is newly written in the lower 2 bits of the memory address requested by the CPU 300, that is, the same address within the memory block as the small address. For example, this signal is asserted when store data for a memory offset address is already stored in the queue.
[0069]
The AND circuit 2 takes a logical product of the output of the comparator 91 of the memory address match checking unit 202a and the inverted signal of the offset address match output from the OR circuit 31. The output of the AND circuit 2 is that the tag match signal is “1”, that is, the contents of the memory block address stored in the tag register 51 and the contents of the large address input from the CPU 300 are the same, but the small address and the queue This means that the contents of the memory offset addresses stored in the small address registers SB0 to 3A do not match. That is, this is a case where a store instruction for writing to a new intra-block offset address of the same memory block as the store data stored in the queue is executed. In this case, the input store data and the contents of the small address are stored in the queue. The storage destination store buffer SB at this time is indicated by a write buffer tail signal that is an output of the write buffer pointer 82.
[0070]
The AND circuit 3 takes the logical product of the output of the comparator 91 of the memory address match checking unit 202a and the offset address match signal. The output of the AND circuit 3 is asserted as an address match signal when the address input from the CPU 300 matches the memory address stored in the tag register 51 and the queue. In this case, the store data already stored in the queue is overwritten, and the store data newly input from the CPU 300 is stored at the end of the queue specified by the write buffer tail signal.
[0071]
The AND circuit 4 takes a logical product of the inverted signal of the output of the comparator 91 of the memory address coincidence inspection unit 202a, the write request signal that is the output of the AND circuit 1, and the memory busy signal. The memory busy signal is a signal common to the load buffer unit 100 and the store buffer unit 200 as described in the load buffer unit 100.
[0072]
The AND circuit 5 calculates the logical product of the output of the AND circuit 1 and the output of the AND circuit 2, and outputs an enqueue signal. The AND circuit 6 calculates the logical product of the output of the AND circuit 1 and the output of the AND circuit 3, and outputs an overwrite signal. The output of the AND circuit 3 is used as a selection signal for the selectors 63 to 66 of the store buffer signal generation unit 202b. The enqueue signal is output to the OR circuit 34 and the OR circuit 32. The overwrite signal is input to the OR circuit 34. The OR circuit 34 takes a logical sum of these two signals and an output (described later) of the AND circuit 10, and outputs a shift timing signal.
[0073]
The shift timing signal is input to the AND circuits 15 to 18 of the store buffer signal generation unit 202b, and gives the assert timing of the SB0 to 3 clock signals. The shift timing signal is further output to the AND circuit 7. The AND circuit 7 calculates the logical product of the write request signal and the shift timing signal, is driven by the buffer 41, and outputs the result as an acknowledge signal to the CPU 300. The output of the AND circuit 4 is output to the set input (S input) of the memory request register 52 and the OR circuit 32. The memory request register 52 is set at the rising edge of the set input and asserts the M request signal. Similar to the M request signal of the load buffer control unit 102, the M request signal is an activation signal for performing write access to the memory device 400.
[0074]
The M request signal drives the output of the tag register 51 as an enable signal of the block address buffer 44, outputs the memory large address to the memory device 400, is driven by the buffer 42, and outputs the memory read / write signal to the memory device 400. Then, it is output to the AND circuit 11 and logically ANDed with the inverted signal of the memory acknowledge input from the memory device 400, driven by the buffer 43, and output to the memory device 400 as a memory request signal.
[0075]
The memory request signal and the memory acknowledge signal are handshake signals as described in the load buffer unit 100. The M request signal is further output to the AND circuit 10. The AND circuit 10 calculates the logical product of the M request signal and the memory acknowledge signal, and outputs a write acknowledge signal. The write acknowledge signal is a signal indicating that the operation for the request signal for the memory write access request output from the store buffer unit 200 is completed, and it is recognized that the memory operation is completed at the rising edge of this signal.
[0076]
The output of the AND circuit 10, that is, the write acknowledge signal is output to the OR circuit 34, the AND circuit 8, and the AND circuit 9. The OR circuit 34 generates a shift timing signal. When the write acknowledge signal is asserted and input to the OR circuit 34, it indicates that the write access to the memory device 400 is completed. The shift timing signal is asserted and output to the AND circuits 15 to 18 to give the assert timing of the SB0 to 3 clock signals. The shift timing signal is output to the AND circuit 7.
When the write acknowledge signal is asserted, the shift timing signal is asserted, and when the AND output with the write request is asserted in the AND circuit 7, the acknowledge signal for the execution of the store instruction accompanied with the writing to the memory device 400 Is asserted, driven by the buffer 41, and output to the CPU 300. The acknowledge signal in this case is asserted when the first word of the store data buffer (queue) is completely written to the memory device 400.
[0077]
The output of the AND circuit 10, ie, the write acknowledge signal, is ANDed with the output of the write buffer tail decoder 74, ie, the last access signal, in the AND circuit 8, and the AND circuit 9 performs the AND operation on the last access signal. The logical product with the inverted signal is taken. The output of the AND circuit 8 is a write to an old memory data block stored in a store data buffer (queue) to the memory device 400 (different from the write destination memory data block of data newly requested by the CPU 300). Asserted upon completion of the last memory access. The output of the AND circuit 9 is asserted when memory access other than the last of the memory write is completed. The output of the AND circuit 8 is a write-dan signal, and is output to the reset input of the memory request register 52 and the OR circuit 33. The output of the AND circuit 9 is output to the OR circuit 32.
[0078]
The memory request register 52 is reset when the reset input rises. When the memory request register 52 is reset, the M request signal is negated, thereby completing one to four memory writes to the memory device 400 and negating the memory busy signal. The OR circuit 32 takes the logical sum of the output of the AND circuit 4, that is, the set input to the memory request register 52, and the output of the AND circuit 9, and the output is an up input to the write buffer pointer 82. Connected to. The OR circuit 33 takes the logical sum of the output of the AND circuit 5, that is, the enqueue signal, and the output of the AND circuit 8, that is, the write-in signal, and the output is a down input to the write buffer pointer 82. Connected.
[0079]
The write buffer pointer 82 generates a 2-bit write buffer tail signal for indicating the tail end of the store data buffer (queue). The counting operation by the write buffer pointer 82 is shown below. Store data buffers are numbered in the order of 3, 2, 1, 0 from the head position (exit). Therefore, the queue structure entry (not necessarily the tail; the tail is the queue entry during operation) is zero. The tail of the queue usually indicates an SB to which data can be written next. Therefore, the write buffer pointer is updated when data is inserted (one number is decreased), and is prepared for the next data insertion, and is updated when data is written to the memory device 400 (one number is increased).
[0080]
[A. Initial state, ie immediately after power-on]
Since no data is written, it becomes 3.
[B. When executing a store instruction to the same memory block as the contents of the tag register]
(B-1. When the small address is the same as one of the small address registers SB0 to 3A): Since data is overwritten, there is no increase or decrease.
(B-2. When the small address is not the same as any of the small address registers SB0 to 3A): 1 is subtracted because data is inserted.
[0081]
[C. When executing a store instruction to a memory block different from the contents of the tag register]
{Circle around (1)} First, it is incremented by 1 (data insertion into the queue and shifting of the original queue content toward the head, ie, preparation of a pointer for shifting out the queue content of one word).
{Circle around (2)} A write access to the memory device 400 is performed, and is incremented by 1 each time a memory acknowledge is asserted (a pointer is prepared to shift out the queue contents. Write data to a new memory block is inserted). The increase continues until the pointer value becomes 3.
(3) When the value of the pointer is 3, when the memory acknowledge signal is asserted during memory write access, 1 is subtracted to 2, and the memory write access is completed. That is, all the write data to the previous memory block is written to the memory device 400, the write data to the new memory block advances to the head of the queue, and the pointer value becomes 2 in preparation for the insertion of the next data ( The second SB2 from the head of the queue is shown).
[0082]
In the above description, the output of the AND circuit 5, that is, the enqueue signal is asserted at b-1, the output of the AND circuit 4 is asserted at c- <1>, and the AND circuit 9 at c- <2>. And the output of the AND circuit 8, that is, the write-dan signal is asserted, and the up-input or down-input of the write buffer pointer 82 via the OR circuit 32 or the OR circuit 33. And the necessary counting operation is performed by the write buffer pointer 82.
[0083]
[Operation]
9 to 11 are explanatory diagrams showing the operation of the first embodiment. FIG. 9 shows the operation during loading, and FIGS. 10 and 11 show the operation during storage.
When executing the load instruction, the contents of the V flag (“1”) in the case where the contents of the tag register 51 of the load buffer unit 100 and the contents of the large address input from the CPU 300 match or do not match, and the large address matches. The operation differs depending on whether it is valid or invalid when “0”.
[0084]
When the store instruction is executed, the contents of the tag register 51 of the store buffer unit 200 and the contents of the large address input from the CPU 300 match or do not match, and these and the memory offset address stored in the queue and the CPU 300 input. The operation differs depending on whether the contents of the small addresses match or do not match. Furthermore, when the store instruction is executed, the operation is further different depending on whether the contents of the tag register 51 of the load buffer unit 100 and the contents of the large address input from the CPU 300 match or do not match. 9 to 11 show combinations and operations of these.
[0085]
12 and 13 are time charts at the time of execution of a load instruction in the first embodiment and a second embodiment to be described later.
FIG. 12 shows an operation in the case of a buffer hit. In this case, the memory device 400 is not read-accessed, and necessary data in the load data buffer unit 101 is selected and output to the CPU 300. In FIG. 12, the request signal and the acknowledge signal have a handshake relationship. The large address, small address, and read / write signal are correct values while the request signal is asserted. The load data is correct at the rising edge of the acknowledge signal.
[0086]
FIG. 13 shows an operation in the case of a buffer miss. In this case, the memory device 400 is read-accessed, and the data requested by the CPU 300 is output to the CPU 300 and stored in the load data buffer unit 101. Further, after the memory address at which the CPU 300 performs read access to the memory device 400, the memory device 400 continues to the last data of the memory block (consisting of four words in the first embodiment and the second embodiment described later). And stored in the corresponding register of the load data buffer unit 101. The assertion of the acknowledge signal to the CPU 300 and the output of the load data are determined when the data read from the memory device 400 is input in the first memory read access, that is, when the memory acknowledge signal is asserted in response to the assertion of the first memory request signal. .
[0087]
FIG. 13 shows an operation when the content of the small address is “00”, that is, when a load instruction is executed for data arranged at the beginning of the memory block. In this case, the read access is performed from the data arranged at the beginning of the memory block in which the load buffer is missed, and all the four word memory blocks are continuously read and sequentially stored in the corresponding registers of the load data buffer unit 101. . In FIG. 13, the request signal and the acknowledge signal have a handshake relationship. The large address, small address, and read / write signal are correct values while the request signal is asserted. Further, the memory block address, the memory offset address, and the memory read / write signal are correct values while the memory request signal is asserted. The memory read data has a correct value at the rise time of the memory acknowledge signal and at the rise time of the LB0 to 3 set signals. The load data is correct at the rising edge of the acknowledge signal.
[0088]
14 and 15 are time charts at the time of execution of a store instruction according to the first embodiment and the second embodiment to be described later.
FIG. 14 shows a case of a buffer hit. In this case, the write access to the memory device 400 is not performed, and only the write data is stored in the store data buffer (queue). In FIG. 14, the request signal and the acknowledge signal have a handshake relationship. The large address, small address, read / write signal, and store data are correct values while the request signal is asserted.
[0089]
FIG. 15 shows an operation in the case of a buffer miss. In this case, write access is continuously made to the memory device 400, and write data already stored in the queue is written to the memory block of the memory device 400. In addition, store data input from the CPU 300 is newly stored in the queue. The assertion of the acknowledge signal to the CPU 300 is determined when the data at the head of the queue is completely written to the memory device 400 by the first memory write access, that is, when the memory acknowledge signal is asserted in response to the assertion of the first memory request signal. In FIG. 15, the request signal and the acknowledge signal have a handshake relationship. The large address, small address, read / write signal, and store data are correct values while the request signal is asserted. Further, the memory block address, the memory offset address, the memory read / write signal, and the memory write data are correct values while the memory request signal is asserted and at the rising edge of the SB0-3 clocks.
[0090]
[effect]
As described above, in the first embodiment, the memory buffer device includes the load data buffer unit 101 of multiple words, the store data buffer unit 201 (queue) of multiple words, and the control units. For example, a memory buffer device can be configured with a small-scale circuit such that a separate memory unit for storing data is not required as compared with a cache memory. As a result, it is possible to secure an operation speed that can sufficiently follow the increase in the operating frequency of the CPU 300, and the LSI chip area including the CPU 300 and the memory buffer device of the present invention is configured by the CPU and the cache memory according to the prior art. This can be significantly reduced compared to an LSI that has a low cost and can reduce power consumption.
[0091]
In addition, when a buffer miss occurs during execution of a load instruction, a memory access operation for a plurality of words is performed from the memory device 400. Therefore, the access frequency of the CPU 300 to the memory device 400 can be reduced, and the memory throughput can be improved. Therefore, the program execution performance can be improved.
[0092]
Further, in the first embodiment, when a buffer miss occurs at the time of executing the load instruction, read access from the memory address to the last address of the same memory block is performed and stored in the load buffer unit 100. Therefore, there are the following effects.
By continuously accessing only the data that precedes the memory address where the error occurred (in the direction of increasing memory address), the entire block is always read for the execution of a program with high forward reference frequency, such as array operations. The memory access cycle can be reduced as compared with the case where it is started. That is, if there is a high probability that the memory reference is performed continuously from the target address of the immediately preceding memory reference or forward several words away (in the direction in which the memory address increases), the target address of the immediately preceding memory reference This is because data access in the backward direction (in the direction in which the memory address decreases) is rare, and these data are not unnecessarily read from the memory device 400.
[0093]
<< Embodiment 2 >>
[Constitution]
In the second embodiment, the overall configuration is the same as that shown in FIG. 1 and the configuration shown in FIG. Further, the store buffer unit is the same as the configuration shown in FIGS.
The present embodiment differs from the first embodiment in the configuration of the load buffer control unit, which is as follows.
[0094]
FIG. 16 is a configuration diagram of a load buffer control unit according to the second embodiment.
That is, the present embodiment is different from the load buffer control unit 102 of the first embodiment in that a memory access counter 83 is newly installed. Since the configuration other than this point is the same as that of the first embodiment, the corresponding parts are denoted by the same reference numerals and the description thereof is omitted.
[0095]
The difference between the second embodiment and the first embodiment is only the operation when a buffer miss occurs during execution of a load instruction. In such a case, in the first embodiment, an operation of continuously reading from the memory device 400 to the data at the last address of the memory block continuously from the memory address in which a miss occurs is stored in the corresponding register of the load data buffer unit 101. Went. In contrast, in the second embodiment, the data at the last address of the memory block continuously from the memory address where the miss occurred and the data at the memory address immediately before the memory address where the miss occurred from the data at the head address of the memory block. Until that is, that is, the entire data of one memory block is read and accessed from the memory device 400 and stored in the corresponding register of the load data buffer unit 101.
[0096]
For this purpose, two counters, an offset address counter 81 and a memory access counter 83, are installed as shown in FIG. The offset address counter 81 generates an offset address in the memory block to which read access is performed, and counts the number of access cycles for performing data read access for one memory block. The count clock input of the memory access counter 83 is the same signal as the count clock input of the offset address counter 81, and is the same as the read acknowledge signal of the load buffer control unit 102 shown in FIG.
[0097]
The load input of the memory access counter 83 is the same signal as the load input of the offset address counter 81 and is the same as the set input to the memory request register 52 of the load buffer control unit 102 shown in FIG. At this time, the memory access counter 83 is always loaded with “00”. The carry output of the memory access counter 83 is asserted when the 2-bit counter overflows, that is, when it becomes 4. As a result, it is recognized that data of four words, which are data for one memory block, have been continuously read from the memory device 400. This signal is a last access signal, ANDed with the read acknowledge signal by the AND circuit 10, and its output becomes a reset signal for the memory request register 52 to reset the memory request register 52. The last access signal has the same role as the load buffer control unit 102 of the first embodiment shown in FIG.
By installing the memory access counter 83, in the case of a buffer miss, the entire memory block in which the miss has occurred, that is, data access for four words is continuously performed on the memory device 400.
[0098]
FIGS. 17 to 19 are explanatory diagrams showing the operation of the second embodiment. FIG. 17 shows the operation during loading, and FIGS. 18 and 19 show the operation during storage.
The operation of the memory buffer device according to the second embodiment is different from the operation of the memory buffer device according to the first embodiment shown in FIGS.
In the second embodiment, in the case of a load buffer miss, the entire memory block (4 words) including the memory address that is always a miss is read from the memory device 400 and stored in the corresponding register of the load data buffer unit 101. In the memory access, the load V flag is always “1”. Therefore, when the contents of the tag register 51 of the load buffer unit 100 match the contents of the large address input from the CPU 300, a buffer hit is always caused. In this case, data from the corresponding register of the load data buffer unit 101 is transferred to the CPU 300. Output.
[0099]
On the other hand, if the contents of the tag register 51 and the contents of the large address input from the CPU 300 do not match, a buffer miss occurs, so that data corresponding to one memory block from the memory device 400 continues from the memory address in which the miss occurred. The first read data is output to the CPU 300, and the data (4 words) for one memory block is stored in the corresponding register of the load data buffer unit 101. The operation at the time of executing the store instruction is the same as the operation of the memory buffer device of the first embodiment shown in FIGS.
[0100]
Further, the timing of each signal at the time of execution of the load instruction and the execution of the store instruction in the second embodiment is the same as the state shown in FIGS. However, in the second embodiment, even if the content of the small address is any value from “00” to “11”, the read access is performed from the data arranged at the beginning of the memory block in which the load buffer miss occurs. All four word memory blocks are successively read and sequentially stored in the corresponding registers of the load data buffer.
[0101]
[effect]
As described above, in the second embodiment, similarly to the first embodiment, it is possible to reduce the cost and reduce the power consumption, and when a buffer miss occurs when the load instruction is executed, Since the read access of the data of the entire memory block including the memory address having the miss is performed and stored in the load buffer unit 100, the following effects are obtained.
By continuously accessing the entire memory block including the memory address that caused the miss, for example, for the execution of a program having a high forward reference frequency and a backward reference frequency such as operations using a stack, the entire block is By constantly reading, the total number of buffer misses can be reduced. That is, the memory reference is the same level of memory access to the front (memory address increasing direction) and backward (memory address decreasing direction) that are consecutive or several words away from the target address of the immediately preceding memory reference. When there is a probability, the memory throughput can be maximized by continuously accessing from the memory device 400 data of the maximum number of words that can be continuously accessed and stored in the buffer at a time.
[0102]
【The invention's effect】
As described above, according to the memory buffer device of the first aspect of the present invention, the load data buffer unit having a register of a plurality of words, the store data buffer unit having a first-in first-out buffer of a plurality of words, and these control units are configured. Therefore, for example, a memory buffer device can be configured with a small-scale circuit such that a separate memory unit for storing data is not required as compared with a cache memory. As a result, it is possible to ensure an operation speed that can sufficiently follow the increase in the operating frequency of the CPU, and the LSI chip area including the CPU and the memory buffer device of the present invention is configured by the CPU and the cache memory according to the prior art. This can be significantly reduced compared to an LSI that has a low cost and can reduce power consumption.
[0103]
In addition, when a buffer miss occurs during the execution of the load instruction, the memory access operation of a plurality of words is performed from the memory device, so that the access frequency of the CPU to the memory device can be reduced, and the memory throughput can be improved. Therefore, it can contribute to the improvement of the program execution performance.
[0104]
Furthermore, when a buffer miss occurs during execution of a load instruction, read access from the memory address to the last address of the same memory block is performed and stored in the load buffer unit. effective.
By continuously accessing only the data that precedes the memory address where the error occurred (in the direction of increasing memory address), the entire block is always read for the execution of a program with high forward reference frequency, such as array operations. The memory access cycle can be reduced as compared with the case where it is started.
[0105]
According to the memory buffer device of the second invention, similarly to the first invention, the load data buffer unit having a register of a plurality of words, the store data buffer unit having a first-in first-out buffer of a plurality of words, and these control units are constituted. Therefore, there are the same effects as the first invention. Further, when a buffer miss occurs at the time of executing the load instruction, the data read access of the entire memory block including the memory address in which the miss occurred is performed and stored in the load buffer unit. effective. In other words, by continuously accessing the entire memory block including the memory address in which a mistake has occurred, for example, for a program execution in which the forward reference frequency and backward reference frequency are as high as operations using a stack, The total number of buffer misses can be reduced by always reading the whole.
[0106]
According to the memory buffer device of the third invention, in response to a data write request from the central processing unit, if the corresponding data exists in any of the registers in the load data buffer unit, this data is updated. Therefore, in such a case, it is not necessary to access the memory device, and therefore the program execution performance can be improved.
[Brief description of the drawings]
FIG. 1 is a configuration diagram showing first and second embodiments of a memory buffer device of the present invention.
FIG. 2 is a configuration diagram of a load buffer unit of the memory buffer device of the present invention.
FIG. 3 is a configuration diagram of a load buffer control unit according to the first embodiment of the memory buffer device of the present invention;
FIG. 4 is a configuration diagram of a load data buffer valid flag unit in the first embodiment of the memory buffer device of the present invention;
FIG. 5 is a configuration diagram of an LB0 to 3 set signal generation unit in the first embodiment of the memory buffer device of the present invention;
FIG. 6 is a configuration diagram of a store buffer unit in the first embodiment of the memory buffer device of the present invention;
FIG. 7 is a configuration diagram of a store buffer control unit in the first embodiment of the memory buffer device of the present invention;
FIG. 8 is a configuration diagram of a store buffer signal generation unit in the first embodiment of the memory buffer device of the present invention;
FIG. 9 is an explanatory diagram of an operation (when loading) in the first embodiment of the memory buffer device of the present invention;
FIG. 10 is an explanatory diagram (part 1) of an operation (during storage) in the first embodiment of the memory buffer device of the present invention;
FIG. 11 is an explanatory diagram (part 2) of the operation (during storage) in the first embodiment of the memory buffer device of the present invention;
FIG. 12 is a time chart (buffer hit) when a load instruction is executed in the memory buffer device of the present invention;
FIG. 13 is a time chart (buffer miss) when a load instruction is executed in the memory buffer device of the present invention.
FIG. 14 is a time chart (buffer hit) when a store instruction is executed in the memory buffer device of the present invention.
FIG. 15 is a time chart (buffer miss) when a store instruction is executed in the memory buffer device of the present invention;
FIG. 16 is a configuration diagram of a load buffer control unit in the second embodiment of the memory buffer device of the present invention;
FIG. 17 is an explanatory diagram of an operation (when loading) in the second embodiment of the memory buffer device of the present invention;
FIG. 18 is an explanatory diagram (part 1) of an operation (during storage) in the second embodiment of the memory buffer device of the present invention;
FIG. 19 is an explanatory diagram (part 2) of the operation (during storage) in the second embodiment of the memory buffer device of the present invention;
[Explanation of symbols]
100 Load buffer section
101 Load data buffer
102 Load buffer control unit
200 Store buffer
201 Store data buffer
202 Store buffer control unit

Claims (3)

メモリ装置からデータ読み出しのためのロードバッファ部と、メモリ装置への書き込みのためのストアバッファ部とを備え、
前記ロードバッファ部は、
一メモリブロック分のデータを格納するための複数語の独立に読み書き可能なレジスタを有するロードデータバッファ部と、
中央処理装置からの前記メモリ装置へのデータ読み出し要求に対して、前記レジスタ内のいずれかに該当データが存在する場合は、これを当該中央処理装置に返送し、
どのレジスタにも該当データが存在しない場合は、前記メモリ装置より、前記読み出し要求のデータのメモリアドレスから連続して同一メモリブロックの最終アドレスまでのデータを読み出して、これらを順次、前記レジスタに格納するロードバッファ制御部とからなり、
前記ストアバッファ部は、
一メモリブロック分のデータとして複数語を格納する先入れ先出しバッファを備えたストアデータバッファ部と、
前記中央処理装置からの前記メモリ装置への書き込み要求に対して、前記先入れ先出しバッファ内に、該当データが存在する場合はこれを更新すると共に、格納位置を最後尾とし、該当データの同一メモリブロックのデータが存在する場合は、該当データを最後尾に格納し、
前記先入れ先出しバッファ内のデータが、該当データのメモリブロックとは異なるメモリブロックであった場合は、当該先入れ先出しバッファに格納されているデータを全て前記メモリ装置に書き込むと共に、前記該当データを当該先入れ先出しバッファの先頭位置に格納するストアバッファ制御部とからなることを特徴とするメモリバッファ装置。
A load buffer unit for reading data from the memory device, and a store buffer unit for writing to the memory device,
The load buffer unit
A load data buffer unit having a plurality of independently read / write registers for storing data for one memory block;
In response to a data read request from the central processing unit to the memory device, if the corresponding data exists in any of the registers, return it to the central processing unit,
If no corresponding data exists in any register, data from the memory device to the last address of the same memory block is read continuously from the memory address of the data of the read request, and these are sequentially stored in the register. The load buffer control unit
The store buffer unit
A store data buffer unit having a first-in first-out buffer for storing a plurality of words as data for one memory block;
In response to a write request from the central processing unit to the memory device, if the corresponding data exists in the first-in first-out buffer, it is updated, and the storage position is the last, and the same memory block of the corresponding data is stored. If data exists, store the data at the end,
When the data in the first-in first-out buffer is a memory block different from the memory block of the corresponding data, all the data stored in the first-in first-out buffer is written to the memory device and the corresponding data is stored in the first-in first-out buffer. A memory buffer device comprising: a store buffer control unit storing at a head position.
メモリ装置からデータ読み出しのためのロードバッファ部と、メモリ装置への書き込みのためのストアバッファ部とを備え、
前記ロードバッファ部は、
一メモリブロック分のデータを格納するための複数語の独立に読み書き可能なレジスタを有するロードデータバッファ部と、
中央処理装置からの前記メモリ装置へのデータ読み出し要求に対して、前記レジスタ内のいずれかに該当データが存在する場合は、これを当該中央処理装置に返送し、
どのレジスタにも該当データが存在しない場合は、前記メモリ装置より、前記読み出し要求のデータのメモリアドレスを含む同一メモリブロック全体のデータを読み出して、これらを順次、前記レジスタに格納するロードバッファ制御部とからなり、
前記ストアバッファ部は、
一メモリブロック分のデータとして複数語を格納する先入れ先出しバッファを備えたストアデータバッファ部と、
前記中央処理装置からの前記メモリ装置への書き込み要求に対して、前記先入れ先出しバッファ内に、該当データが存在する場合はこれを更新すると共に、格納位置を最後尾とし、該当データの同一メモリブロックのデータが存在する場合は、該当データを最後尾に格納し、
前記先入れ先出しバッファ内のデータが、該当データのメモリブロックとは異なるメモリブロックであった場合は、当該先入れ先出しバッファに格納されているデータを全て前記メモリ装置に書き込むと共に、前記該当データを当該先入れ先出しバッファの先頭位置に格納するストアバッファ制御部とからなることを特徴とするメモリバッファ装置。
A load buffer unit for reading data from the memory device, and a store buffer unit for writing to the memory device,
The load buffer unit
A load data buffer unit having a plurality of independently read / write registers for storing data for one memory block;
In response to a data read request from the central processing unit to the memory device, if the corresponding data exists in any of the registers, return it to the central processing unit,
When there is no corresponding data in any register, the load buffer control unit reads out the entire memory block data including the memory address of the data of the read request from the memory device, and stores them sequentially in the register And consist of
The store buffer unit
A store data buffer unit having a first-in first-out buffer for storing a plurality of words as data for one memory block;
In response to a write request from the central processing unit to the memory device, if the corresponding data exists in the first-in first-out buffer, it is updated, and the storage position is the last, and the same memory block of the corresponding data is stored. If data exists, store the data at the end,
When the data in the first-in first-out buffer is a memory block different from the memory block of the corresponding data, all the data stored in the first-in first-out buffer is written to the memory device and the corresponding data is stored in the first-in first-out buffer. A memory buffer device comprising: a store buffer control unit storing at a head position.
請求項1または2に記載のメモリバッファ装置において、
中央処理装置からのメモリ装置へのデータ書き込み要求に対して、該当データが、ロードデータバッファ部内のレジスタのいずれかに存在する場合は、このデータを更新するロードバッファ制御部を備えたことを特徴とするメモリバッファ装置。
The memory buffer device according to claim 1 or 2,
In response to a data write request from the central processing unit to the memory device, when the corresponding data exists in any of the registers in the load data buffer unit, a load buffer control unit is provided for updating the data. A memory buffer device.
JP23765495A 1995-08-23 1995-08-23 Memory buffer device Expired - Fee Related JP3614946B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP23765495A JP3614946B2 (en) 1995-08-23 1995-08-23 Memory buffer device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP23765495A JP3614946B2 (en) 1995-08-23 1995-08-23 Memory buffer device

Publications (2)

Publication Number Publication Date
JPH0962571A JPH0962571A (en) 1997-03-07
JP3614946B2 true JP3614946B2 (en) 2005-01-26

Family

ID=17018534

Family Applications (1)

Application Number Title Priority Date Filing Date
JP23765495A Expired - Fee Related JP3614946B2 (en) 1995-08-23 1995-08-23 Memory buffer device

Country Status (1)

Country Link
JP (1) JP3614946B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003044354A (en) * 2001-07-26 2003-02-14 Matsushita Electric Ind Co Ltd Memory controller
JP6191172B2 (en) * 2013-03-12 2017-09-06 日本電気株式会社 Memory controller, processor, arithmetic processing method, and arithmetic instruction library.

Also Published As

Publication number Publication date
JPH0962571A (en) 1997-03-07

Similar Documents

Publication Publication Date Title
US6496902B1 (en) Vector and scalar data cache for a vector multiprocessor
US6665749B1 (en) Bus protocol for efficiently transferring vector data
US6813701B1 (en) Method and apparatus for transferring vector data between memory and a register file
US6594728B1 (en) Cache memory with dual-way arrays and multiplexed parallel output
US6513107B1 (en) Vector transfer system generating address error exception when vector to be transferred does not start and end on same memory page
JP3534822B2 (en) Cache line replacing device and method
US6553486B1 (en) Context switching for vector transfer unit
JP3498673B2 (en) Storage device
JPH11502656A (en) Method and apparatus for combining writes to memory
US6507899B1 (en) Interface for a memory unit
JPS6297036A (en) Calculator system
JPH05210589A (en) High-speed buffer copying method
US9009415B2 (en) Memory system including a spiral cache
JPH02234242A (en) Partial write control system
EP1668513B1 (en) Cache bank interface unit
JPH07121437A (en) Computer system
TW491970B (en) Page collector for improving performance of a memory
JP3614946B2 (en) Memory buffer device
US6625720B1 (en) System for posting vector synchronization instructions to vector instruction queue to separate vector instructions from different application programs
JP3767521B2 (en) Cache fill control method and CPU
JP3295728B2 (en) Update circuit of pipeline cache memory
EP1607869A1 (en) Data cache system
US6904500B2 (en) Cache controller
JP2762798B2 (en) Information processing apparatus of pipeline configuration having instruction cache
JPH06301600A (en) Storage device

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040614

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20040622

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040629

A59 Written plea

Free format text: JAPANESE INTERMEDIATE CODE: A59

Effective date: 20040921

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20041028

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees