JP2012177965A - Memory control device - Google Patents
Memory control device Download PDFInfo
- Publication number
- JP2012177965A JP2012177965A JP2011039214A JP2011039214A JP2012177965A JP 2012177965 A JP2012177965 A JP 2012177965A JP 2011039214 A JP2011039214 A JP 2011039214A JP 2011039214 A JP2011039214 A JP 2011039214A JP 2012177965 A JP2012177965 A JP 2012177965A
- Authority
- JP
- Japan
- Prior art keywords
- access
- memory
- control device
- cache
- caches
- 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.)
- Granted
Links
Images
Landscapes
- Memory System Of A Hierarchy Structure (AREA)
Abstract
Description
本発明は、メモリにアクセスする多数の装置があっても、高性能でかつ高効率なメモリアクセスを実現するためのメモリ制御装置に関する。 The present invention relates to a memory control device for realizing high-performance and high-efficiency memory access even when there are a large number of devices accessing the memory.
画像の加工や解析など多くの処理装置は、解像度の増加やリアルタイム処理などのため、大容量で高性能なメモリが必要である。通常、安価で大容量なSDRAM(Synchronous Dynamic RAM)を使用し、それらを最適制御することで高性能化を図ることが多い。例えば、動作周波数の高いSDRAMを複数個用いたり、処理装置を並列化することで高性能化する。従って、SDRAMの動作周波数やその数、および処理装置の数に従って、システムを都度最適化することになる。このため、システムの最適化が柔軟にかつ迅速に行えるメモリ制御装置が求められている。 Many processing devices, such as image processing and analysis, require large capacity and high performance memory for increasing resolution and real-time processing. Usually, an inexpensive and large-capacity SDRAM (Synchronous Dynamic RAM) is used, and high performance is often achieved by optimally controlling them. For example, the performance can be improved by using a plurality of SDRAMs having a high operating frequency or by parallelizing processing devices. Therefore, the system is optimized each time according to the operating frequency and the number of SDRAMs and the number of processing devices. Therefore, there is a need for a memory control device that can flexibly and quickly optimize a system.
このようなシステムの最適化を柔軟に行えるメモリ制御装置として、特開平10−326225号公開公報がある。図20を用いて説明する。 Japanese Patent Laid-Open No. 10-326225 discloses a memory control device that can flexibly optimize such a system. This will be described with reference to FIG.
図20において、11から16は任意の制御装置となるマスター、21はマスター11から16それぞれのアクセスを束ねるバス、31から37はデータを一時蓄えるキャッシュ、41はキャッシュ31から37のアクセスを束ねるバス、51と52はそれぞれメモリアクセスを制御するアクセス制御装置、61と62はそれぞれメモリ、301はバス21とバス41をバイパスするためのバッファ、302はキャッシュ31から37のアドレスを管理するキャッシュ制御装置である。ここで100は、バス21、キャッシュ31から37、バス41、アクセス制御装置51と52からなるメモリ制御装置である。
In FIG. 20, 11 to 16 are masters that are arbitrary control devices, 21 is a bus that bundles the accesses of the
マスター11から16は、メモリ61とメモリ62にアクセスするものであり、そのアクセス経路は、最初にバス21へ、次にキャッシュ31から37のいずれかへ、次にアクセス制御装置51か52のいずれかへ、最後にバス41に到達する。また、特別に、キャッシュ31から37の代わりにバッファ301を経由することもある。キャッシュ31から37もしくはバイパスバッファ301のいずれかを選ぶかは、キャッシュ制御装置302で管理する。
The
キャッシュ31から37にはそれぞれ管理番号が付与されており、マスター11から16は、キャッシュ制御装置302にそれらの番号を伝える。番号は直接指定するか、テーブル等で変換して間接指定する。従ってこれらは、キャッシュ31から37の選択番号になる。一方、バイパスバッファ301は、いずれのキャッシュにもアクセスせず、直接メモリ61と62に対して読み出したり書き出したりする場合に使用する。もちろん、キャッシュへの読み出しもしくは書き込みと同時に、バイパスバッファ301を通じて早くマスターもしくはメモリにデータを返したい場合にも利用する。
Management numbers are assigned to the
メモリ61と62に接続するアクセス制御装置51と52は、キャッシュ31から37内に記録されているアドレス情報により振り分けられる。このアドレス情報はマスターがアクセスする度に与えられる。また、バイパスバッファ301を利用する場合は、マスターが発行するアドレス情報を直接用いる。
The
バス21とバス41は同時に活性化できるため、マスター11から16のいずれかがキャッシュ31から37のいずれかにアクセスする場合と、キャッシュ31から37のいずれかがアクセス制御装置51と52にアクセスする場合とは、同時に実施できる。
Since the
以上のように、従来のメモリ制御装置は、マスターから直接または間接的に任意のキャッシュが選択可能である。システムの状況によって、一部のマスターに手厚くキャッシュを割り当てたりすることができ、限られたキャッシュ容量で効率よく高性能化を図ることができる。また、複数のキャッシュを用いているので、動作の遅いメモリ、例えばSDRAMなどに対して一部のキャッシュがアクセスしている最中であっても、マスターは異なるキャッシュにアクセスでき、システム全体の高性能化が実現できる。 As described above, the conventional memory control device can select an arbitrary cache directly or indirectly from the master. Depending on the situation of the system, it is possible to allocate a large amount of cache to some masters, and to achieve high performance efficiently with a limited cache capacity. In addition, since a plurality of caches are used, the master can access different caches even when some of the caches are accessing a slow-operating memory such as an SDRAM. Performance can be realized.
しかしながら、特許文献1のような従来のメモリ制御装置にあっては、以下のような問題点があった。
However, the conventional memory control device such as
メモリバンク構造(例えばDynamic RAMが8バンク)を有しているSDRAMなどを使用する場合、同一メモリバンクで基本管理単位であるページ長(例えば1024Byte)を跨ぐアクセスを行うと、前後処理のためアクセス効率が半分以下に低下する。逆に、異なるメモリバンクであれば、ページ長を跨ぐアクセスであっても前後処理が隠蔽されるため、アクセス効率は低下しない。このようなSDRAMの特性から、後者になるようなメモリアドレッシングを実施するか、同一メモリバンク内でページ長を跨がないアドレッシングを実施するかのいずれかが高効率制御には不可欠である。以上のように、SDRAMの制約を回避するような制御が必要である。 When an SDRAM having a memory bank structure (for example, 8 dynamic RAMs) is used, if access is performed over the page length (for example, 1024 bytes) which is the basic management unit in the same memory bank, access is performed for pre- and post-processing. Efficiency drops below half. On the other hand, if the memory banks are different, the access efficiency is not lowered because the pre-processing and post-processing are concealed even when the access is across the page length. From such characteristics of the SDRAM, either the latter memory addressing or the addressing that does not cross the page length in the same memory bank is indispensable for high-efficiency control. As described above, control that avoids the restrictions of the SDRAM is necessary.
一方、キャッシュを用いると、メモリへのアクセスはキャッシュ内にデータが無くなった場合にだけ生じるため予測しにくい。また、マスターからのアクセス単位は、短いほど無駄が生じない。例えば、CPUなどのプロセッサは32Byte程度のアクセス単位であり、SDRAMのページ長1024Byte程度に比べて小さい。この結果、メモリへのアクセスはランダムで短いアクセス単位になることが多い。 On the other hand, when a cache is used, access to the memory is difficult to predict because it occurs only when there is no data in the cache. Also, the shorter the unit of access from the master, the less waste is generated. For example, a processor such as a CPU is an access unit of about 32 bytes, which is smaller than the SDRAM page length of about 1024 bytes. As a result, access to the memory is often a random and short access unit.
また、マスターのアクセスに連動してキャッシュも動作するため、同時刻にマスターが1つのキャッシュしかアクセスできないと、同時刻にメモリにアクセスするキャッシュは1つかせいぜい2つ程度である。ここで2つになるのは、一方のキャッシュの終了動作が遅れ、もう一方のキャッシュの動作が開始する場合などで生じる。もちろん、遅れが極端に長くなるにつれ終了と開始が重畳し同時刻にアクセスする数も増えるが、このような場合は、マスター11から16がキャッシュ31から37に順番にアクセスするような数少ない条件でしか生じない。
Further, since the cache operates in conjunction with the access of the master, if the master can access only one cache at the same time, only one cache can access the memory at the same time. The two are generated when the end operation of one cache is delayed and the operation of the other cache starts. Of course, as the delay becomes extremely long, the end and start overlap and the number of accesses at the same time increases. However, in such a case, under a few conditions that the
以上のことから、1つか2つのキャッシュが順次メモリをアクセスすることになる。アクセス制御装置51もしくは52は、その順序に従ってSDRAMを制御するしかなく、前述したSDRAMの制約でアクセス効率が低下する場合であっても、それを回避することができない。即ち、従来のメモリ制御装置では、SDRAM等の最適な制御が困難である。
From the above, one or two caches sequentially access the memory. The
このように、キャッシュが複数あっても同時刻に活性化しているキャッシュは、マスターからアクセスを受けたキャッシュと、メモリへのアクセスを行うキャッシュのたかだか2つである。従って、結局マスターとキャッシュを繋ぐバス21がボトルネックになってしまう。これを解消するにはバス21のアクセス幅を増加させる必要があるが、マスター全てに対策が必要なことから回路的に高価になる。また、マスターのアクセスの基本単位が比例して長くなるので、例えばランダムアクセスのような細かいアドレッシングを行うものには性能的に不利である。
As described above, even if there are a plurality of caches, there are at most two caches activated at the same time, that is, a cache that receives access from the master and a cache that accesses the memory. Therefore, the
同様に、メモリが複数あっても同時にキャッシュからアクセスできなければ、結局キャッシュとメモリを繋ぐバス41がボトルネックになってしまう。これを解消するにはバス41のアクセス幅を増加させる必要があるが、SDRAMなどのメモリのバス幅の変更は、例えばLSIや基板の端子数増加につながるため困難なこともある。
Similarly, even if there are a plurality of memories and cannot be simultaneously accessed from the cache, the
さらに、従来のメモリ制御装置では、複数のマスターが特定のキャッシュを割り当てるため、キャッシュどうしで同じアドレスを管理してしまうことも考えられる。例えば、マスター11がキャッシュ31に対してアドレスX番地にデータYを書くとする。一方、マスター12がキャッシュ32に対してアドレスX番地からデータを読むとする。この場合、キャッシュが異なるので、マスター11が書いたデータYはマスター12から読めない。
Further, in the conventional memory control device, since a plurality of masters allocate a specific cache, it is conceivable that the same address is managed between the caches. For example, assume that the
もう一つの例として、マスター11がキャッシュ31に対してアドレスX番地にデータYを書くとする。遅れて、マスター12がキャッシュ32に対してアドレスX番地にデータZを書くとする。この場合もキャッシュが異なるので、最終のメモリに書かれるものはYかZかを保証できない。これは、キャッシュの書き出す順序が保証されていないためである。
As another example, assume that the
これらは、コヒーレンス(一貫性)を欠く操作になるため、以下のいずれかを選択しなければならない。さもなければ、システム内でデータの加工順などが入れ替わって予期せぬ結果になったり、ハングアップなど致命的な状態になったりすることになる。 Since these are operations that lack coherence (consistency), one of the following must be selected. Otherwise, the processing order of the data in the system will be changed, resulting in unexpected results or a fatal state such as a hang-up.
1つは、ソフトウェア等で、明らかにマスターごとに違うアドレスをアクセスするようにマスターを制御することである。もう1つは、ハードウェアで、マスターのアクセスを例えばキャッシュ制御装置302で常に監視し、マスターが指定していないキャッシュ内に該当データを見つけた場合、その見つかったキャッシュの内容を一旦メモリに書き出したり無効化したりすることである。
One is to control the master so as to access an address clearly different for each master by software or the like. The other is hardware, which constantly monitors the access of the master, for example, by the
前者は完全なコヒーレンスは実現できないが安価である。後者は完全なコヒーレンスが実現できるが、キャッシュ内で管理しているアドレスの総チェックが必要なため高価で、コンフリクト時には余分なメモリアクセスが生じ性能も劣化する。 The former cannot achieve perfect coherence but is inexpensive. The latter can realize complete coherence, but is expensive because a total check of addresses managed in the cache is necessary, and an excessive memory access occurs at the time of conflict, and the performance is also deteriorated.
また前者を採用する場合、例えばマスター11で画像の加工、マスター12で加工された画像を再加工するには、同じデータをアクセスするため同じキャッシュを指定せざるを得ない。従って、一連のデータ加工においては、同じキャッシュグループを指定することが多く、使用されないキャッシュが出てくる可能性がある。
When the former is employed, for example, in order to process an image by the
従って、いずれを選択しても、コヒーレンスを保証するには大きな制約が課せられる。 Therefore, no matter which one is selected, a great restriction is imposed on guaranteeing coherence.
複数のメモリバンクで構成されるメモリ装置と、複数のマスター装置のアクセスを受け付けるバスマトリクスと、前記バスマトリクスからアクセスされ一時的なデータを格納する複数のキャッシュと、複数の前記キャッシュからアクセスされその1つを選び前記メモリ装置にアクセスするアクセス制御装置とで構成する。 A memory device composed of a plurality of memory banks; a bus matrix that receives access from a plurality of master devices; a plurality of caches that are accessed from the bus matrix and store temporary data; An access control device that selects one and accesses the memory device.
複数の前記キャッシュの数は前記メモリ装置のメモリバンクの数に等しく、前記バスマトリクスは複数の前記アクセス生成装置のアドレス情報から指定された部分に従って複数の前記キャッシュに均等かつ排他的にアクセスし、前記アクセス制御装置は前記メモリ装置のメモリバンクの状態を管理し最も早くアクセスできる前記キャッシュのアクセスを選ぶ。 The number of the plurality of caches is equal to the number of memory banks of the memory device, and the bus matrix accesses the plurality of caches equally and exclusively according to a portion specified from address information of the plurality of access generation devices, The access control device manages the state of the memory bank of the memory device and selects the cache access that can be accessed earliest.
本発明によれば、複数のマスターが同時にアクセスしても、同時にキャッシュもしくはバッファにアクセスが可能であるため、実装するメモリの性能(物理帯域)を超える性能(論理帯域)が実現できる。論理帯域はキャッシュの数に比例するため、システムの要求に合わせてキャッシュを増減すればいいだけである。 According to the present invention, even if a plurality of masters access simultaneously, it is possible to access the cache or the buffer at the same time. Therefore, performance (logical bandwidth) exceeding the performance (physical bandwidth) of the mounted memory can be realized. Since the logical bandwidth is proportional to the number of caches, it is only necessary to increase or decrease the caches according to system requirements.
キャッシュにはマスターごとではなく、SDRAM等が管理するバンクに対応させるので、マスターに対して均一なアクセス性能を提供する。それとともに、複数キャッシュが同時にメモリアクセスする相乗効果が生じ、SDRAM等に最も適したアクセスを行うことができる。従って、SDRAM等の最大性能を引き出すことができる。また、限られたキャッシュを満遍に隈なく使用できる。 Since the cache corresponds to the bank managed by the SDRAM or the like instead of each master, uniform access performance is provided to the master. At the same time, there is a synergistic effect that a plurality of caches simultaneously access the memory, and the most suitable access to the SDRAM or the like can be performed. Therefore, the maximum performance of SDRAM or the like can be extracted. In addition, the limited cache can be used evenly.
しかも、SDRAM等が管理するバンク即ちマスターが指定するアドレスで均等かつ排他的に振り分けるため、それぞれのキャッシュ間のコヒーレンスは完全に保たれる。それにかかるコストも、マスター間およびキャッシュ内の相互チェックだけを行うだけなので比較的小さい。 In addition, since the banks managed by the SDRAM or the like, that is, the addresses specified by the master are distributed equally and exclusively, the coherence between the respective caches is completely maintained. The cost involved is relatively small because only the mutual check between masters and in the cache is performed.
使用するSDRAM等の個数や速度などメモリシステムが変わっても、複数のキャッシュがそれらの差を吸収することから、全てマスターはこれらを全く意識する必要はない。マスター数が増えても同様である。即ち、SDRAM等のメモリシステムの性能を最大限に引き出しながら、さまざまなマスター構成およびメモリ構成に対応できる柔軟さを持つ。 Even if the memory system such as the number and speed of SDRAMs to be used changes, a plurality of caches absorb these differences, so that all masters need not be aware of these at all. The same is true if the number of masters increases. That is, it has the flexibility to handle various master configurations and memory configurations while maximizing the performance of a memory system such as SDRAM.
SDRAM等はRDRAMやFLASH、その他のメモリで置き換えてもよいし、その実装数に制限はなく、また異なる種類のメモリの混在も可能である。 SDRAM or the like may be replaced with RDRAM, FLASH, or other memory, and the number of mounted memory is not limited, and different types of memory can be mixed.
マスターそれぞれに対しての性能調整も容易である。これは優先順位とラウンドロビン形式の調停を組み合わせることによって成される。これにより、一部のマスターの処理を優先させたり、優先度をメモリ帯域の取得状況により変化させ、帯域を自動配分するなどの応用が可能である。 Performance adjustment for each master is easy. This is done by combining priority and round-robin arbitration. As a result, applications such as giving priority to the processing of some masters, changing the priority according to the acquisition status of the memory bandwidth, and automatically allocating the bandwidth are possible.
また、キャッシュをいくつかの領域に分け、それぞれIDを設けることによって、特定のマスターだけのアクセスを許可させたり、特定の領域だけキャッシュフラッシュしたりすることができる。これらは、ソフトウェアで制御できるため、システムの運用に合わせて都合よく実施可能である。 Also, by dividing the cache into several areas and providing IDs, it is possible to allow access only to a specific master or to cache flush only a specific area. Since these can be controlled by software, they can be conveniently implemented according to the operation of the system.
以下、本発明の実施の形態について、図面を参照して詳細に説明する。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
本発明の実施例1に係るメモリ制御装置について説明する。本実施の形態は、図1を用いて、計算機システムで広く使われているSDRAMを適応した例で説明する。
A memory control apparatus according to
図1において、11から16は任意の制御装置であるマスター、21はマスターのアクセスをアドレスを参照して均一に分離しアクセスの衝突があれば調停を行うバスマトリクス、31から38はデータを一時蓄えるキャッシュ、41はキャッシュ31から38のアクセスをSDRAMターゲットごとにアドレスを参照して分離する分離装置、51と52は複数のメモリアクセスの要求からSDRAMに最適なアクセスを選び出すアクセス制御装置、61と62はそれぞれSDRAMである。ここで1は、バスマトリクス21、キャッシュ31から38、分離装置41、アクセス制御装置51と52、からなる本発明のメモリ制御装置である。
In FIG. 1, 11 to 16 are masters which are arbitrary control devices, 21 is a bus matrix which uniformly separates access of masters by referring to addresses and arbitrates if there is an access collision, and 31 to 38 temporarily store data. A cache for storing; 41, a separating device that separates accesses of the
バスマトリクス21は、マスター11から16の6つのアクセスを、キャッシュ31から38への8つアクセスに接続する。図2はこの接続を示したものである。図2において、211から218は同一キャッシュへアクセスするアクセスを集め、1つのアクセスを選択する調停装置である。説明の簡単のため、マスター11から16のそれぞれと、調停装置211との接続だけを示している。実際は、調停装置212から218も同様にマスター11から16のそれぞれに接続する。なお、調停装置211から218は全く同じ構造のものである。
The
調停装置211から218のそれぞれには、選択装置が組み込まれている。ここも説明の簡単のため、調停装置211内の2111の選択装置だけを示している。選択装置2111はセレクタ信号により、キャッシュ31に対応するアクセスだけを抽出するフィルタの働きをする。
Each of the
セレクタ信号はキャッシュ31から38を選択する番号であり、調整装置211から218それぞれの順番に等しい。例えば、調整装置211は0、調整装置212は1、調整装置218は7といった具合である。このセレクタ信号と、マスターのアドレス信号を比較することで、選択装置221のフィルタが実施される。アドレス信号の参照ビットは予め指定しておいてもよいし、レジスタ等で指示してもよい。
The selector signal is a number for selecting the
例えば、バイト単位でアクセスするアドレス信号が32ビットあるものとする。下位6,5,4ビット目が参照ビットになるよう予め指定しておくと、アドレス0〜15までのアクセスは下位6,5,4ビット目が全て0なので、選択装置231のセレクタ信号の0と一致し通過する。アドレス16〜127までのアクセスは下位6,5,4ビット目が全て0でないので遮断する。アドレス128〜143はアドレス0〜15の場合の動作と同じく通過、アドレス144〜255はアドレス16〜127の場合の動作と同じく遮断、以下この繰り返しである。
For example, it is assumed that there are 32 bits of address signals to be accessed in byte units. If the lower 6th, 5th, and 4th bits are designated in advance as reference bits, the accesses from
調停装置212から218はセレクタ信号が1から7になるだけで、それぞれ下位6,5,4ビット目を参照し、同様のフィルタ処理を行う。
アドレスの参照ビットは、LSB(Least Significant Bit)方向にすると、キャッシュ31から38に細かい単位で振り分けることになる。逆に、MSB(Most Significant Bit)方向にすると、キャッシュ31から38に粗い単位で振り分けることになる。例えば、画像データは連続したアドレス領域に格納することが多いが、前者だと小さい単位でキャッシュ31から38にアクセスを配分することになる。後者だと、全てもしくは大きな単位で特定のキャッシュにアクセスを行うことになる。これらは、実施例3の説明でさらに詳細な説明を行う。
If the address reference bits are in the LSB (Least Significant Bit) direction, they are distributed to the
選択装置2111を通過したアクセスは、最大、マスターの数だけ存在する。これらを均一に処理するため、ラウンドロビン形式で調停するものとする。ラウンドロビン形式は、例えば、マスターの番号を指定するポインタを持ち、競合時はそのポインタが指し示す最も近くのマスターを選択するものである。ポインタはアクセスが成功するとそのマスターもしくはそのマスター+1のポインタを指し、マスターの数を超える数字になるとマスターの数を減算する。即ちポインタは巡回する。このような方式をとると、競合アクセスで選ばれなかったアクセスは保留され、次のタイミングで同様の調停を受け、ポインタが一巡するまでには必ずアクセスが実施される。
There are a maximum number of accesses that have passed through the
なお、調停の形式は、ランダムな数字を発生させ、それをポインタにするものや、マスター番号の昇順もしくは降順で画一的に選択するものなどさまざまなものがある。しかしながら、調停の形式によって本発明の本質が何ら変わることはない。 There are various types of mediation, such as generating a random number and using it as a pointer, or selecting it uniformly in ascending or descending order of the master number. However, the essence of the present invention does not change according to the mode of arbitration.
調停装置212から218は、それぞれキャッシュ31から38に対応しており、同時に動作できる。このことから、マスター11から16のそれぞれは、同じキャッシュに対する競合が生じなければ、同時にキャッシュにアクセスすることが可能である。これは、キャッシュ31から38は同時に活性化できることを意味する。
The
競合は常に生じるものではないが、生じた場合はアクセス時間(レイテンシ)が延びて、アクセス性能が劣化する。図3に、8個のマスターと8個のキャッシュに対応するモデルを用いて、読み出しのランダムアクセスを実施した場合のレイテンシの分布を示す。横軸がレイテンシを示し、縦軸が分布P(%)を示す。また、棒グラフ(実線)はシミュレーション値、点線は理論値である。 Contention does not always occur, but if it occurs, the access time (latency) is extended and the access performance is degraded. FIG. 3 shows a latency distribution when random access for reading is performed using a model corresponding to 8 masters and 8 caches. The horizontal axis represents latency, and the vertical axis represents the distribution P (%). The bar graph (solid line) is a simulation value, and the dotted line is a theoretical value.
次に、マスターのアクセス密度を半分、例えば、2サイクルに1回の割合のアクセスに変更した場合を図4に示す。 Next, FIG. 4 shows a case where the access density of the master is changed to half, for example, once every two cycles.
マスターがアクセスを行いデータが戻ってくるまでには、いくつかのフリップフロップで構成されるパイプライン遅延が加算される。図3と図4において、レイテンシが9から始まるのは、このモデルにおいて競合がなくてもこの遅延が生じるためである。遅延は、計算機システム上必ず生じるものであり、動作周波数や構成によってその値は異なる。 A pipeline delay composed of several flip-flops is added before the master accesses and data returns. In FIGS. 3 and 4, the latency starts at 9 because this delay occurs even if there is no contention in this model. The delay is inevitably generated in the computer system, and the value varies depending on the operating frequency and the configuration.
図3と図4の分布P(%)の統計上の理論値は、上記の初期レイテンシを引いた相対レイテンシx、1サイクルあたりのアクセス密度ρを用いて次のように計算できる。ここで、exp()はネイピアeの指数関数である。 The theoretical theoretical value of the distribution P (%) in FIGS. 3 and 4 can be calculated as follows using the relative latency x obtained by subtracting the initial latency and the access density ρ per cycle. Here, exp () is an exponential function of Napier e.
P(x)=100・exp(−ρ)・(1−exp(−ρ))^x. P (x) = 100 · exp (−ρ) · (1-exp (−ρ)) ^ x.
図3と図4において、レイテンシxとレイテンシの分布Pを掛け積分すると、レイテンシの期待値が算出できる。図3のマスターが常にアクセスする状態(ρ=1)で10、図4のマスターが1/2の割合でアクセスする状態(ρ=0.5)で9.5となる。このことから分かるように、それぞれ初期レイテンシ9に比べ大きく性能劣化は生じていない。なお、実施例1の場合はマスター数が6であるから、マスター11から16が全てアクセスする状態なら、ρの最大は6/8である。
In FIG. 3 and FIG. 4, by multiplying and integrating the latency x and the latency distribution P, the expected value of latency can be calculated. 3 when the master of FIG. 3 always accesses (ρ = 1) and 9.5 when the master of FIG. 4 accesses at a rate of 1/2 (ρ = 0.5). As can be seen from this, there is no significant performance degradation compared to the initial latency 9. In the case of the first embodiment, since the number of masters is 6, if the
通常の計算機システムにおいて、全てのマスターが常にアクセスを行う機会は少なく、実際のρは1より小さくなる。即ち、レイテンシ増加は、ρ=1の場合の1より小さくなる。このように、バスマトリクス21の構成は、マスターが全てのキャッシュにアクセスできることに加え、最大、キャッシュのアクセス性能xキャッシュの実装数8の性能(論理帯域)まで発揮させることができる。
In an ordinary computer system, there is little opportunity for all masters to always access, and the actual ρ is smaller than 1. That is, the increase in latency is smaller than 1 when ρ = 1. As described above, the configuration of the
バスマトリクス21で振り分けられたアクセスは、キャッシュ31から38のそれぞれに接続する。それぞれのキャッシュの動作は、一般的な計算機で使用するキャッシュに相当する。
Access distributed in the
キャッシュ31から38は、SDRAM61とSDRAM62のバンク数に対応して8個ある。図5を用いて説明する。図5において、631から638はそれぞれSDRAM内の8つに分けられたDRAMバンク、641はSDRAM全体の制御とDRAMバンク631から638へのアクセスの分離を行うSDRAM制御装置である。説明の簡単のため、キャッシュ31から38のそれぞれと、SDRAM61との接続だけを示している。
There are eight
図5に示すように、キャッシュ31とDRAMバンク631、キャッシュ32とDRAMバンク632というように、データの格納は1対1に対応する。従って、アクセス制御装置51とSDRAM制御装置641が多重化と逆多重化を行うことになる。分離装置41に関しては後述する。
As shown in FIG. 5, data is stored in a one-to-one correspondence such as a
SDRAM制御装置641は、DRAMバンク631から638のそれぞれに対し、DRAMの特徴である活性化(Activate)、データのアクセス、非活性化(Pre-Charge)を順に実施する。データのアクセス期間だけが、実際のデータの読み書きに使用される。
The
図9を用いて簡単に説明する。図9において、横軸が時間、縦軸がSDRAM制御装置641および8個のDRAMバンク631から638における作業の様子を示す。SDRAM制御装置641の作業は、読み出しデータのアクセス期間だけを実線で示している。8個のDRAMバンク631から638の作業は、Activate、Pre-Chargeを点線で、読み出しデータのアクセス期間を実線で示している。
This will be briefly described with reference to FIG. In FIG. 9, the horizontal axis represents time, and the vertical axis represents the operation in the
SDRAMにとって最も最適な制御は、最大性能を得るため、物理的に接続されたデータ端子を常にデータの送受信のために使うことである。即ち、図9のSDRAM制御装置641の実線に隙間がなければいいことになる。キャッシュ31から38のアクセスの基本単位は従来のメモリ制御装置の説明で示したように、SDRAMのページ長より短くなることから、それぞれのDRAMバンクの読み出しデータのアクセス期間を、図8のようにバンクを細かく切り替えながら隙間なく並べる制御を行わなければいけない。
The most optimal control for the SDRAM is to always use physically connected data terminals for data transmission and reception in order to obtain maximum performance. That is, it is sufficient that there is no gap in the solid line of the
ただし、それぞれのDRAMバンクのActivateとPre-Chargeがデータのアクセス期間の前後に必要なことから、一度使用したDRAMバンクは直ぐには使用できない。例えば図7において、DRAMバンク631が1−2のタイミングでデータをアクセスしたとすると、続くPre-Chargeのタイミング1−3では、次のActivateのタイミング2−1を重ねることができない。また、Activateのタイミング1−1、2−1分の遅延を考慮して実際のデータアクセスを行う必要がある。
However, since the activation and pre-charge of each DRAM bank are required before and after the data access period, the DRAM bank once used cannot be used immediately. For example, in FIG. 7, if the
本実施例では、DRAMバンク631から638に対応するそれぞれのキャッシュは、同時にアクセス要求を行う。これは、複数のマスターが同時にまた均等にアクセスを振り分けているためである。そこで、アクセス制御装置51は、各タイミングの重ね合わせに最適なDRAMバンクを選び、それに対応するキャッシュのアクセスをSDRAM61に渡す。
In this embodiment, the respective caches corresponding to the
アクセス制御装置51の制御は、図9の各期間をテーブルで管理する。例えば、Activate、データのアクセス、Pre-Chargeの各期間を時間パラメータとして予め与え、アクセスが生じるたびにDRAMバンク631から638ごとに用意した予約テーブルに記録してゆく。
Control of the
アクセス制御装置51は予約テーブルを見て、予約されていないDRAMバンクを選び出し、それに対するキャッシュアクセスを選択するとともに、予約テーブルに予約開始を指示する。予約テーブルは予約開始が指示されると、該当するDRAMバンク用のカウンタにそれぞれの時間パラメータの合計をセットする。そして時間が経つごとに、それらのカウンタをデクリメントする。このカウンタが非0を示すDRAMバンクが予約されているとみなされる。
The
ただし、SDRAMは同じDRAMバンクアクセスでも、SDRAMのページ長内であればActivate作業は不要なため、例え予約されていても、直前の履歴を見てアクセスを許可する。図9において、8−2に続く8−3がそれを示している。 However, even if the SDRAM accesses the same DRAM bank, the activation work is unnecessary if it is within the SDRAM page length. Therefore, even if it is reserved, access is permitted by looking at the previous history. In FIG. 9, 8-3 following 8-2 indicates this.
また、アクセス制御装置51は、データのアクセス期間に該当するデータの読み書きを行うように、予約テーブルを参照してデータのアクセスタイミングを割り出す。具体的には、Pre-Charge期間<カウンタの値<Pre-Charge期間+データのアクセス期間の真偽で判断する。
Further, the
なお、読み出しに続く書き込み、もしくは書き込みに続く読み出しは、端子の入出力の切り替えが発生し、電気的な特性を考慮して通常1サイクル程度遅延させる必要がある。これを避けるため、読み出しもしくは書き込みが連続になるように制御してもよい。 Note that writing following reading or reading following writing causes switching of input / output of the terminal, and it is usually necessary to delay about one cycle in consideration of electrical characteristics. In order to avoid this, the reading or writing may be controlled to be continuous.
図10は、アクセス制御装置51において、SDRAM61にアクセスできるキャッシュアクセスの選別に関するフローチャートを示している。アクセス制御装置51は、キャッシュ31から38についてこの検査を行い、最後に残ったものを調停して実際にSDRAM61にアクセスする。
FIG. 10 shows a flowchart relating to selection of cache access that can access the
調停に関しては、キャッシュ31から38それぞれに関係なく均一なアクセスを行うため、調停装置212から218で実施したようにラウンドロビンによる巡回型の調停を行うものとする。前述したように、調停の形式は変更してもよい。例えば、同一のキャッシュがSDRAMのページ内に連続してアクセスする場合がある。このとき他のキャッシュはアクセスができないため、マスターから見て偏ったレイテンシが生じる。これを防ぐため、同一キャッシュの連続アクセス数の上限を定め、上限を超える場合は調停の優先度を下げるなどが考えられる。
Regarding arbitration, in order to perform uniform access regardless of the
図7に示したように、キャッシュ31から38と、DRAMバンク631から638はそれぞれ1対1で関連付けられている。しかしマスター数が増えた場合、キャッシュも増やし論理帯域を上げたい場合がある。
As shown in FIG. 7, the
SDRAMのDRAMバンク数は4個や8個など既に決定していることが多い。従って、キャッシュを増やす場合は、DRAMバンクの数よりキャッシュの数が多くなる場合がある。このような場合は、DRAMバンクの数の整数倍の数でキャッシュを構成する。図6を用いて説明する。 In many cases, the number of DRAM banks of the SDRAM has already been determined, such as four or eight. Therefore, when the cache is increased, the number of caches may be larger than the number of DRAM banks. In such a case, the cache is constituted by an integer multiple of the number of DRAM banks. This will be described with reference to FIG.
図6は図5からキャッシュの数を2倍に増やしたものである。ここで、31aから38aと31bから38bは単に同じキャッシュをコピーしたもので(ただしキャッシュ容量はキャッシュ31から38のものと異なってもよい)、31cはキャッシュ31a、31bのアクセスを調停する調停装置である。32cから38cも同様の調停装置である。
FIG. 6 is obtained by doubling the number of caches from FIG. Here, 31a to 38a and 31b to 38b are simply copies of the same cache (however, the cache capacity may be different from that of
調停に関しては、アクセス制御装置51と同じあり。即ち、キャッシュそれぞれに関係なく均一なアクセスを行うため、調停装置222から228で実施したようにラウンドロビンによる巡回型の調停を行うものとする。前述したように、調停の形式は変更してもよい。
The arbitration is the same as the
図6から分かるように、アクセス制御装置51から見て、キャッシュ31aと31bおよび調整装置31cは、キャッシュ31と等価である。従って、SDRAMのDRAMバンクを最適制御する上で、アクセス制御装置51は特別なことをしなくてよい。その他のキャッシュ32aから38a、キャッシュ32bから38bも同様である。
As can be seen from FIG. 6, when viewed from the
以上のように、キャッシュの数を増やしても、SDRAM61、62を変えることなくマスターから見た論理帯域を増やすとともに、SDRAMの最適制御を行うことが可能である。キャッシュの数が2倍の場合以外も同様である。
As described above, even if the number of caches is increased, it is possible to increase the logical bandwidth viewed from the master without changing the
逆に、マスター数が減る場合、キャッシュも減らしコストを削減したい場合がある。 Conversely, when the number of masters decreases, there is a case where it is desired to reduce the cost by reducing the cache.
上述したように、SDRAMのDRAMバンク数は変えないこととする。従って、キャッシュを減らす場合は、DRAMバンクの数よりキャッシュの数が少なくなる。このような場合は、DRAMバンクの数の1/2、1/4と2の累乗分の1のキャッシュの数で構成する。図7を用いて説明する。 As described above, the number of DRAM banks of the SDRAM is not changed. Therefore, when the cache is reduced, the number of caches is smaller than the number of DRAM banks. In such a case, the number of caches is 1/2 of the number of DRAM banks, 1/4 of the number of caches, and 1 to the power of 2. This will be described with reference to FIG.
図7は図5からキャッシュの数を1/2に減らしたものである。ここでは、キャッシュ32、34、36、38を間引く。また、間引いたキャッシュのアクセス分は、隣合うキャッシュ31、33、35、37のアクセスを分離装置41に入れる。ただし、元のキャッシュ31、33、35、37のアクセスと、キャッシュ32、34、36、38の代わりに入れるアクセスは、アドレスのいずれかのビットでアクセスを排他的にマスクする。例えば、アドレスのLSBが0だとキャッシュ31、33、35、37分のアクセスだけ、LSBが1だとキャッシュ32、34、36、38分のアクセスだけなど、奇数偶数でアクセスを分ける。
FIG. 7 is obtained by reducing the number of caches to 1/2 from FIG. Here, the
図7から分かるように、アクセス制御装置51から見て間引かれたキャッシュ32のアクセスは、キャッシュ31のアクセスが兼ねる。しかし、前述したアクセスのマスクを行っているため、同時にアクセスすることはない。従って、SDRAMのDRAMバンク631か632かのいずれかしか選択しない。その他のキャッシュも同様である。
As can be seen from FIG. 7, the access of the
従って、キャッシュが8個だった場合に比べると、アクセスを選ぶ際の選択肢が少なくなるため、DRAMバンクのSDRAMの最適な制御はできない。このため、キャッシュの数を減らしてコストを削減するよりも、キャッシュ容量を減らしてコストを削減する方がよい。例えば、キャッシュ容量が32KBytex8個であれば、32KBytex4個にするより16KBytex8個にする方がよい。ただし、これに限定するものではない。 Therefore, as compared with the case where there are eight caches, there are fewer choices when selecting access, so that the SDRAM in the DRAM bank cannot be optimally controlled. For this reason, it is better to reduce the cost by reducing the cache capacity than to reduce the cost by reducing the number of caches. For example, if the cache capacity is 32 KByte × 8, it is better to use 16 KByte × 8 rather than 32 KByte × 4. However, the present invention is not limited to this.
次に、SDRAM61のDRAMバンクの数が4個に減った場合について述べる。これは比例の関係から、キャッシュの数が16個、DRAMバンクの数が8個の場合と同じ特徴になる。また、キャッシュの数を4個に減らせば、同じく比例の関係から、キャッシュの数が8個、DRAMバンクの数が8個の場合と同じ特徴になる。
Next, a case where the number of DRAM banks of the
一方、キャッシュの数が8個のまま、同じSDRAMを2個用いて見かけ上のDRAMバンクを増やし、キャッシュの数とDRAMバンクの数を一致させる方法がある。図8を用いて説明する。 On the other hand, there is a method of increasing the apparent number of DRAM banks using two of the same SDRAM while keeping the number of caches to be 8, and matching the number of caches with the number of DRAM banks. This will be described with reference to FIG.
図8は図5からSDRAM61が2個になり(2つのSet)、それぞれのDRAMバンクの数が4個に減ったものである。ここで、61aと61bはDRAMバンクの数が4個のSDRAM、641aと641bはそれぞれSDRAM61aと61bのSDRAM制御装置である。
FIG. 8 shows that the number of
図8から見て分かるように、キャッシュ31から38、分離装置41、アクセス制御装置51は基本的に何ら変わらない。SDRAMは2個になったが、図9に示す制御は同じである。ただし、アクセス制御装置51は、SDRAM61aと61bを分けて使用するため、別々のチップセレクトを用意しなければならない。チップセレクトはアドレスに関連付けられたDRAMバンクの番号で簡単に生成できる。例えば、DRAMバンク番号0〜3はSDRAM61aのチップセレクト、DRAMバンク番号4〜7はDRAM61bのチップセレクトといった具合である。
As can be seen from FIG. 8, the
なお、キャッシュ31から38のアドレス情報は排他的であり、バスマトリクス21で振り分けに使用したビット部分がバンク情報を表す。例えば、キャッシュ31の該当ビットは0、キャッシュ32の該当ビットは1になっており、そのままDRAMバンク番号に相当する。
Note that the address information of the
以上のことから、キャッシュの数とSDRAMのDRAMバンクの数、およびSDRAMの数の3つのパラメータで、システムの性能を調整することができる。これは、システムを決定する上で非常に柔軟な選択ができることを意味する。 From the above, the system performance can be adjusted by the three parameters of the number of caches, the number of DRAM banks of the SDRAM, and the number of SDRAMs. This means that a very flexible choice can be made in determining the system.
なお、図6において、キャッシュを31aから38aだけの8個にし、特別なマスターを用意しそのアクセスを選択装置2111と同等の働きをするものにより8つのアクセスに振り分け、キャッシュを31bから38bの代わりにすることも可能である。これは、特別なマスターがキャッシュをバイパスし、SDRAMに直接アクセスする場合に使用する。例えば、CPUなどの既にキャッシュを持っているマスターに応用できる。
In FIG. 6, the number of caches is set to 8 only 31a to 38a, a special master is prepared, and the access is distributed to 8 accesses by the one having the same function as the
一方、SDRAMの数を増やす異なる方法として、分離装置41を利用する場合を説明する。
On the other hand, as a different method of increasing the number of SDRAMs, a case where the
図1において、分離装置41はキャッシュ31から38の特定のアドレスビットを参照して、アクセス制御装置51と52に振り分ける(2つのGroup)。この動作は図2の選択装置231と同じく、セレクタ信号を予め与えておき、特定のアドレスのビットと比較し振り分けを実施するものである。
In FIG. 1, the
アドレスの参照ビットは、LSB方向にすると、SDRAM61と62に細かい単位で振り分けることになる。逆に、MSB方向にすると、SDRAM61と62に粗い単位で振り分けることになる。これは調停装置211から218の説明と同様である。
When the address reference bits are in the LSB direction, they are distributed to the
図8で示したSDRAMを2個使うもの(2つのSet)と違うのは、キャッシュ31から38が、SDRAM61とSDRAM62に対して同時にアクセスできることである。例えば、キャッシュ31がアクセス制御装置51を通ってSDRAM61にアクセスし、キャッシュ32がアクセス制御装置52を通ってSDRAM62にアクセスすることができる。
8 differs from the one using two SDRAMs (two sets) shown in FIG. 8 in that the
このように、分離装置41の構成は、SDRAMのアクセス性能xSDRAMの数2個の性能(物理帯域)まで発揮させることができる。なお、分離装置41において、アドレスにより振り分けるのではなく、キャッシュの番号を用いて排他的に振り分けてもよい。
As described above, the configuration of the
しかしながら、アクセス制御装置51と52は、それぞれのSDRAMだけを管理するため、相互の状態は分からない。このため、同一キャッシュにおいて、異なるSDRAMに対するアクセスが近づくと、例えば読み出しのデータがSDRAM61のものとSDRAM62のものが重なってしまうなどの問題がある。分離装置41はこれを解消するため、同一キャッシュで前回アクセスしたSDRAMと異なるSDRAMをアクセスする場合、アクセス禁止期間を自動的に挿入する。
However, since the
図11を用いて説明する。図11において、横軸が時間、縦軸が分離装置41およびSDRAM61と62における作業の様子を示す。説明の簡単のため、アクセス制御装置51と52の動作は割愛している。また、SDRAM61と62の作業は、読み出しデータのアクセス期間だけをそれぞれ実線と点線で示している。分離装置41の作業としてアクセスの発行タイミングを黒丸で、データの受け取り期間を実線と点線で示している。
This will be described with reference to FIG. In FIG. 11, the horizontal axis represents time, and the vertical axis represents the work in the
図11に示したように、分離装置41は前回と異なるSDRAMにアクセスを行う場合、予め決められたCYCサイクル分の期間をアクセス禁止にする(CYC期間内に黒丸を存在させない)。この禁止期間を作ることにより、SDRAM61と62から読み出されるデータは重複しない。CYCサイクルは実際のデータのアクセス期間とアクセス開始までの遅延時間を加えたものである。
As shown in FIG. 11, when accessing the SDRAM different from the previous time, the separating
もちろん分離装置41は、同一SDRAMへのアクセスが続けば、これらの禁止期間は設けない。また、異なるキャッシュが異なるSDRAMを前回アクセスしていても、禁止期間は設けない。これは、キャッシュとしてバスが分離されているため、重複することがないからである。
Of course, the
さらに、特性の異なるSDRAMを実装することも可能である。例えば、SDRAM62のアクセスタイムがDelta分だけ遅くなったと仮定する。この場合、図12に示したように、遅いSDRAMから速いSDRAMにアクセスする場合にのみ、CYCにDeltaを加えたものをアクセス禁止期間とする。即ち、前回アクセスしたSDRAMのアクセス期間、跨ぐアクセスを禁止することになる。これにより、遅いSDRAMのアクセスのタイミングに合わせてアクセスを調整することができる。
Furthermore, SDRAMs with different characteristics can be mounted. For example, assume that the access time of the
Deltaは予め与えておくか、レジスタ等で指定する。SDRAMごとに異なるCYCサイクルを与えて、自動的に差分を計算してもよい。また、SDRAMの使用するバス幅が異なると、データを多重化したり逆多重化したりして、キャッシュ31から38のバス幅に合わせなければならないが、アクセス制御装置51と52でそれらを行い、アクセスタイムの違いだけにしておけば、前述した対応だけで済む。
Delta is given in advance or specified by a register. A difference may be automatically calculated by giving a different CYC cycle for each SDRAM. Also, if the bus width used by the SDRAM is different, the data must be multiplexed or demultiplexed to match the bus width of the
以上説明したように、分離装置41は複数のSDRAMへアクセスを分配し物理帯域を拡大するとともに、異なる特性のSDRAMの実装も可能とする。これらは、キャッシュの数やマスターの数に関係がなく、システム要件により自在に変更できる。
As described above, the
なお、実施例ではSDRAMの数を2個として説明したが、それ以上であっても分離装置41の分岐が増えるだけで問題はない。
In the embodiment, the number of SDRAMs has been described as two. However, even if the number of SDRAMs is more than that, there is no problem because the number of branches of the
また、図8で説明したSDRAMを複数使う方法と、図1で説明したSDRAMを複数使う方法は組み合わせてもよい(任意のSetと任意のGroup)。組み合わせることによって、物理帯域の拡大とSDRAMのアクセス効率の向上がともに図れる。 Further, the method of using a plurality of SDRAMs described in FIG. 8 and the method of using a plurality of SDRAMs described in FIG. 1 may be combined (arbitrary Set and arbitrary Group). By combining them, it is possible to both increase the physical bandwidth and improve the access efficiency of the SDRAM.
さらに、SDRAMの代わりにRDRAMやFLASHメモリなど、バンク構造を採用しているメモリにも応用できる。 Furthermore, it can be applied to a memory adopting a bank structure such as RDRAM or FLASH memory instead of SDRAM.
本発明の実施例2に係るメモリ制御装置について説明する。本実施の形態は、実施例1を参照しながら説明する。
A memory control apparatus according to
マスター11から16のアクセスは、バスマトリクス21によって所望のキャッシュ31から38に到達するが、到達時刻はバスマトリクス21の調停次第であり保証できない。例えば、マスター11がキャッシュ31とキャッシュ32に続けてアクセスする場合、キャッシュ31にアクセスが到達する時刻と、キャッシュ32にアクセスが到達する時刻には揺らぎが生じる。このため、アクセスの前後が入れ替わる可能性がある。
Access from the
アクセスの前後が入れ替わると、マスターのデータ管理もそれに合わせて入れ替えなければならない。例えば、マスター11がアドレスAをキャッシュ31に要求しデータXが返るとする。一方、アドレスBをキャッシュ32に要求しデータYが返るとする。この場合、X,Yの順でなく、Y,Xの順でデータが返ることがある。このデータの入れ替わり情報をマスターに返すことで、マスターはデータの処理の順番を入れ替えなけねばならない(Out-of-Order制御)。
If the access before and after is switched, the master data management must be switched accordingly. For example, assume that the
これらは、マスターの作り方にも依存するため、対応できないマスターであれば接続できない。本実施例では、内部で順序を整えてこれを解消する、In-Order制御について図13を用いて説明する。 Since these depend on how to make the master, it cannot be connected if it cannot be handled by the master. In the present embodiment, In-Order control that arranges the order internally and eliminates this will be described with reference to FIG.
図13において、71から76はそれぞれマスター11から16に対応するインターフェイス装置である。インターフェイス装置71から76は、マスター11から16とバスマトリクス21間のブリッジとなる。インターフェイス装置71から76は同じ構造で同じ動作を行うため、インターフェイス装置71だけ詳細に説明する。
In FIG. 13,
インターフェイス装置71は、711のバースト分解装置、712の書き込みバッファ、713の読み出しバッファからなる。
The
バースト分解装置711は、マスター11がバーストアクセスを行う場合、それらを最小のアクセス単位であるワードに分解する。分解することで、これ以降のキャッシュなどの装置は、バーストを考慮する必要がなくなり、ワード単位の制御に簡単化できる。また、バースト単位で処理を行うと、個々のマスターに対するレイテンシが積算してしまうが、ワードに分解することで、レイテンシも平均化できる。
When the
例えば、マスター全てが16ワードのバーストアクセスをする場合、実際のデータをアクセスできるタイミングは、最悪で調停1巡分の16ワードx6マスター=96サイクルになる。一方、ワードに分解していると、調停1巡分は1ワードx6マスター=6サイクルで済む。もちろん、全体的に遅延が平均化するだけで、スループット性能が変わるわけではない。 For example, when all the masters perform 16-word burst access, the timing at which the actual data can be accessed is worst, 16 words × 6 masters for one round of arbitration = 96 cycles. On the other hand, if it is broken down into words, one round of arbitration requires 1 word x 6 masters = 6 cycles. Of course, the throughput performance is not changed just by averaging the delay as a whole.
バスマトリクス21は調停を行う際、ユニークな数字のタグを生成する。タグは例えば、マスターの番号とアクセスした順番もしくは時刻などを組み合わせて生成する。
The
マスター11が書き込みアクセスを行うと、タグを生成しバッファ712に伝える。一方バッファ712は、マスター11からの書き込みデータを蓄積しておく。蓄積可能なことから、マスター11が書き込みで待たされることはバッファ712が満杯でない限りない。
When the
タグは書き込み順を情報として持っているため、バッファ712に対しそれを用いて、該当するデータを引き出す。引き出されたデータは、調停後のアクセス順に従いキャッシュ31に書き込まれる。このように、マスター11はバッファ712に対してIn-Order制御、バッファ712はキャッシュ31に対してOut-of-Order制御となる。
Since the tag has the writing order as information, it uses the
マスター11が読み出しアクセスを行うと、同様にタグを生成しキャッシュ31に伝える。キャッシュ31はデータを返すまでタグを保存し、最終的にデータとタグをセットにしてバッファ713に返す。
When the
バッファ713はマスター11が期待するアクセス順のデータが返ってくるかをタグによりチェックしており、有効なタグが返ってくればそのままマスター11に返す。また、無効なタグが帰ってくれば蓄積しておく。もちろん、蓄積したデータでマスター11へ返せるものがあれば、その蓄積したデータを返す。このように、マスター11はバッファ713に対してIn-Order制御、バッファ713はキャッシュ31に対してOut-of-Order制御となる。
The
以上は、マスター11以外のマスター、キャッシュ31以外のキャッシュも同様である。このように、マスターはIn-Orderで処理することが可能で、本実施例のメモリ制御装置はOut-of-Orderで最適なアクセス順を選び処理することが可能である。
The same applies to masters other than the
次に、バスマトリクス21の調停方式について詳しく説明する。
Next, the arbitration method of the
ここで、マスター11から16のアクセスは特に同期しておらず、任意にアクセスできるものとする。例えば、マスター11は時間内に画像の一定量を処理し外部に出力するものとし、マスター12は時間制約なく別の画像を初期化するものとする。
Here, the accesses from the
マスター11とマスター12は共にアクセス要求を常に出せるものとし、SDRAM61に対するアクセスのみを行うものとする。また、マスターそれぞれの論理帯域と、アクセス制御装置51とSDRAM61間の物理帯域とは等しいものとする。
It is assumed that both the
この例では、マスター11とマスター12はSDRAM61をターゲットにアクセスを行うため、キャッシュ31から38にデータが常にない状態(キャッシュミス)だと、アクセス制御装置51とSDRAM61間の物理帯域がボトルネックになる。従って、マスター2個の論理帯域は、SDRAMの物理帯域を分け合うことになる。
In this example, since the
ここで、実施例1で示したように、調停装置211から218がラウンドロビン形式でアクセスを調停すると、マスター11とマスター12のアクセスは交互に受け付けられることになる。これは、マスター11にとって論理帯域の最大近くの作業が必要になると、時間内に処理できなくなるといった不都合が生じる。
Here, as shown in the first embodiment, when the arbitrating
このため、調停装置211から218は優先度制御を行うようにする。図14を用いて、調停装置211に対する優先度制御を説明する。調停装置212から218は同じ構造なので説明を割愛する。
For this reason, the arbitrating
図14において、2112から2115は優先度選択装置、2116から2119はラウンドロビン調停装置、2120は優先調停装置である。また、マスター11から16は、任意のタイミングで優先度Priorityを2ビットで指示するものとする。優先度Priorityは、数字が大きいほど優先度が高いことを示す。
In FIG. 14, 2112 to 2115 are priority selection devices, 2116 to 2119 are round robin arbitration devices, and 2120 is a priority arbitration device. The
実施例1で説明したように、選択装置2111はキャッシュ31から38それぞれに対するアクセスを選択する。図14では簡単のため、キャッシュ31に対する選択だけを記載している。選択装置2111でマスターごとにキャッシュ31に対するアクセスを抽出した後、それらは全て優先度選択装置2112から2115に入力する。
As described in the first embodiment, the
優先度選択装置2112は優先度Priorityが0のものだけを、優先度選択装置2113は優先度Priorityが1のものだけを、優先度選択装置2114は優先度Priorityが2のものだけを、優先度選択装置2115は優先度Priorityが3のものだけを抽出する。その抽出結果は、ラウンドロビン調停装置2116から2119にそれぞれ入力する。
ラウンドロビン調停装置2116から2119は、実施例1で説明した調停装置211の役割を装置として置き換えたもので、全て同じ動作を行う。
Round-
優先調停装置2120は、ラウンドロビン調停装置2116から2119の結果から、キャッシュ31への最終的なアクセスを選択する。選択にあたっては、ラウンドロビン調停装置2116<ラウンドロビン調停装置2117<ラウンドロビン調停装置2118<ラウンドロビン調停装置2119の順で優先的に決定する。例えば、ラウンドロビン調停装置2119にアクセスがあれば(ない場合は優先度Priorityが3を指示したマスターが存在しない)、他のラウンドロビン調停装置の結果に関係なくそれを最終的なアクセスとする。
The
以上のことから、マスターが急を要するアクセスには、高い優先度Priorityを指示することにより、帯域を優先的に割り当てることができる。例えば、マスター11は時間内に処理するため、高い優先度Priorityを指示しておく。次に、マスター12は時間制約がないため、低い優先度Priorityを指示しておく。このようにすれば、競合してもマスター11が優先的にアクセスできることになり、マスター11に与えられた制約を満たすことができる。
From the above, it is possible to preferentially assign a bandwidth to an access requiring urgent mastering by instructing a high priority Priority. For example, since the
さらに、優先度Priorityを動的に制御すれば、マスターごとに任意の帯域を与える制御が可能である。以下、詳細に説明する。 Furthermore, if the priority Priority is dynamically controlled, it is possible to control to give an arbitrary band for each master. Details will be described below.
例えば、実現可能な目標帯域をそれぞれのマスターで設定する。それぞれのマスターにおいて、アクセス要求が受け付けられればアクセス分を加算、そうでない場合は1サイクルごともしくはシステムのタイマーを使用して一定間隔ごとに目標帯域分を減算する差分カウンターを備える。 For example, a feasible target bandwidth is set for each master. Each master is provided with a difference counter that adds an access if an access request is accepted, and subtracts a target bandwidth every cycle or every predetermined interval using a system timer otherwise.
このカウンターの値の範囲を3レベル設定しておき、それにより優先度Priorityに+1、±0、−1を加え修正する。なお、優先度Priorityは、アクセスそのものに直接影響しないので任意のタイミングで制御する。 The range of the value of this counter is set to 3 levels, thereby correcting the priority Priority by adding +1, ± 0, -1. The priority Priority does not directly affect the access itself and is controlled at an arbitrary timing.
また、一定の条件で制御させるため、それぞれのマスターのベースとなる優先度Priorityを、1もしくは2のいずれかに定めておく。 Further, in order to perform control under certain conditions, the priority Priority that is the base of each master is set to either 1 or 2.
この手法は、安定的なフィードバック制御となり、使用帯域を目標帯域に収束させる。図15に、8個のマスターと8個のキャッシュで構成される本実施例のメモリ制御装置をモデル化し、ランダムなアドレスとバースト長4でシミュレーションした波形を示す。ここで、Diff Countは上述した差分カウンター、Priorityは上述した優先度Priorityの修正分、Allocationはマスターのアクセス要求が受け付けられた瞬間を示す(バースト長4なので、データの数はこれに4を掛けたものになる)。また、これらの添え字はマスターの番号であり、横軸はシミュレーション時間の一部である。マスター0と1は1/16、マスター2と3は1/8、マスター4と5は1/4、マスター6は15/16、マスター7は1/1の相対的な目標帯域を設定してある。
This method provides stable feedback control and converges the used band to the target band. FIG. 15 shows a waveform of a model of the memory control device of this embodiment configured with 8 masters and 8 caches, and simulated with random addresses and a burst length of 4. Here, Diff Count is the difference counter described above, Priority is the amount of correction of the priority Priority described above, and Allocation is the moment when the master access request is accepted (the burst length is 4, so the number of data is multiplied by 4) ) These subscripts are master numbers, and the horizontal axis is part of the simulation time.
図15のAllocationから分かるように、目標帯域を多く設定したマスターのアクセスが相対的に多く受け付けられているのが分かる。また、マスターの帯域取得状況が分かるDiff Countを見ると、目標帯域を低く設定したマスターは十分な帯域を取得しているためPriorityが小さくなっており、逆に目標帯域を高く設定したマスターは取得帯域が目標帯域の前後で振れいているためPriorityも振られている。 As can be seen from Allocation in FIG. 15, it can be seen that a relatively large number of master accesses with a large target bandwidth set are accepted. Also, looking at the Diff Count, which shows the bandwidth acquisition status of the master, the master with the target bandwidth set low has acquired enough bandwidth, so the priority is low, and conversely the master with the target bandwidth set high is acquired. Since the bandwidth fluctuates before and after the target bandwidth, Priority is also assigned.
以上のように、優先度Priorityを設定し、それに応じてキャッシュへアクセスを配分することで、帯域制御が可能な柔軟性の高いメモリ制御装置が提供できる。 As described above, by setting the priority Priority and allocating access to the cache accordingly, a highly flexible memory control device capable of bandwidth control can be provided.
なお、優先度Priorityは2ビットで説明したが、さらにビット数を上げ粒度を増やしてもよいし、逆にビット数を下げ粗く制御してもよい。また、目標帯域に対する制御をマスターでなく、本実施例のメモリ制御装置で実施してもよい。 Although the priority Priority has been described with 2 bits, the number of bits may be further increased to increase the granularity, or conversely, the number of bits may be decreased and controlled roughly. Further, the control for the target bandwidth may be performed by the memory control device of this embodiment instead of the master.
さらに、本実施例の調停装置を外部に複製し、マスター数を増やしてもよい。例えば、マスター11の代わりに6個のマスターを調停する調停装置を取り付ければ、さらに6個のマスターが拡張できる(残り5個+6個の合計11個)。ただし、拡張した調停装置でアクセスが束ねられるので、拡張した複数のマスターはキャッシュに対して同時アクセスできない。
Furthermore, the arbitration device of the present embodiment may be duplicated outside to increase the number of masters. For example, if an arbitration device that mediates 6 masters is attached instead of the
本発明の実施例3に係るメモリ制御装置について説明する。本実施の形態は、実施例1を参照しながら説明する。
A memory control apparatus according to
選択装置2111におけるキャッシュ11から38へのアクセスの分配(バンク分け)、分離装置41におけるSDRAM61と62へのアクセスの分配(Group分け)、アクセス制御装置51におけるSDRAM61aと61bへのアクセスの分配(Set分け)のそれぞれについて説明する。
Distribution of access from the
選択装置2111と分離装置41、およびアクセス制御装置51にはアドレスの参照ビットをレジスタで与えることとする。調停装置212から218内の分離装置、およびアクセス制御装置52も同様である。レジスタで与えることにより、アドレスによりどのSDRAMおよびどのDRAMバンクにデータを格納するかのマッピングが任意に指定できる。
The
図16は、SDRAM61に代わり61aと61bのSDRAMに、SDRAM62に代わり62aと62bのSDRAMに、それぞれ2個づつ置き換えた構成図である。SDRAM61aと61bはGroup番号0でSet番号がそれぞれ0と1、SDRAM62aと62bはGroup番号1でSet番号がそれぞれ0と1とする。
FIG. 16 is a configuration diagram in which two
図17は、アドレス4,5,6ビット目をバンク分けとして参照するよう選択装置2111およびその他調整装置内の選択装置に指示し、次にアドレス12ビット目をGroup分けとして参照するよう分離装置41に指示し、最後にアドレス13ビット目をSet分けとして参照するようアクセス制御装置51と52に指示した場合のメモリマッピングである。図17の、B0、B1、B2はバンク分けのビット、GrpはGroup分けのビット、SetはSet分けのビットである。
In FIG. 17, the
図17に示したメモリマッピングは、データを16ByteごとにそれぞれのSDRAMのDRAMバンクへ、4KByteごとに異なるグループのSDRAMへ、8KByteごとに異なるセットのSDRAMへ分配する例である。この例では、データは細かく分断してSDRAMに格納される。分断するとアクセスが平均化するため、複数のキャッシュと複数のSDRAMが同時に動作することが多くなり、メモリ性能を引き出しやすい。 The memory mapping shown in FIG. 17 is an example in which data is distributed to the DRAM banks of each SDRAM every 16 bytes, to different groups of SDRAM every 4 Kbytes, and to different sets of SDRAM every 8 Kbytes. In this example, the data is divided finely and stored in the SDRAM. Since the access is averaged when divided, a plurality of caches and a plurality of SDRAMs often operate at the same time, and the memory performance is easily obtained.
図18は、アドレス9,10,11ビット目をバンク分けとして参照するよう選択装置2111およびその他調整装置内の選択装置に指示し、次にアドレス31ビット目をGroup分けとして参照するよう分離装置41に指示し、最後にアドレス30ビット目をSet分けとして参照するようアクセス制御装置51と52に指示した場合のメモリマッピングである。図18の、B0、B1、B2はバンク分けのビット、GrpはGroup分けのビット、SetはSet分けのビットである。
In FIG. 18, the
図18に示したメモリマッピングは、データを512ByteごとにそれぞれのSDRAMのDRAMバンクへ、2GByteごとに異なるGroupのSDRAMへ、1GByteごとに異なるSetのSDRAMへ分配する例である。この例では、データは固まってSDRAMに格納される。固まるとアクセスが局所化するため、4個のSDRAMが同時に動作することが少なくなり、消費電力を抑えやすい。 The memory mapping shown in FIG. 18 is an example in which data is distributed to a DRAM bank of each SDRAM every 512 bytes, to a different group SDRAM every 2 Gbytes, and to a different set SDRAM every 1 Gbyte. In this example, the data is consolidated and stored in the SDRAM. When it is solidified, access is localized, so that four SDRAMs are less likely to operate simultaneously, and it is easy to suppress power consumption.
以上のように、アドレスの任意の位置のビットを参照させることで、アクセスを任意の空間に分配することができる。なお、アドレスのビット参照位置はバラバラであっても、前後が入れ替わっても問題ない。 As described above, access can be distributed to an arbitrary space by referring to a bit at an arbitrary position of an address. Note that there is no problem even if the bit reference position of the address is disjoint or the front and rear are switched.
前述した分配の全ては排他的である。例えば、選択装置2111で分配されるアクセスのアドレスは、完全に排他的であることから、キャッシュ内の管理も排他的である。これらは、異なるSDRAMおよびSDRAM内のDRAMバンクにも当てはまる。
All of the aforementioned distributions are exclusive. For example, since the access addresses distributed by the
データが排他的に管理されているため、キャッシュとSDRAMの一貫性(コヒーレンス)は保証される。ただし、マスター11から16のアクセスが、調停装置211から218で調停されるまでの順序は守らなければならない。これは、前述した同一マスターのデータに関するIn-Order制御、Out-of-Order制御とは異なる。
Since the data is managed exclusively, the coherence between the cache and the SDRAM is guaranteed. However, the order until the accesses from the
例えば、マスター11がアドレスAに書き込みを行い、マスター12がアドレスAを読み出す場合、調停装置211から218のいずれかに到達する順序さえ守られれば、キャッシュ31から38のいずれかでは順序通り処理をするので不整合は生じない。しかし、調停装置211から218のいずれかに到達する順序が入れ替わると、マスター12の読み出しが先行して誤ったデータを返してしまう。
For example, when the
調停装置211から218のいずれかに到達する順序を守る方法を説明する。マスター11から16の書き込みアドレスを、図13のインターフェイス装置71から76のそれぞれに登録しておき、その書き込みアドレスが調停装置に到達すれば登録を抹消するようにする。登録されているアドレスは、各マスターごとに用意されたインターフェイス装置71から76全てから相互参照できるようにする。
A method of keeping the order of reaching any of the
任意のマスターが読み出しもしくは書き込みを行う際、自らを除き、各インターフェイス装置71から76で登録されているアドレスとの一致を確認する。一致しなければそのままアクセスを受け付け、そうでなければアクセスを保留する。アクセスの保留は、登録されたアドレスが調停装置に到達した時点で解除される。
When an arbitrary master performs reading or writing, it confirms a match with the address registered in each
この操作により、先行する書き込みアクセスは追い越されることがない。このような単純なアドレスの相互確認の仕組みにより、マスター間のコヒーレンスを確保することができる。 With this operation, the preceding write access is not overtaken. With such a simple address mutual confirmation mechanism, coherence between masters can be ensured.
次に、キャッシュがSDRAMに対して行う、読み出しと書き込みにも注意する必要がある。例えば、マスターからの読み出しがキャッシュミスすると、新たな格納場所を空けるため一旦SDRAMに左記の格納場所にあったデータを書き込む。その後、必要なデータを空けた格納場所にSDRAMから読み出す。この動作の順序も守らなければなければならない。 Next, it is necessary to pay attention to the reading and writing that the cache performs on the SDRAM. For example, when a read from the master misses a cache, data corresponding to the storage location on the left is once written in the SDRAM in order to make a new storage location. Thereafter, the necessary data is read from the SDRAM to a storage location freed. This sequence of actions must also be observed.
この場合も同様に、SDRAMに対する書き込みアドレスを登録し、SDRAMに対するアドレスとの一致確認を行う。一致していれば、登録された書き込みアクセスが分離装置41に到達するまでアクセスを保留させる。ただし、キャッシュ31から38はマスター11から16の場合と違いお互いが排他的なので、相互チェックは不要である。
In this case as well, a write address for the SDRAM is registered and a match with the address for the SDRAM is confirmed. If they match, the access is suspended until the registered write access reaches the
この操作により、先行する書き込みアクセスは追い越されることがない。このような単純なアドレスの相互確認の仕組みにより、キャッシュ内のコヒーレンスを確保することができる。 With this operation, the preceding write access is not overtaken. This simple address mutual confirmation mechanism can ensure coherence in the cache.
以上のように、インターフェイス装置71から76と、キャッシュ31から38のそれぞれで、アドレスの相互チェック機能を導入することで、メモリ制御装置全体でのコヒーレンスを完全に保証することができる。
As described above, by introducing the address mutual check function in each of the
なお、アドレスの登録および一致確認は、全てのビットに対して行う必要はない。回路規模を削減するため、ある範囲のビットだけを対象にしてもよい。ただし、ある範囲のビットだけで処理すると、アドレスの一致の疑いのあるアクセスも保留されるので、性能は劣化する。例えば、32ビットに対して一部の16ビットを対象にすれば、65536のアクセスに一回程度(アクセス要求の頻度でさらに下がる)は、余分なアクセスの保留が生じることになる。 It is not necessary to perform address registration and match confirmation for all bits. In order to reduce the circuit scale, only a certain range of bits may be targeted. However, if processing is performed with only a certain range of bits, the access that is suspected of address matching is also suspended, and the performance deteriorates. For example, if a part of 16 bits is targeted with respect to 32 bits, an extra access is suspended about once in 65536 accesses (which is further reduced by the frequency of access requests).
本発明の実施例4に係るメモリ制御装置について説明する。本実施の形態は、実施例1を参照しながら説明する。
A memory control apparatus according to
キャッシュ31から38の方式は、ダイレクトマップ、セットアソシアエイティブ、フルアソシアエイティブの任意のものを選択することができる。方式によって性能やコストは変わる。ここではいくつかの方式のうち、性能とコストのバランスに優れるセットアソシアエイティブを用いることにする。
As the
セットアソシアエイティブ型のキャッシュは、それぞれのデータ管理が排他的なWayと呼ばれるバンクを持っている。即ち、Wayの1つだけにアクセスが行われる。いずれにアクセスするかは、そのときの状態に依存する。例えば、Wayが4つあり、3つには何か登録されており、1つには何も登録されていないとする。登録されているWayへのアクセスは空きを作る作業が生じ性能が劣化する。そこで、何も登録されていないWayへのアクセスが優先される。 The set associative cache has a bank called “Way” in which each data management is exclusive. That is, only one of the ways is accessed. Which access is made depends on the current state. For example, it is assumed that there are four ways, something is registered in three, and nothing is registered in one. Access to a registered way requires work to create a vacancy, resulting in degraded performance. Therefore, priority is given to access to a way where nothing is registered.
本実施例では、マスター11から16のアクセスをキャッシュ31から38に均等に振り分けることから、キャッシュ31から38のそれぞれは、複数のマスターが共有することになる。しかし、実施例2で述べたように、マスターが要求する論理帯域が違う場合、キャッシュにおいても優先的に、特定のマスターに割り当てる方が性能的に有利な場合がある。
In the present embodiment, since accesses from the
ここでは、キャッシュのWayに識別子となるIDを付けておく。また、マスターからも、アドレスと同時にIDを指定してアクセスさせる。そして、IDが一致するWayだけがアクセスできるようにする。 Here, an ID serving as an identifier is attached to the cache way. Also, the master is accessed by designating the ID at the same time as the address. Only the Ways whose IDs match can be accessed.
これは、特定のID専用のキャッシュを用意することを意味する。もちろん、異なるマスターが同じIDを用いてアクセスしてもよいし、マスター1つだけがユニークなIDを用いてアクセスしてもよい。Wayに付与するIDも同様である。なお、Wayに付与するIDは予めレジスタ等で与えておく。 This means that a cache dedicated to a specific ID is prepared. Of course, different masters may access using the same ID, or only one master may access using a unique ID. The same applies to IDs assigned to Ways. Note that the ID to be assigned to the Way is given in advance by a register or the like.
図19で詳細に説明する。図19において311から314はそれぞれ同じ動作、同じ容量の4個のWayである。 This will be described in detail with reference to FIG. In FIG. 19, 311 to 314 are four ways having the same operation and the same capacity.
Way311から314には、それぞれIDとして0,0,0,1を付与しておく。マスターは任意のIDを指定してアクセスする。マスターが指定するIDが1であった場合、ID=1が付与されたWay314だけがアクセスの対象となる。このWay314に所望のデータがあればキャッシュヒットとなり、なければキャッシュミスとなる。
一方、マスターが指定するIDが0であった場合ID=0が付与されたWay311、312、313がアクセスの対象となる。Wayに管理されているデータは排他的なので、Way311、312、313のいずれか1つだけが最後に選ばれる。
On the other hand, when the ID specified by the master is 0,
しかし、マスターが指定するIDが2であった場合、どのWayにもアクセスできない。この場合、エラーとしてアクセスを無効化するか、強制的にいずれかのWayにアクセスさせるか、もしくはキャッシュをバイパスし直接メモリアクセスするか、のいずれかを選ばなくてはならない。これらは、選択して実装してもよいし、全てを実装しておいてレジスタ等で方式を切り替えてもよい。 However, when the ID specified by the master is 2, no way can be accessed. In this case, it is necessary to select either invalidating access as an error, forcibly accessing any one of the ways, or bypassing the cache and directly accessing the memory. These may be selected and mounted, or all may be mounted and the system may be switched by a register or the like.
また、キャッシュにはフラッシュが必要である。フラッシュは、キャッシュに溜め込んだデータを一挙にSDRAMに書き込み、キャッシュの内容とSDRAMの内容を一致させるものである。キャッシュ全体にフラッシュを行うと、最大、キャッシュ容量分のメモリアクセスが生じてしまい、マスターからのアクセスが受け付けられにくくなるなど性能的に問題になることがある。 In addition, the cache needs to be flushed. In the flash, the data stored in the cache is written into the SDRAM all at once, and the contents of the cache are matched with the contents of the SDRAM. If the entire cache is flushed, memory access for the maximum cache capacity occurs, which may cause performance problems such as difficulty in accepting access from the master.
本実施例では、WayにIDを付与しているので、特定のIDだけを選択してフラッシュすることが可能である。例えば、ID=1のWay314だけをフラッシュするなら、キャッシュ全体のフラッシュに比べ1/4の範囲のフラッシュで済む。
In this embodiment, since an ID is assigned to the way, it is possible to select and flash only a specific ID. For example, if only the
ここで、Wayの代わりに、特定のアドレス範囲ごとにIDを付与する方法もある。さらに、特定のWayと特定のアドレス範囲を組み合わせてIDを付与する方法もある。例えば、特定のIDと特定のアドレス範囲の条件が合致した場合だけアクセス可能にするなどである。フラッシュにおいても、特定のIDでかつ特定のアドレス範囲だけフラッシュする場合なども考えれらる。 Here, instead of way, there is also a method of assigning an ID for each specific address range. Further, there is a method of assigning an ID by combining a specific way and a specific address range. For example, it is possible to access only when a specific ID and a specific address range are matched. Even in the case of flash, there may be a case where a specific ID and a specific address range are flashed.
なお、キャッシュのデータ入れ替え方式として、書き込むと同時にメモリにも書き込む方式と、新たなキャッシュへのアクセスにより空きがない場合だけ蓄積されたデータをメモリに退避させる方式とがあるが、本実施例のメモリ制御装置はいずれでもよい。 The cache data replacement method includes a method of writing to the memory at the same time as writing, and a method of saving the accumulated data to the memory only when there is no free space due to access to a new cache. Any memory control device may be used.
さらに、キャッシュはFIFOなどの簡単なバッファに置き換えても、マスターが繰り返しアクセスする場合の効率が下がるだけなので、本実施例の本質には影響ない。 Further, even if the cache is replaced with a simple buffer such as FIFO, the efficiency of the repeated access by the master is reduced, and therefore the essence of the present embodiment is not affected.
本発明のメモリ制御装置は、計算機システムの応用であるデジタルAV機器、携帯端末、携帯電話、コンピュータ機器、車載制御機器、医療機器などに応用できる。 The memory control device of the present invention can be applied to digital AV equipment, mobile terminals, mobile phones, computer equipment, in-vehicle control equipment, medical equipment, and the like, which are applications of computer systems.
1 メモリ制御装置
11 任意の制御装置であるマスター0
12 任意の制御装置であるマスター1
13 任意の制御装置であるマスター2
14 任意の制御装置であるマスター3
15 任意の制御装置であるマスター4
16 任意の制御装置であるマスター5
21 バスマトリクス
31 キャッシュ(バンク0)
32 キャッシュ(バンク1)
33 キャッシュ(バンク2)
34 キャッシュ(バンク3)
35 キャッシュ(バンク4)
36 キャッシュ(バンク5)
37 キャッシュ(バンク6)
38 キャッシュ(バンク7)
41 分離装置
51 アクセス制御装置0
52 アクセス制御装置1
61 SDRAM0
62 SDRAM1
1
12
13
14
15
16
21
32 cash (bank 1)
33 Cash (Bank 2)
34 Cash (Bank 3)
35 cash (bank 4)
36 Cash (Bank 5)
37 Cash (Bank 6)
38 cash (bank 7)
41
52
61 SDRAM0
62 SDRAM1
Claims (11)
複数の前記キャッシュの数は前記メモリ装置のメモリバンクの数に等しく、前記バスマトリクスは複数の前記マスター装置のアドレス情報から指定された部分に従って複数の前記キャッシュに均等かつ排他的にアクセスし、前記アクセス制御装置は前記メモリ装置のメモリバンクの状態を管理し最も早くアクセスできる前記キャッシュのアクセスを選ぶことを特徴としたメモリ制御装置。 A memory device composed of a plurality of memory banks; a bus matrix that receives access from a plurality of master devices; a plurality of caches that are accessed from the bus matrix and store temporary data; A memory control device comprising an access control device that selects one and accesses the memory device,
The number of the plurality of caches is equal to the number of memory banks of the memory device, and the bus matrix accesses the plurality of caches equally and exclusively according to a portion specified from address information of the plurality of master devices, The access control device manages the state of the memory bank of the memory device and selects the cache access that can be accessed earliest.
前記アクセス制御装置は前記メモリ装置のメモリバンクごとに状態を管理するテーブルを備え、前記テーブルからアクセスに適したメモリバンクを抽出し予約バンクとし、同時に前記テーブルから直前にアクセスしたメモリバンクを選び優先バンクとし、複数の前記キャッシュの中から前記優先バンクに適したアクセスを取り出し前期メモリ装置へのアクセスとし、なければ複数の前記キャッシュの中から前記予約バンクに適したアクセスを一つ取り出し前期メモリ装置へのアクセスとすることを特徴としたメモリ制御装置。 The memory control device according to claim 1,
The access control device includes a table for managing a state for each memory bank of the memory device, extracts a memory bank suitable for access from the table as a reserved bank, and simultaneously selects and prioritizes a memory bank accessed immediately before from the table. An access suitable for the priority bank is taken out from a plurality of the caches as an access to the previous memory device, and if not, one access suitable for the reserved bank is taken out from the plurality of caches. A memory control device characterized by access to
複数の前記メモリ装置とで構成し、
複数の前記キャッシュの数は複数の前記メモリ装置のメモリバンクの数の合計に等しく、前記アクセス制御装置は複数の前記メモリ装置のメモリバンクの状態を管理し最も早くアクセスできる前記キャッシュのアクセスを選び該当する前記メモリ装置だけにアクセスすることを特徴としたメモリ制御装置。 The memory control device according to claim 1,
A plurality of the memory devices,
The number of the plurality of caches is equal to the sum of the number of memory banks of the plurality of memory devices, and the access control unit manages the state of the memory banks of the plurality of memory devices and selects the cache access that can be accessed earliest. A memory control device that accesses only the corresponding memory device.
複数の前記メモリ装置にアクセスする複数の前記アクセス制御装置と、複数の前記キャッシュからアクセスされ複数の前記アクセス制御装置にアクセスする分離装置とで構成し、
複数の前記アクセス制御装置の数は複数の前記メモリ装置の数に等しくそれぞれ接続し、前記分離装置は複数の前記キャッシュそれぞれのアドレス情報から指定された部分に従って複数の前記アクセス制御装置に均等かつ排他的にアクセスすることを特徴としたメモリ制御装置。 The memory control device according to claim 1,
A plurality of the access control devices that access the plurality of memory devices, and a separation device that is accessed from the plurality of caches and accesses the plurality of access control devices,
The number of the plurality of access control devices is connected to be equal to the number of the plurality of memory devices, respectively, and the separation device is equally and exclusive to the plurality of access control devices according to a portion specified from the address information of each of the plurality of caches. Memory control device characterized in that it is accessed periodically.
前記分離装置は複数の前記メモリ装置間を跨ぐアクセスであれば直前のデータアクセス期間分前記アクセス制御装置へのアクセスを禁止し、跨がないアクセスであればそのまま前記アクセス制御装置へアクセスすることを特徴としたメモリ制御装置。 The memory control device according to claim 4,
The access device forbids access to the access control device for the immediately preceding data access period if the access is made across a plurality of the memory devices, and accesses the access control device as it is if there is no access across the memory devices. A memory control device.
複数の前記キャッシュからアクセスされる結合装置とで構成し、
複数の前記キャッシュの数は前記メモリ装置のメモリバンクの数の整数倍に等しく、前記結合装置は複数の前記キャッシュそれぞれのアドレス情報から指定された部分又は予め前記キャッシュに与えられた識別情報に従って前記メモリ装置のメモリバンクの数になるように調停し、前記アクセス制御装置にアクセスすることを特徴としたメモリ制御装置。 The memory control device according to claim 1,
A plurality of coupling devices accessed from the cache;
The number of the plurality of caches is equal to an integral multiple of the number of memory banks of the memory device, and the coupling device is configured according to the part designated from the address information of each of the plurality of caches or the identification information given to the cache in advance. A memory control device that performs arbitration so as to have the number of memory banks of the memory device and accesses the access control device.
複数のマスター装置からそれぞれアクセスされるインターフェイス装置とで構成し、
前記インターフェイス装置は複数の前記キャッシュに対する書き込みバッファと読み出しバッファを備え、
前記インターフェイス装置は前記アクセス制御装置の書き込みアクセスに対して、そのまま前記バスマトリクスに通知し、前記マスター装置のデータを順に前記書き込みバッファへ格納し、前記バスマトリクスが指定する書き込み情報を元に前記書き込みバッファからデータを取り出し複数の前記キャッシュに送り、
前記インターフェイス装置は前記アクセス制御装置の読み出しアクセスに対して、そのまま前記バスマトリクスに通知し、前記キャッシュが指定する読み出し情報を元に前記キャッシュから前記読み出しバッファへデータを格納し、前記読み出しバッファのデータを順に前記マスター装置へ返し、
複数の前記キャッシュは前記バスマトリクスがアクセスと共に指定する読み出し情報を管理し、読み出しデータと共に読み出し情報を返すことを特徴としたメモリ制御装置。 The memory control device according to claim 1,
It consists of interface devices that are accessed from multiple master devices,
The interface device includes a plurality of write buffers and read buffers for the cache,
The interface device notifies the bus matrix of the write access of the access control device as it is, stores the data of the master device in the write buffer in order, and writes the data based on the write information specified by the bus matrix. Retrieves data from the buffer and sends it to the caches,
The interface device notifies the bus matrix of read access of the access control device as it is, stores data from the cache to the read buffer based on read information specified by the cache, and stores data in the read buffer. In turn to the master device,
A plurality of the caches manage read information specified by the bus matrix together with access, and return read information together with read data.
複数のマスター装置からそれぞれアクセスされるアドレス監視装置とで構成し、
前記アドレス監視装置は複数のマスター装置それぞれの書き込みアドレス情報の全て又は一部を登録し、登録アドレスの該当アクセスが前記バスマトリクスに受け付けられれば登録を外し、前記マスター装置の新たなアドレス情報の全て又は一部と登録アドレスとを比較し、一致するなら前記バスマトリクスに対するアクセスを保留し、そうでなければアクセスを許可し、
前記キャッシュは書き込みアドレス情報の全て又は一部を登録し、登録アドレスの該当アクセスが前記アクセス制御装置に受け付けられれば登録を外し、新たなアドレス情報の全て又は一部と登録アドレスとを比較し、一致するなら前記アクセス制御装置に対するアクセスを保留し、そうでなければアクセスを許可することを特徴としたメモリ制御装置。 The memory control device according to claim 1,
It consists of address monitoring devices that are accessed from multiple master devices,
The address monitoring device registers all or part of the write address information of each of the plurality of master devices, removes the registration if the corresponding access of the registered address is accepted by the bus matrix, and all of the new address information of the master device. Or compare the part with the registered address, if they match, defer access to the bus matrix, otherwise allow access,
The cache registers all or part of the write address information, removes the registration if the corresponding access of the registered address is accepted by the access control device, compares all or part of the new address information with the registered address, A memory control device characterized in that access to the access control device is suspended if they match, and access is permitted otherwise.
前記マスター装置はアクセスに関し優先度情報を加え、
前記バスマトリクスは複数の前記キャッシュそれぞれに対応する調停装置を備え、
前記調停装置は前記マスター装置が指定する優先度ごとにアクセスを分け、それぞれラウンドロビン方式で調停し、優先度の高い順から前記ラウンドロビン方式の調停結果の有無を調べ、アクセスがあれば対応する前記キャッシュにアクセスすることを特徴としたメモリ制御装置。 The memory control device according to claim 1,
The master device adds priority information for access,
The bus matrix includes an arbitration device corresponding to each of the plurality of caches,
The arbitration device divides access for each priority specified by the master device, arbitrates in a round-robin manner, checks the presence / absence of the round-robin arbitration result in descending order of priority, and responds if there is an access. A memory control device for accessing the cache.
前記キャッシュはいくつかのバンクで構成し、それぞれのバンクにID値を付与しておき、前記マスター装置はアクセスに関しID情報を加え、前記バスマトリクスはID情報を複数の前記キャッシュに伝え、
前記キャッシュは付与したID値と指示したID情報とが等しくなる前記バンクの一つにアクセスを行い、全ての前記バンクで付与したID値と指示したID情報とが不一致するならアクセスを無効化する、又は任意の前記バンクの一つにアクセスを行う、又は前記アクセス制御装置に直接アクセスを行うことを特徴としたメモリ制御装置。 The memory control device according to claim 1,
The cache is composed of several banks, ID values are assigned to the respective banks, the master device adds ID information for access, and the bus matrix transmits the ID information to the plurality of caches.
The cache accesses one of the banks in which the assigned ID value is equal to the designated ID information, and invalidates the access if the given ID value does not match the designated ID information in all the banks. Or a memory control device that accesses one of the banks or directly accesses the access control device.
前記キャッシュの全て又は一部をFIFO(First−In−First−Out)バッファに置き換えたことを特徴としたメモリ制御装置。 The memory control device according to claim 1,
A memory control apparatus, wherein all or a part of the cache is replaced with a FIFO (First-In-First-Out) buffer.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011039214A JP5640204B2 (en) | 2011-02-25 | 2011-02-25 | Memory control device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011039214A JP5640204B2 (en) | 2011-02-25 | 2011-02-25 | Memory control device |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2012177965A true JP2012177965A (en) | 2012-09-13 |
JP5640204B2 JP5640204B2 (en) | 2014-12-17 |
Family
ID=46979786
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2011039214A Active JP5640204B2 (en) | 2011-02-25 | 2011-02-25 | Memory control device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5640204B2 (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002328837A (en) * | 2001-04-27 | 2002-11-15 | Fujitsu Ltd | Memory controller |
JP2004288021A (en) * | 2003-03-24 | 2004-10-14 | Matsushita Electric Ind Co Ltd | Memory access controller |
JP2005011029A (en) * | 2003-06-18 | 2005-01-13 | Matsushita Electric Ind Co Ltd | Memory access control device |
JP2005339348A (en) * | 2004-05-28 | 2005-12-08 | Renesas Technology Corp | Semiconductor device |
JP2007199816A (en) * | 2006-01-24 | 2007-08-09 | Megachips Lsi Solutions Inc | Bank controller, information processing device, imaging device and control method |
JP2008097572A (en) * | 2006-09-11 | 2008-04-24 | Matsushita Electric Ind Co Ltd | Processing device, computer system, and mobile apparatus |
JP2009093495A (en) * | 2007-10-10 | 2009-04-30 | Nec Computertechno Ltd | Memory access control apparatus, computer, memory access control method, and memory access control program |
-
2011
- 2011-02-25 JP JP2011039214A patent/JP5640204B2/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002328837A (en) * | 2001-04-27 | 2002-11-15 | Fujitsu Ltd | Memory controller |
JP2004288021A (en) * | 2003-03-24 | 2004-10-14 | Matsushita Electric Ind Co Ltd | Memory access controller |
JP2005011029A (en) * | 2003-06-18 | 2005-01-13 | Matsushita Electric Ind Co Ltd | Memory access control device |
JP2005339348A (en) * | 2004-05-28 | 2005-12-08 | Renesas Technology Corp | Semiconductor device |
JP2007199816A (en) * | 2006-01-24 | 2007-08-09 | Megachips Lsi Solutions Inc | Bank controller, information processing device, imaging device and control method |
JP2008097572A (en) * | 2006-09-11 | 2008-04-24 | Matsushita Electric Ind Co Ltd | Processing device, computer system, and mobile apparatus |
JP2009093495A (en) * | 2007-10-10 | 2009-04-30 | Nec Computertechno Ltd | Memory access control apparatus, computer, memory access control method, and memory access control program |
Also Published As
Publication number | Publication date |
---|---|
JP5640204B2 (en) | 2014-12-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10740260B2 (en) | Cache self-clean engine | |
KR101557090B1 (en) | Hierarchical memory arbitration technique for disparate sources | |
US7269709B2 (en) | Memory controller configurable to allow bandwidth/latency tradeoff | |
US9201816B2 (en) | Data processing apparatus and a method for setting priority levels for transactions | |
US8539129B2 (en) | Bus arbitration techniques to reduce access latency | |
JP5365336B2 (en) | Memory control device and memory control method | |
US20120042105A1 (en) | Bus arbitration apparatus | |
JP6754827B2 (en) | Dynamic coding algorithm for intelligent coded memory systems | |
CN106502806B (en) | Bus protocol command processing device and related method | |
EP2444903A1 (en) | A transaction reordering arrangement | |
CN103543954A (en) | Data storage management method and device | |
EP2442231A1 (en) | Reordering arrangement | |
CN112416851B (en) | Extensible multi-core on-chip shared memory | |
CN110059035B (en) | Semiconductor device and bus generator | |
JP5640204B2 (en) | Memory control device | |
US10705985B1 (en) | Integrated circuit with rate limiting | |
EP3493069B1 (en) | Resource allocation for atomic data access requests | |
US10002099B2 (en) | Arbitrated access to resources among multiple devices | |
JP2009251652A (en) | Multi-core system | |
US20080229030A1 (en) | Efficient Use of Memory Ports in Microcomputer Systems | |
JP2009032085A (en) | Data processing system | |
JP2004185451A (en) | Memory access arbitration method and memory access arbitration unit |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20121205 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20121207 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20131114 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20140107 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20140228 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20140617 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20140701 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20140909 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20140922 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5640204 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313113 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |