JP2012177965A - Memory control device - Google Patents

Memory control device Download PDF

Info

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
Application number
JP2011039214A
Other languages
Japanese (ja)
Other versions
JP5640204B2 (en
Inventor
Shuichi Takada
周一 高田
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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to JP2011039214A priority Critical patent/JP5640204B2/en
Publication of JP2012177965A publication Critical patent/JP2012177965A/en
Application granted granted Critical
Publication of JP5640204B2 publication Critical patent/JP5640204B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a memory system capable of providing high access performance to an access device of any number, subjecting high efficiency control to an arbitrary memory configuration, and further performing a flexible configuration while guaranteeing consistency.SOLUTION: A memory control device mounts caches of the same number or integral multiple of a memory bank such as SDRAM, distributes an access of a master to the caches concurrently and simultaneously by a bus matrix, and schedules a cache access optimum for the memory bank to control the cache access.

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 masters 11 to 16, 31 to 37 is a cache that temporarily stores data, and 41 is a bus that bundles accesses of the caches 31 to 37. , 51 and 52 are access control devices for controlling memory access, 61 and 62 are memories, 301 is a buffer for bypassing the bus 21 and bus 41, and 302 is a cache control device for managing addresses of the caches 31 to 37. It is. Here, reference numeral 100 denotes a memory control device including the bus 21, the caches 31 to 37, the bus 41, and the access control devices 51 and 52.

マスター11から16は、メモリ61とメモリ62にアクセスするものであり、そのアクセス経路は、最初にバス21へ、次にキャッシュ31から37のいずれかへ、次にアクセス制御装置51か52のいずれかへ、最後にバス41に到達する。また、特別に、キャッシュ31から37の代わりにバッファ301を経由することもある。キャッシュ31から37もしくはバイパスバッファ301のいずれかを選ぶかは、キャッシュ制御装置302で管理する。   The masters 11 to 16 access the memory 61 and the memory 62, and the access path is first to the bus 21, then to one of the caches 31 to 37, and then to either of the access control devices 51 or 52. Finally, the bus 41 is reached. In addition, in particular, instead of the caches 31 to 37, the buffer 301 may be used. The cache controller 302 manages whether to select the caches 31 to 37 or the bypass buffer 301.

キャッシュ31から37にはそれぞれ管理番号が付与されており、マスター11から16は、キャッシュ制御装置302にそれらの番号を伝える。番号は直接指定するか、テーブル等で変換して間接指定する。従ってこれらは、キャッシュ31から37の選択番号になる。一方、バイパスバッファ301は、いずれのキャッシュにもアクセスせず、直接メモリ61と62に対して読み出したり書き出したりする場合に使用する。もちろん、キャッシュへの読み出しもしくは書き込みと同時に、バイパスバッファ301を通じて早くマスターもしくはメモリにデータを返したい場合にも利用する。   Management numbers are assigned to the caches 31 to 37, respectively, and the masters 11 to 16 transmit these numbers to the cache control device 302. Specify the number directly, or specify it indirectly by converting it with a table. Therefore, these are the selection numbers of the caches 31 to 37. On the other hand, the bypass buffer 301 is used when reading or writing directly to the memories 61 and 62 without accessing any cache. Of course, it is also used when it is desired to return data to the master or memory through the bypass buffer 301 at the same time as reading or writing to the cache.

メモリ61と62に接続するアクセス制御装置51と52は、キャッシュ31から37内に記録されているアドレス情報により振り分けられる。このアドレス情報はマスターがアクセスする度に与えられる。また、バイパスバッファ301を利用する場合は、マスターが発行するアドレス情報を直接用いる。   The access control devices 51 and 52 connected to the memories 61 and 62 are distributed according to the address information recorded in the caches 31 to 37. This address information is given each time the master accesses. When the bypass buffer 301 is used, address information issued by the master is directly used.

バス21とバス41は同時に活性化できるため、マスター11から16のいずれかがキャッシュ31から37のいずれかにアクセスする場合と、キャッシュ31から37のいずれかがアクセス制御装置51と52にアクセスする場合とは、同時に実施できる。   Since the bus 21 and the bus 41 can be activated at the same time, one of the masters 11 to 16 accesses one of the caches 31 to 37, and one of the caches 31 to 37 accesses the access control devices 51 and 52. Sometimes it can be done at the same time.

以上のように、従来のメモリ制御装置は、マスターから直接または間接的に任意のキャッシュが選択可能である。システムの状況によって、一部のマスターに手厚くキャッシュを割り当てたりすることができ、限られたキャッシュ容量で効率よく高性能化を図ることができる。また、複数のキャッシュを用いているので、動作の遅いメモリ、例えば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.

特開平10−326225号公開公報Japanese Laid-Open Patent Publication No. 10-326225

しかしながら、特許文献1のような従来のメモリ制御装置にあっては、以下のような問題点があった。   However, the conventional memory control device such as Patent Document 1 has the following problems.

メモリバンク構造(例えば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 masters 11 to 16 access the caches 31 to 37 in order. Only occurs.

以上のことから、1つか2つのキャッシュが順次メモリをアクセスすることになる。アクセス制御装置51もしくは52は、その順序に従ってSDRAMを制御するしかなく、前述したSDRAMの制約でアクセス効率が低下する場合であっても、それを回避することができない。即ち、従来のメモリ制御装置では、SDRAM等の最適な制御が困難である。   From the above, one or two caches sequentially access the memory. The access control device 51 or 52 can only control the SDRAM according to the order, and it cannot be avoided even when the access efficiency is lowered due to the restrictions of the SDRAM. That is, it is difficult for the conventional memory control device to optimally control the SDRAM or the like.

このように、キャッシュが複数あっても同時刻に活性化しているキャッシュは、マスターからアクセスを受けたキャッシュと、メモリへのアクセスを行うキャッシュのたかだか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 bus 21 connecting the master and the cache eventually becomes a bottleneck. In order to solve this, it is necessary to increase the access width of the bus 21, but since all the masters need countermeasures, the circuit becomes expensive. In addition, since the basic unit of master access is proportionally long, it is disadvantageous in terms of performance, for example, for performing fine addressing such as random access.

同様に、メモリが複数あっても同時にキャッシュからアクセスできなければ、結局キャッシュとメモリを繋ぐバス41がボトルネックになってしまう。これを解消するにはバス41のアクセス幅を増加させる必要があるが、SDRAMなどのメモリのバス幅の変更は、例えばLSIや基板の端子数増加につながるため困難なこともある。   Similarly, even if there are a plurality of memories and cannot be simultaneously accessed from the cache, the bus 41 connecting the cache and the memory eventually becomes a bottleneck. In order to solve this problem, it is necessary to increase the access width of the bus 41. However, changing the bus width of a memory such as an SDRAM may be difficult because it leads to an increase in the number of terminals of an LSI or a substrate, for example.

さらに、従来のメモリ制御装置では、複数のマスターが特定のキャッシュを割り当てるため、キャッシュどうしで同じアドレスを管理してしまうことも考えられる。例えば、マスター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 master 11 writes data Y to the cache 31 at address X. On the other hand, assume that the master 12 reads data from the address X to the cache 32. In this case, since the cache is different, the data Y written by the master 11 cannot be read from the master 12.

もう一つの例として、マスター11がキャッシュ31に対してアドレスX番地にデータYを書くとする。遅れて、マスター12がキャッシュ32に対してアドレスX番地にデータZを書くとする。この場合もキャッシュが異なるので、最終のメモリに書かれるものはYかZかを保証できない。これは、キャッシュの書き出す順序が保証されていないためである。   As another example, assume that the master 11 writes data Y at address X in the cache 31. Assume that the master 12 writes the data Z at the address X in the cache 32 with a delay. Also in this case, since the caches are different, it cannot be guaranteed that what is written in the final memory is Y or Z. This is because the order of writing out the cache is not guaranteed.

これらは、コヒーレンス(一貫性)を欠く操作になるため、以下のいずれかを選択しなければならない。さもなければ、システム内でデータの加工順などが入れ替わって予期せぬ結果になったり、ハングアップなど致命的な状態になったりすることになる。   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 cache control device 302, and when the corresponding data is found in the cache not designated by the master, the contents of the found cache are once written to the memory. Or invalidate.

前者は完全なコヒーレンスは実現できないが安価である。後者は完全なコヒーレンスが実現できるが、キャッシュ内で管理しているアドレスの総チェックが必要なため高価で、コンフリクト時には余分なメモリアクセスが生じ性能も劣化する。   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 master 11 and reprocess an image processed by the master 12, the same cache must be specified to access the same data. Therefore, in a series of data processing, the same cache group is often specified, and there is a possibility that an unused cache will appear.

従って、いずれを選択しても、コヒーレンスを保証するには大きな制約が課せられる。   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.

本発明のメモリ制御装置を説明する図である。It is a figure explaining the memory control apparatus of this invention. 本発明の実施例1のバスマトリクスの動作を説明する図である。It is a figure explaining operation | movement of the bus matrix of Example 1 of this invention. 本発明の実施例1のバスマトリクスの動作性能(密度1)を説明する図である。It is a figure explaining the operation | movement performance (density 1) of the bus matrix of Example 1 of this invention. 本発明の実施例1のバスマトリクスの動作性能(密度0.5)を説明する図である。It is a figure explaining the operation | movement performance (density 0.5) of the bus matrix of Example 1 of this invention. 本発明の実施例1のキャッシュとSDRAMの関係を説明する図である。It is a figure explaining the relationship between the cache and SDRAM of Example 1 of this invention. 本発明の実施例1のキャッシュ(倍増)とSDRAMの関係を説明する図である。It is a figure explaining the relationship between the cache (double) and SDRAM of Example 1 of this invention. 本発明の実施例1のキャッシュ(半減)とSDRAMの関係を説明する図である。It is a figure explaining the cache (half) and SDRAM of Example 1 of this invention. 本発明の実施例1のキャッシュとSDRAM(2個)の関係を説明する図である。It is a figure explaining the relationship between the cache of Example 1 of this invention, and SDRAM (2 pieces). 本発明の実施例1のSDRAM内のバンクのアクセスを説明する図である。It is a figure explaining the access of the bank in SDRAM of Example 1 of this invention. 本発明の実施例1のSDRAM内のアクセスの選択を説明する図である。It is a figure explaining selection of access in SDRAM of Example 1 of this invention. 本発明の実施例1のSDRAM(同一特性)への分配を説明する図である。It is a figure explaining distribution to SDRAM (same characteristic) of Example 1 of this invention. 本発明の実施例1のSDRAM(異なる特性)への分配を説明する図である。It is a figure explaining distribution to SDRAM (different characteristics) of Example 1 of the present invention. 本発明の実施例2のバスマトリクスの動作を説明する図である。It is a figure explaining operation | movement of the bus matrix of Example 2 of this invention. 本発明の実施例2の調停動作を説明する図である。It is a figure explaining the arbitration operation | movement of Example 2 of this invention. 本発明の実施例2の調停によるアクセス動作を説明する図である。It is a figure explaining the access operation by the arbitration of Example 2 of this invention. 本発明の実施例3のSDRAMの構成を説明する図である。It is a figure explaining the structure of SDRAM of Example 3 of this invention. 本発明の実施例3のアドレスマッピング(性能重視)を説明する図である。It is a figure explaining the address mapping (performance importance) of Example 3 of this invention. 本発明の実施例3のアドレスマッピング(電力重視)を説明する図である。It is a figure explaining the address mapping (electric power emphasis) of Example 3 of this invention. 本発明の実施例4のキャッシュのID付与による動作を説明する図である。It is a figure explaining the operation | movement by ID assignment of the cache of Example 4 of this invention. 従来のメモリ制御装置を説明する図である。It is a figure explaining the conventional memory control apparatus.

以下、本発明の実施の形態について、図面を参照して詳細に説明する。   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 Embodiment 1 of the present invention will be described. In the present embodiment, an example in which an SDRAM widely used in a computer system is applied will be described with reference to FIG.

図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 caches 31 to 38 by referring to addresses for each SDRAM target; 51 and 52, an access control device for selecting an optimum access to the SDRAM from a plurality of memory access requests; Reference numerals 62 denote SDRAMs. Here, 1 is a memory control device according to the present invention comprising a bus matrix 21, caches 31 to 38, a separation device 41, and access control devices 51 and 52.

バスマトリクス21は、マスター11から16の6つのアクセスを、キャッシュ31から38への8つアクセスに接続する。図2はこの接続を示したものである。図2において、211から218は同一キャッシュへアクセスするアクセスを集め、1つのアクセスを選択する調停装置である。説明の簡単のため、マスター11から16のそれぞれと、調停装置211との接続だけを示している。実際は、調停装置212から218も同様にマスター11から16のそれぞれに接続する。なお、調停装置211から218は全く同じ構造のものである。   The bus matrix 21 connects six accesses from the masters 11 to 16 to eight accesses to the caches 31 to 38. FIG. 2 shows this connection. In FIG. 2, reference numerals 211 to 218 denote arbitration devices that collect accesses that access the same cache and select one access. For simplicity of explanation, only the connection between each of the masters 11 to 16 and the arbitrating device 211 is shown. Actually, the arbitration devices 212 to 218 are similarly connected to the masters 11 to 16, respectively. Note that the arbitrating devices 211 to 218 have the same structure.

調停装置211から218のそれぞれには、選択装置が組み込まれている。ここも説明の簡単のため、調停装置211内の2111の選択装置だけを示している。選択装置2111はセレクタ信号により、キャッシュ31に対応するアクセスだけを抽出するフィルタの働きをする。   Each of the arbitration devices 211 to 218 includes a selection device. For the sake of simplicity, only the selection device 2111 in the arbitration device 211 is shown here. The selection device 2111 functions as a filter that extracts only the access corresponding to the cache 31 by the selector signal.

セレクタ信号はキャッシュ31から38を選択する番号であり、調整装置211から218それぞれの順番に等しい。例えば、調整装置211は0、調整装置212は1、調整装置218は7といった具合である。このセレクタ信号と、マスターのアドレス信号を比較することで、選択装置221のフィルタが実施される。アドレス信号の参照ビットは予め指定しておいてもよいし、レジスタ等で指示してもよい。   The selector signal is a number for selecting the caches 31 to 38, and is equal to the order of the adjusting devices 211 to 218. For example, the adjustment device 211 is 0, the adjustment device 212 is 1, the adjustment device 218 is 7, and so on. By comparing this selector signal with the master address signal, the filter of the selection device 221 is implemented. The reference bit of the address signal may be designated in advance or may be indicated by a register or the like.

例えば、バイト単位でアクセスするアドレス信号が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 address 0 to 15 are all 0 for the lower 6th, 5th, and 4th bits, so the selector signal 231 of the selector 231 To pass through. Access to addresses 16 to 127 is blocked because the lower 6th, 5th and 4th bits are not all 0's. Addresses 128 to 143 pass in the same way as the operation in the case of addresses 0 to 15, and addresses 144 to 255 are cut off in the same way as the operation in the case of addresses 16 to 127, and so on.

調停装置212から218はセレクタ信号が1から7になるだけで、それぞれ下位6,5,4ビット目を参照し、同様のフィルタ処理を行う。   Arbitration devices 212 to 218 perform the same filtering process by referring to the lower 6, 5, and 4 bits only when the selector signal changes from 1 to 7.

アドレスの参照ビットは、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 caches 31 to 38 in fine units. Conversely, in the MSB (Most Significant Bit) direction, the caches 31 to 38 are distributed in coarse units. For example, image data is often stored in continuous address areas, but in the former case, access is distributed to the caches 31 to 38 in small units. In the latter case, a specific cache is accessed in all or a large unit. These will be described in more detail in the description of the third embodiment.

選択装置2111を通過したアクセスは、最大、マスターの数だけ存在する。これらを均一に処理するため、ラウンドロビン形式で調停するものとする。ラウンドロビン形式は、例えば、マスターの番号を指定するポインタを持ち、競合時はそのポインタが指し示す最も近くのマスターを選択するものである。ポインタはアクセスが成功するとそのマスターもしくはそのマスター+1のポインタを指し、マスターの数を超える数字になるとマスターの数を減算する。即ちポインタは巡回する。このような方式をとると、競合アクセスで選ばれなかったアクセスは保留され、次のタイミングで同様の調停を受け、ポインタが一巡するまでには必ずアクセスが実施される。   There are a maximum number of accesses that have passed through the selection device 2111 as many as the number of masters. In order to process these uniformly, mediation shall be performed in a round robin format. The round robin format has, for example, a pointer that designates a master number, and selects the nearest master pointed to by the pointer when there is a conflict. The pointer points to the pointer of the master or the master + 1 when the access is successful, and subtracts the number of masters when the number exceeds the number of masters. That is, the pointer circulates. If such a method is adopted, an access that is not selected in the contention access is suspended, and the same arbitration is performed at the next timing, and the access is always performed until the pointer makes a round.

なお、調停の形式は、ランダムな数字を発生させ、それをポインタにするものや、マスター番号の昇順もしくは降順で画一的に選択するものなどさまざまなものがある。しかしながら、調停の形式によって本発明の本質が何ら変わることはない。   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 arbitration devices 212 to 218 correspond to the caches 31 to 38, respectively, and can operate simultaneously. From this, each of the masters 11 to 16 can access the cache at the same time if there is no contention for the same cache. This means that the caches 31 to 38 can be activated simultaneously.

競合は常に生じるものではないが、生じた場合はアクセス時間(レイテンシ)が延びて、アクセス性能が劣化する。図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 masters 11 to 16 are all accessing, the maximum value of ρ is 6/8.

通常の計算機システムにおいて、全てのマスターが常にアクセスを行う機会は少なく、実際のρは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 bus matrix 21 allows the master to access all the caches, and at the same time, the cache access performance x the performance of the number of mounted caches 8 (logical bandwidth) can be exhibited.

バスマトリクス21で振り分けられたアクセスは、キャッシュ31から38のそれぞれに接続する。それぞれのキャッシュの動作は、一般的な計算機で使用するキャッシュに相当する。   Access distributed in the bus matrix 21 is connected to each of the caches 31 to 38. Each cache operation corresponds to a cache used in a general computer.

キャッシュ31から38は、SDRAM61とSDRAM62のバンク数に対応して8個ある。図5を用いて説明する。図5において、631から638はそれぞれSDRAM内の8つに分けられたDRAMバンク、641はSDRAM全体の制御とDRAMバンク631から638へのアクセスの分離を行うSDRAM制御装置である。説明の簡単のため、キャッシュ31から38のそれぞれと、SDRAM61との接続だけを示している。   There are eight caches 31 to 38 corresponding to the number of banks of the SDRAM 61 and the SDRAM 62. This will be described with reference to FIG. In FIG. 5, 631 to 638 are DRAM banks divided into eight in the SDRAM, and 641 is an SDRAM controller for controlling the entire SDRAM and separating access to the DRAM banks 631 to 638. For simplicity of explanation, only the connection between each of the caches 31 to 38 and the SDRAM 61 is shown.

図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 cache 31 and a DRAM bank 631 and a cache 32 and a DRAM bank 632. Therefore, the access control device 51 and the SDRAM control device 641 perform multiplexing and demultiplexing. The separation device 41 will be described later.

SDRAM制御装置641は、DRAMバンク631から638のそれぞれに対し、DRAMの特徴である活性化(Activate)、データのアクセス、非活性化(Pre-Charge)を順に実施する。データのアクセス期間だけが、実際のデータの読み書きに使用される。   The SDRAM control device 641 sequentially performs activation (Activate), data access, and deactivation (Pre-Charge), which are the characteristics of the DRAM, for each of the DRAM banks 631 to 638. Only the data access period is used to read and write the actual data.

図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 control device 641 and the eight DRAM banks 631 to 638. In the operation of the SDRAM control device 641, only the read data access period is shown by a solid line. In the operations of the eight DRAM banks 631 to 638, Activate and Pre-Charge are indicated by dotted lines, and read data access periods are indicated by solid lines.

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 SDRAM control device 641 in FIG. Since the basic unit of access to the caches 31 to 38 is shorter than the page length of the SDRAM as shown in the description of the conventional memory control device, the access period of the read data of each DRAM bank is as shown in FIG. It is necessary to perform control to arrange the banks without gaps while switching the banks finely.

ただし、それぞれの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 bank 631 accesses data at the timing of 1-2, the next activation timing 2-1 cannot be overlapped at the subsequent pre-charge timing 1-3. In addition, it is necessary to perform actual data access in consideration of delays of Activate timings 1-1 and 2-1.

本実施例では、DRAMバンク631から638に対応するそれぞれのキャッシュは、同時にアクセス要求を行う。これは、複数のマスターが同時にまた均等にアクセスを振り分けているためである。そこで、アクセス制御装置51は、各タイミングの重ね合わせに最適なDRAMバンクを選び、それに対応するキャッシュのアクセスをSDRAM61に渡す。   In this embodiment, the respective caches corresponding to the DRAM banks 631 to 638 make access requests simultaneously. This is because a plurality of masters distribute access equally at the same time. Therefore, the access control device 51 selects a DRAM bank that is optimal for the superposition of each timing, and passes the corresponding cache access to the SDRAM 61.

アクセス制御装置51の制御は、図9の各期間をテーブルで管理する。例えば、Activate、データのアクセス、Pre-Chargeの各期間を時間パラメータとして予め与え、アクセスが生じるたびにDRAMバンク631から638ごとに用意した予約テーブルに記録してゆく。   Control of the access control apparatus 51 manages each period of FIG. 9 with a table. For example, each period of Activate, data access, and pre-charge is given in advance as a time parameter, and is recorded in a reservation table prepared for each of the DRAM banks 631 to 638 every time access occurs.

アクセス制御装置51は予約テーブルを見て、予約されていないDRAMバンクを選び出し、それに対するキャッシュアクセスを選択するとともに、予約テーブルに予約開始を指示する。予約テーブルは予約開始が指示されると、該当するDRAMバンク用のカウンタにそれぞれの時間パラメータの合計をセットする。そして時間が経つごとに、それらのカウンタをデクリメントする。このカウンタが非0を示すDRAMバンクが予約されているとみなされる。   The access control device 51 looks at the reservation table, selects an unreserved DRAM bank, selects a cache access to it, and instructs the reservation table to start reservation. When the reservation start is instructed, the reservation table sets the sum of the respective time parameters in the counter for the corresponding DRAM bank. And as time goes by, those counters are decremented. It is considered that a DRAM bank whose counter is non-zero is reserved.

ただし、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 access control device 51 refers to the reservation table so as to read and write data corresponding to the data access period, and determines the data access timing. Specifically, the determination is made based on whether the pre-charge period <the counter value <the pre-charge period + the data access period is true or false.

なお、読み出しに続く書き込み、もしくは書き込みに続く読み出しは、端子の入出力の切り替えが発生し、電気的な特性を考慮して通常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 SDRAM 61 in the access control device 51. The access control device 51 performs this check on the caches 31 to 38, arbitrates the last remaining one, and actually accesses the SDRAM 61.

調停に関しては、キャッシュ31から38それぞれに関係なく均一なアクセスを行うため、調停装置212から218で実施したようにラウンドロビンによる巡回型の調停を行うものとする。前述したように、調停の形式は変更してもよい。例えば、同一のキャッシュがSDRAMのページ内に連続してアクセスする場合がある。このとき他のキャッシュはアクセスができないため、マスターから見て偏ったレイテンシが生じる。これを防ぐため、同一キャッシュの連続アクセス数の上限を定め、上限を超える場合は調停の優先度を下げるなどが考えられる。   Regarding arbitration, in order to perform uniform access regardless of the caches 31 to 38, it is assumed that cyclic arbitration by round robin is performed as performed by the arbitration devices 212 to 218. As described above, the arbitration format may be changed. For example, the same cache may continuously access the SDRAM pages. At this time, the other caches cannot be accessed, so that there is a biased latency as seen from the master. In order to prevent this, an upper limit of the number of consecutive accesses of the same cache is set, and when the upper limit is exceeded, the priority of arbitration may be lowered.

図7に示したように、キャッシュ31から38と、DRAMバンク631から638はそれぞれ1対1で関連付けられている。しかしマスター数が増えた場合、キャッシュも増やし論理帯域を上げたい場合がある。   As shown in FIG. 7, the caches 31 to 38 and the DRAM banks 631 to 638 are associated with each other on a one-to-one basis. However, when the number of masters increases, there is a case where the cache is increased and the logical bandwidth is increased.

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 caches 31 to 38), and 31c is an arbitration device that arbitrates access to caches 31a and 31b. It is. 32c to 38c are similar arbitration devices.

調停に関しては、アクセス制御装置51と同じあり。即ち、キャッシュそれぞれに関係なく均一なアクセスを行うため、調停装置222から228で実施したようにラウンドロビンによる巡回型の調停を行うものとする。前述したように、調停の形式は変更してもよい。   The arbitration is the same as the access control device 51. That is, in order to perform uniform access regardless of each cache, it is assumed that cyclic arbitration by round robin is performed as performed by the arbitration devices 222 to 228. As described above, the arbitration format may be changed.

図6から分かるように、アクセス制御装置51から見て、キャッシュ31aと31bおよび調整装置31cは、キャッシュ31と等価である。従って、SDRAMのDRAMバンクを最適制御する上で、アクセス制御装置51は特別なことをしなくてよい。その他のキャッシュ32aから38a、キャッシュ32bから38bも同様である。   As can be seen from FIG. 6, when viewed from the access control device 51, the caches 31 a and 31 b and the adjustment device 31 c are equivalent to the cache 31. Therefore, the access control device 51 does not have to do anything special to optimally control the DRAM bank of the SDRAM. The same applies to the other caches 32a to 38a and the caches 32b to 38b.

以上のように、キャッシュの数を増やしても、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 SDRAMs 61 and 62 and to perform optimum control of the SDRAM. The same applies except when the number of caches is doubled.

逆に、マスター数が減る場合、キャッシュも減らしコストを削減したい場合がある。   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 caches 32, 34, 36, and 38 are thinned out. Further, the access of the adjacent caches 31, 33, 35, and 37 is input to the separation device 41 for the thinned cache access. However, the access to the original caches 31, 33, 35, and 37 and the access that is put in place of the caches 32, 34, 36, and 38 are exclusively masked by any bit of the address. For example, when the LSB of the address is 0, only accesses for the caches 31, 33, 35, and 37 are performed, and when the LSB is 1, the access is divided by odd and even numbers, such as only accesses for the caches 32, 34, 36, and 38.

図7から分かるように、アクセス制御装置51から見て間引かれたキャッシュ32のアクセスは、キャッシュ31のアクセスが兼ねる。しかし、前述したアクセスのマスクを行っているため、同時にアクセスすることはない。従って、SDRAMのDRAMバンク631か632かのいずれかしか選択しない。その他のキャッシュも同様である。   As can be seen from FIG. 7, the access of the cache 32 thinned out as viewed from the access control device 51 also serves as the access of the cache 31. However, since the above-described access masking is performed, there is no simultaneous access. Accordingly, only one of the DRAM banks 631 and 632 of the SDRAM is selected. The same applies to other caches.

従って、キャッシュが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 SDRAM 61 is reduced to four will be described. This has the same characteristics as the case where the number of caches is 16 and the number of DRAM banks is 8 because of the proportional relationship. Further, if the number of caches is reduced to four, the same characteristics as in the case where the number of caches is eight and the number of DRAM banks is eight from the same proportional relationship.

一方、キャッシュの数が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 SDRAMs 61 is two from FIG. 5 (two Sets), and the number of DRAM banks is reduced to four. Here, 61a and 61b are SDRAMs having four DRAM banks, and 641a and 641b are SDRAM control devices of SDRAMs 61a and 61b, respectively.

図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 caches 31 to 38, the separation device 41, and the access control device 51 are basically the same. Although there are two SDRAMs, the control shown in FIG. 9 is the same. However, since the access control device 51 uses the SDRAMs 61a and 61b separately, it is necessary to prepare separate chip selects. The chip select can be easily generated by the number of the DRAM bank associated with the address. For example, DRAM bank numbers 0 to 3 are chip select of SDRAM 61a, DRAM bank numbers 4 to 7 are chip select of DRAM 61b, and so on.

なお、キャッシュ31から38のアドレス情報は排他的であり、バスマトリクス21で振り分けに使用したビット部分がバンク情報を表す。例えば、キャッシュ31の該当ビットは0、キャッシュ32の該当ビットは1になっており、そのままDRAMバンク番号に相当する。   Note that the address information of the caches 31 to 38 is exclusive, and the bit portion used for distribution in the bus matrix 21 represents bank information. For example, the corresponding bit of the cache 31 is 0 and the corresponding bit of the cache 32 is 1, which corresponds to the DRAM bank number as it is.

以上のことから、キャッシュの数と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 selection device 2111, and the cache is replaced with 31b to 38b. It is also possible to make it. This is used when a special master bypasses the cache and accesses the SDRAM directly. For example, it can be applied to a master such as a CPU that already has a cache.

一方、SDRAMの数を増やす異なる方法として、分離装置41を利用する場合を説明する。   On the other hand, as a different method of increasing the number of SDRAMs, a case where the separation device 41 is used will be described.

図1において、分離装置41はキャッシュ31から38の特定のアドレスビットを参照して、アクセス制御装置51と52に振り分ける(2つのGroup)。この動作は図2の選択装置231と同じく、セレクタ信号を予め与えておき、特定のアドレスのビットと比較し振り分けを実施するものである。   In FIG. 1, the separation device 41 refers to specific address bits in the caches 31 to 38 and distributes them to the access control devices 51 and 52 (two groups). Similar to the selection device 231 in FIG. 2, this operation is performed by assigning a selector signal in advance and comparing with a bit at a specific address.

アドレスの参照ビットは、LSB方向にすると、SDRAM61と62に細かい単位で振り分けることになる。逆に、MSB方向にすると、SDRAM61と62に粗い単位で振り分けることになる。これは調停装置211から218の説明と同様である。   When the address reference bits are in the LSB direction, they are distributed to the SDRAMs 61 and 62 in fine units. Conversely, in the MSB direction, the data is distributed to the SDRAMs 61 and 62 in coarse units. This is the same as the explanation of the arbitrating devices 211 to 218.

図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 caches 31 to 38 can simultaneously access the SDRAM 61 and the SDRAM 62. For example, the cache 31 can access the SDRAM 61 through the access control device 51, and the cache 32 can access the SDRAM 62 through the access control device 52.

このように、分離装置41の構成は、SDRAMのアクセス性能xSDRAMの数2個の性能(物理帯域)まで発揮させることができる。なお、分離装置41において、アドレスにより振り分けるのではなく、キャッシュの番号を用いて排他的に振り分けてもよい。   As described above, the configuration of the separation device 41 can exhibit the SDRAM access performance x the performance (physical bandwidth) of several SDRAMs. In the separation device 41, the allocation may be performed exclusively using a cache number instead of the allocation according to the address.

しかしながら、アクセス制御装置51と52は、それぞれのSDRAMだけを管理するため、相互の状態は分からない。このため、同一キャッシュにおいて、異なるSDRAMに対するアクセスが近づくと、例えば読み出しのデータがSDRAM61のものとSDRAM62のものが重なってしまうなどの問題がある。分離装置41はこれを解消するため、同一キャッシュで前回アクセスしたSDRAMと異なるSDRAMをアクセスする場合、アクセス禁止期間を自動的に挿入する。   However, since the access control devices 51 and 52 manage only the respective SDRAMs, the mutual states are unknown. For this reason, when access to different SDRAMs approaches in the same cache, there is a problem that, for example, read data of SDRAM 61 and SDRAM 62 overlap. In order to solve this problem, the separator 41 automatically inserts an access prohibition period when accessing an SDRAM different from the SDRAM accessed last time in the same cache.

図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 separation device 41 and the SDRAMs 61 and 62. For simplicity of explanation, the operations of the access control devices 51 and 52 are omitted. In the operations of the SDRAMs 61 and 62, only the read data access period is indicated by a solid line and a dotted line, respectively. As an operation of the separation device 41, access issuance timing is indicated by a black circle, and a data reception period is indicated by a solid line and a dotted line.

図11に示したように、分離装置41は前回と異なるSDRAMにアクセスを行う場合、予め決められたCYCサイクル分の期間をアクセス禁止にする(CYC期間内に黒丸を存在させない)。この禁止期間を作ることにより、SDRAM61と62から読み出されるデータは重複しない。CYCサイクルは実際のデータのアクセス期間とアクセス開始までの遅延時間を加えたものである。   As shown in FIG. 11, when accessing the SDRAM different from the previous time, the separating device 41 prohibits access for a predetermined period of CYC cycles (no black circle exists in the CYC period). By making this prohibition period, the data read from the SDRAMs 61 and 62 do not overlap. The CYC cycle is obtained by adding an actual data access period and a delay time until the start of access.

もちろん分離装置41は、同一SDRAMへのアクセスが続けば、これらの禁止期間は設けない。また、異なるキャッシュが異なるSDRAMを前回アクセスしていても、禁止期間は設けない。これは、キャッシュとしてバスが分離されているため、重複することがないからである。   Of course, the separation device 41 does not provide these prohibition periods as long as the access to the same SDRAM continues. Even if different caches accessed different SDRAMs last time, no prohibition period is provided. This is because the buses are separated as caches and therefore do not overlap.

さらに、特性の異なる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 SDRAM 62 is delayed by Delta. In this case, as shown in FIG. 12, the access prohibition period is obtained by adding Delta to CYC only when accessing a fast SDRAM from a slow SDRAM. That is, access across the SDRAM accessed last time is prohibited. Thereby, the access can be adjusted in accordance with the access timing of the slow SDRAM.

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 caches 31 to 38, but these are performed by the access control devices 51 and 52. If only the difference in time is taken, only the above-described response is required.

以上説明したように、分離装置41は複数のSDRAMへアクセスを分配し物理帯域を拡大するとともに、異なる特性のSDRAMの実装も可能とする。これらは、キャッシュの数やマスターの数に関係がなく、システム要件により自在に変更できる。   As described above, the separation device 41 distributes access to a plurality of SDRAMs, expands the physical band, and enables mounting of SDRAMs having different characteristics. These have no relation to the number of caches and the number of masters, and can be freely changed according to system requirements.

なお、実施例では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 separation device 41 increases.

また、図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 Embodiment 2 of the present invention will be described. This embodiment will be described with reference to Example 1.

マスター11から16のアクセスは、バスマトリクス21によって所望のキャッシュ31から38に到達するが、到達時刻はバスマトリクス21の調停次第であり保証できない。例えば、マスター11がキャッシュ31とキャッシュ32に続けてアクセスする場合、キャッシュ31にアクセスが到達する時刻と、キャッシュ32にアクセスが到達する時刻には揺らぎが生じる。このため、アクセスの前後が入れ替わる可能性がある。   Access from the master 11 to 16 reaches the desired cache 31 to 38 by the bus matrix 21, but the arrival time depends on the arbitration of the bus matrix 21 and cannot be guaranteed. For example, when the master 11 accesses the cache 31 and the cache 32 in succession, fluctuation occurs between the time when the access reaches the cache 31 and the time when the access reaches the cache 32. For this reason, there is a possibility that before and after access is switched.

アクセスの前後が入れ替わると、マスターのデータ管理もそれに合わせて入れ替えなければならない。例えば、マスター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 master 11 requests the address A from the cache 31 and returns the data X. On the other hand, it is assumed that the address B is requested to the cache 32 and the data Y is returned. In this case, data may be returned in the order of Y and X, not in the order of X and Y. By returning this data exchange information to the master, the master must change the order of data processing (Out-of-Order control).

これらは、マスターの作り方にも依存するため、対応できないマスターであれば接続できない。本実施例では、内部で順序を整えてこれを解消する、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, reference numerals 71 to 76 denote interface devices corresponding to the masters 11 to 16, respectively. The interface devices 71 to 76 serve as a bridge between the masters 11 to 16 and the bus matrix 21. Since the interface devices 71 to 76 have the same structure and perform the same operation, only the interface device 71 will be described in detail.

インターフェイス装置71は、711のバースト分解装置、712の書き込みバッファ、713の読み出しバッファからなる。   The interface device 71 includes a burst decomposition device 711, a write buffer 712, and a read buffer 713.

バースト分解装置711は、マスター11がバーストアクセスを行う場合、それらを最小のアクセス単位であるワードに分解する。分解することで、これ以降のキャッシュなどの装置は、バーストを考慮する必要がなくなり、ワード単位の制御に簡単化できる。また、バースト単位で処理を行うと、個々のマスターに対するレイテンシが積算してしまうが、ワードに分解することで、レイテンシも平均化できる。   When the master 11 performs burst access, the burst decomposing device 711 decomposes them into words that are the minimum access units. By disassembling, subsequent devices such as a cache do not need to consider bursts, and can be simplified to control in units of words. Further, if processing is performed in units of bursts, latencies for individual masters are integrated, but the latency can also be averaged by decomposing into words.

例えば、マスター全てが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 bus matrix 21 generates a unique number tag when arbitrating. For example, the tag is generated by combining the master number and the access order or time.

マスター11が書き込みアクセスを行うと、タグを生成しバッファ712に伝える。一方バッファ712は、マスター11からの書き込みデータを蓄積しておく。蓄積可能なことから、マスター11が書き込みで待たされることはバッファ712が満杯でない限りない。   When the master 11 performs write access, a tag is generated and transmitted to the buffer 712. On the other hand, the buffer 712 stores write data from the master 11. Since the data can be stored, the master 11 does not have to wait for writing unless the buffer 712 is full.

タグは書き込み順を情報として持っているため、バッファ712に対しそれを用いて、該当するデータを引き出す。引き出されたデータは、調停後のアクセス順に従いキャッシュ31に書き込まれる。このように、マスター11はバッファ712に対してIn-Order制御、バッファ712はキャッシュ31に対してOut-of-Order制御となる。   Since the tag has the writing order as information, it uses the buffer 712 to extract the corresponding data. The extracted data is written to the cache 31 according to the access order after arbitration. As described above, the master 11 performs In-Order control for the buffer 712, and the buffer 712 performs Out-of-Order control for the cache 31.

マスター11が読み出しアクセスを行うと、同様にタグを生成しキャッシュ31に伝える。キャッシュ31はデータを返すまでタグを保存し、最終的にデータとタグをセットにしてバッファ713に返す。   When the master 11 performs read access, a tag is generated and transmitted to the cache 31 in the same manner. The cache 31 stores the tag until data is returned, and finally returns the data and tag to the buffer 713 as a set.

バッファ713はマスター11が期待するアクセス順のデータが返ってくるかをタグによりチェックしており、有効なタグが返ってくればそのままマスター11に返す。また、無効なタグが帰ってくれば蓄積しておく。もちろん、蓄積したデータでマスター11へ返せるものがあれば、その蓄積したデータを返す。このように、マスター11はバッファ713に対してIn-Order制御、バッファ713はキャッシュ31に対してOut-of-Order制御となる。   The buffer 713 checks whether or not the data in the access order expected by the master 11 is returned by the tag, and returns to the master 11 as it is when a valid tag is returned. If invalid tags are returned, they are stored. Of course, if there is accumulated data that can be returned to the master 11, the accumulated data is returned. As described above, the master 11 performs In-Order control for the buffer 713, and the buffer 713 performs Out-of-Order control for the cache 31.

以上は、マスター11以外のマスター、キャッシュ31以外のキャッシュも同様である。このように、マスターはIn-Orderで処理することが可能で、本実施例のメモリ制御装置はOut-of-Orderで最適なアクセス順を選び処理することが可能である。   The same applies to masters other than the master 11 and caches other than the cache 31. As described above, the master can perform processing in In-Order, and the memory control device of this embodiment can select and process an optimal access order in Out-of-Order.

次に、バスマトリクス21の調停方式について詳しく説明する。   Next, the arbitration method of the bus matrix 21 will be described in detail.

ここで、マスター11から16のアクセスは特に同期しておらず、任意にアクセスできるものとする。例えば、マスター11は時間内に画像の一定量を処理し外部に出力するものとし、マスター12は時間制約なく別の画像を初期化するものとする。   Here, the accesses from the masters 11 to 16 are not particularly synchronized, and can be accessed arbitrarily. For example, it is assumed that the master 11 processes a certain amount of images within time and outputs them to the outside, and the master 12 initializes another image without time constraints.

マスター11とマスター12は共にアクセス要求を常に出せるものとし、SDRAM61に対するアクセスのみを行うものとする。また、マスターそれぞれの論理帯域と、アクセス制御装置51とSDRAM61間の物理帯域とは等しいものとする。   It is assumed that both the master 11 and the master 12 can always issue access requests and only access the SDRAM 61. Further, it is assumed that the logical bandwidth of each master and the physical bandwidth between the access control device 51 and the SDRAM 61 are equal.

この例では、マスター11とマスター12はSDRAM61をターゲットにアクセスを行うため、キャッシュ31から38にデータが常にない状態(キャッシュミス)だと、アクセス制御装置51とSDRAM61間の物理帯域がボトルネックになる。従って、マスター2個の論理帯域は、SDRAMの物理帯域を分け合うことになる。   In this example, since the master 11 and the master 12 access the SDRAM 61 as a target, if there is always no data in the caches 31 to 38 (cache miss), the physical bandwidth between the access control device 51 and the SDRAM 61 becomes a bottleneck. Become. Therefore, the logical bandwidth of the two masters shares the physical bandwidth of the SDRAM.

ここで、実施例1で示したように、調停装置211から218がラウンドロビン形式でアクセスを調停すると、マスター11とマスター12のアクセスは交互に受け付けられることになる。これは、マスター11にとって論理帯域の最大近くの作業が必要になると、時間内に処理できなくなるといった不都合が生じる。   Here, as shown in the first embodiment, when the arbitrating devices 211 to 218 arbitrate access in a round robin format, the access of the master 11 and the master 12 is alternately accepted. This causes inconvenience that when the master 11 needs to work near the maximum logical band, it cannot be processed in time.

このため、調停装置211から218は優先度制御を行うようにする。図14を用いて、調停装置211に対する優先度制御を説明する。調停装置212から218は同じ構造なので説明を割愛する。   For this reason, the arbitrating devices 211 to 218 perform priority control. The priority control for the arbitrating device 211 will be described with reference to FIG. Since the arbitration devices 212 to 218 have the same structure, a description thereof will be omitted.

図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 masters 11 to 16 indicate the priority Priority with 2 bits at an arbitrary timing. The priority Priority indicates that the higher the number, the higher the priority.

実施例1で説明したように、選択装置2111はキャッシュ31から38それぞれに対するアクセスを選択する。図14では簡単のため、キャッシュ31に対する選択だけを記載している。選択装置2111でマスターごとにキャッシュ31に対するアクセスを抽出した後、それらは全て優先度選択装置2112から2115に入力する。   As described in the first embodiment, the selection device 2111 selects access to each of the caches 31 to 38. In FIG. 14, only the selection for the cache 31 is shown for simplicity. After the selection device 2111 extracts accesses to the cache 31 for each master, they are all input to the priority selection devices 2112 to 2115.

優先度選択装置2112は優先度Priorityが0のものだけを、優先度選択装置2113は優先度Priorityが1のものだけを、優先度選択装置2114は優先度Priorityが2のものだけを、優先度選択装置2115は優先度Priorityが3のものだけを抽出する。その抽出結果は、ラウンドロビン調停装置2116から2119にそれぞれ入力する。   Priority selection device 2112 has only priority Priority 0, priority selection device 2113 has priority Priority 1 only, priority selection device 2114 has priority Priority 2 only, priority The selection device 2115 extracts only those having the priority Priority 3. The extraction results are input to the round robin arbitration devices 2116 to 2119, respectively.

ラウンドロビン調停装置2116から2119は、実施例1で説明した調停装置211の役割を装置として置き換えたもので、全て同じ動作を行う。   Round-robin arbitration devices 2116 to 2119 replace the role of the arbitration device 211 described in the first embodiment as a device, and all perform the same operation.

優先調停装置2120は、ラウンドロビン調停装置2116から2119の結果から、キャッシュ31への最終的なアクセスを選択する。選択にあたっては、ラウンドロビン調停装置2116<ラウンドロビン調停装置2117<ラウンドロビン調停装置2118<ラウンドロビン調停装置2119の順で優先的に決定する。例えば、ラウンドロビン調停装置2119にアクセスがあれば(ない場合は優先度Priorityが3を指示したマスターが存在しない)、他のラウンドロビン調停装置の結果に関係なくそれを最終的なアクセスとする。   The priority arbitration device 2120 selects the final access to the cache 31 from the results of the round robin arbitration devices 2116 to 2119. In the selection, the priority is determined in the order of round robin arbitration device 2116 <round robin arbitration device 2117 <round robin arbitration device 2118 <round robin arbitration device 2119. For example, if there is an access to the round robin arbitration device 2119 (there is no master instructing the priority Priority 3 if there is no access), the round robin arbitration device 2119 is regarded as the final access regardless of the results of other round robin arbitration devices.

以上のことから、マスターが急を要するアクセスには、高い優先度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 master 11 performs processing in time, a high priority Priority is designated. Next, since there is no time restriction, the master 12 instructs a low priority Priority. In this way, even if there is a conflict, the master 11 can preferentially access, and the constraints given to the master 11 can be satisfied.

さらに、優先度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. Master 0 and 1 are set to 1/16, Masters 2 and 3 are set to 1/8, Masters 4 and 5 are set to 1/4, Master 6 is set to 15/16, and Master 7 is set to 1/1. is there.

図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 master 11, 6 masters can be expanded (the remaining 5 + 6, a total of 11). However, since the access is bundled by the extended arbitration device, the extended masters cannot simultaneously access the cache.

本発明の実施例3に係るメモリ制御装置について説明する。本実施の形態は、実施例1を参照しながら説明する。   A memory control apparatus according to Embodiment 3 of the present invention will be described. This embodiment will be described with reference to Example 1.

選択装置2111におけるキャッシュ11から38へのアクセスの分配(バンク分け)、分離装置41におけるSDRAM61と62へのアクセスの分配(Group分け)、アクセス制御装置51におけるSDRAM61aと61bへのアクセスの分配(Set分け)のそれぞれについて説明する。   Distribution of access from the caches 11 to 38 in the selection device 2111 (bank division), distribution of access to the SDRAMs 61 and 62 in the separation device 41 (Group division), and distribution of access to the SDRAMs 61a and 61b in the access control device 51 (Set) Each of these will be described.

選択装置2111と分離装置41、およびアクセス制御装置51にはアドレスの参照ビットをレジスタで与えることとする。調停装置212から218内の分離装置、およびアクセス制御装置52も同様である。レジスタで与えることにより、アドレスによりどのSDRAMおよびどのDRAMバンクにデータを格納するかのマッピングが任意に指定できる。   The selection device 2111, the separation device 41, and the access control device 51 are provided with a reference bit of an address by a register. The same applies to the separation devices in the arbitration devices 212 to 218 and the access control device 52. By giving it by a register, mapping of which SDRAM and in which DRAM bank the data is stored can be arbitrarily designated by the address.

図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 SDRAMs 61a and 61b are substituted for the SDRAM 61, and two SDRAMs 62a and 62b are substituted for the SDRAM 62, respectively. SDRAMs 61a and 61b have a group number 0 and set numbers 0 and 1, respectively. SDRAMs 62a and 62b have a group number 1 and set numbers 0 and 1, respectively.

図17は、アドレス4,5,6ビット目をバンク分けとして参照するよう選択装置2111およびその他調整装置内の選択装置に指示し、次にアドレス12ビット目をGroup分けとして参照するよう分離装置41に指示し、最後にアドレス13ビット目をSet分けとして参照するようアクセス制御装置51と52に指示した場合のメモリマッピングである。図17の、B0、B1、B2はバンク分けのビット、GrpはGroup分けのビット、SetはSet分けのビットである。   In FIG. 17, the selection device 2111 and other selection devices in the adjustment device are instructed to refer to the address 4, 5, and 6 bits as bank divisions, and then the separation device 41 to refer to the address 12 bits as Group divisions. This is the memory mapping when the access control devices 51 and 52 are instructed to refer to the 13th bit of the address as the Set division. In FIG. 17, B0, B1, and B2 are bank division bits, Grp is a Group division bit, and Set is a Set division bit.

図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 selection device 2111 and other selection devices in the adjustment device are instructed to refer to the address 9, 10, and 11 bits as bank division, and then the separation device 41 to refer to the address 31 bit as Group division. This is memory mapping when the access control devices 51 and 52 are instructed to refer to the 30th bit of the address as the Set division. In FIG. 18, B0, B1, and B2 are bank division bits, Grp is a Group division bit, and Set is a Set division bit.

図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 selection device 2111 are completely exclusive, management in the cache is also exclusive. These also apply to different SDRAMs and DRAM banks within the SDRAM.

データが排他的に管理されているため、キャッシュと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 masters 11 to 16 are arbitrated by the arbitration devices 211 to 218 must be observed. This is different from the above-described In-Order control and Out-of-Order control for the same master data.

例えば、マスター11がアドレスAに書き込みを行い、マスター12がアドレスAを読み出す場合、調停装置211から218のいずれかに到達する順序さえ守られれば、キャッシュ31から38のいずれかでは順序通り処理をするので不整合は生じない。しかし、調停装置211から218のいずれかに到達する順序が入れ替わると、マスター12の読み出しが先行して誤ったデータを返してしまう。   For example, when the master 11 writes to the address A and the master 12 reads the address A, as long as the order of reaching any of the arbitration devices 211 to 218 is observed, the processing is performed in order in any of the caches 31 to 38. Therefore, inconsistency does not occur. However, if the order of reaching any one of the arbitration devices 211 to 218 is changed, the master 12 is read earlier and returns incorrect data.

調停装置211から218のいずれかに到達する順序を守る方法を説明する。マスター11から16の書き込みアドレスを、図13のインターフェイス装置71から76のそれぞれに登録しておき、その書き込みアドレスが調停装置に到達すれば登録を抹消するようにする。登録されているアドレスは、各マスターごとに用意されたインターフェイス装置71から76全てから相互参照できるようにする。   A method of keeping the order of reaching any of the arbitration devices 211 to 218 will be described. The write addresses of the masters 11 to 16 are registered in each of the interface devices 71 to 76 in FIG. 13, and the registration is deleted when the write address reaches the arbitration device. The registered address can be cross-referenced from all the interface devices 71 to 76 prepared for each master.

任意のマスターが読み出しもしくは書き込みを行う際、自らを除き、各インターフェイス装置71から76で登録されているアドレスとの一致を確認する。一致しなければそのままアクセスを受け付け、そうでなければアクセスを保留する。アクセスの保留は、登録されたアドレスが調停装置に到達した時点で解除される。   When an arbitrary master performs reading or writing, it confirms a match with the address registered in each interface device 71 to 76 except for itself. If they do not match, the access is accepted as it is, otherwise the access is suspended. The access suspension is canceled when the registered address reaches the arbitration device.

この操作により、先行する書き込みアクセスは追い越されることがない。このような単純なアドレスの相互確認の仕組みにより、マスター間のコヒーレンスを確保することができる。   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 separation device 41. However, since the caches 31 to 38 are mutually exclusive unlike the masters 11 to 16, the mutual check is unnecessary.

この操作により、先行する書き込みアクセスは追い越されることがない。このような単純なアドレスの相互確認の仕組みにより、キャッシュ内のコヒーレンスを確保することができる。   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 interface devices 71 to 76 and the caches 31 to 38, coherence in the entire memory control device can be completely guaranteed.

なお、アドレスの登録および一致確認は、全てのビットに対して行う必要はない。回路規模を削減するため、ある範囲のビットだけを対象にしてもよい。ただし、ある範囲のビットだけで処理すると、アドレスの一致の疑いのあるアクセスも保留されるので、性能は劣化する。例えば、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 Embodiment 4 of the present invention will be described. This embodiment will be described with reference to Example 1.

キャッシュ31から38の方式は、ダイレクトマップ、セットアソシアエイティブ、フルアソシアエイティブの任意のものを選択することができる。方式によって性能やコストは変わる。ここではいくつかの方式のうち、性能とコストのバランスに優れるセットアソシアエイティブを用いることにする。   As the caches 31 to 38, any one of a direct map, a set associative, and a full associative can be selected. Performance and cost vary depending on the method. Here, among several methods, a set associative with a good balance between performance and cost is used.

セットアソシアエイティブ型のキャッシュは、それぞれのデータ管理が排他的な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 masters 11 to 16 are equally distributed to the caches 31 to 38, each of the caches 31 to 38 is shared by a plurality of masters. However, as described in the second embodiment, when the logical bandwidth requested by the master is different, it may be advantageous in terms of performance to assign it to a specific master preferentially in the cache.

ここでは、キャッシュの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に所望のデータがあればキャッシュヒットとなり、なければキャッシュミスとなる。   Ways 311 to 314 are assigned IDs of 0, 0, 0, and 1, respectively. The master accesses by specifying an arbitrary ID. When the ID designated by the master is 1, only the Way 314 to which ID = 1 is assigned is the access target. If there is desired data in this Way 314, a cache hit occurs, otherwise a cache miss occurs.

一方、マスターが指定する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, Ways 311, 312, and 313 to which ID = 0 is assigned are to be accessed. Since data managed in the way is exclusive, only one of the ways 311, 312, and 313 is selected last.

しかし、マスターが指定する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 314 with ID = 1 is flushed, a flush in the range of ¼ is sufficient compared to flushing the entire cache.

ここで、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 Memory control device 11 Master 0 which is an arbitrary control device
12 Master 1 which is an arbitrary control device
13 Master 2 which is an arbitrary control device
14 Master 3 which is an optional control device
15 Master 4 which is an arbitrary control device
16 Master 5 which is an arbitrary control device
21 Bus matrix 31 Cache (Bank 0)
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 Separation device 51 Access control device 0
52 Access Control Device 1
61 SDRAM0
62 SDRAM1

Claims (11)

複数のメモリバンクで構成されるメモリ装置と、複数のマスター装置のアクセスを受け付けるバスマトリクスと、前記バスマトリクスからアクセスされ一時的なデータを格納する複数のキャッシュと、複数の前記キャッシュからアクセスされその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; 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.
請求項1記載のメモリ制御装置であって、
前記アクセス制御装置は前記メモリ装置のメモリバンクごとに状態を管理するテーブルを備え、前記テーブルからアクセスに適したメモリバンクを抽出し予約バンクとし、同時に前記テーブルから直前にアクセスしたメモリバンクを選び優先バンクとし、複数の前記キャッシュの中から前記優先バンクに適したアクセスを取り出し前期メモリ装置へのアクセスとし、なければ複数の前記キャッシュの中から前記予約バンクに適したアクセスを一つ取り出し前期メモリ装置へのアクセスとすることを特徴としたメモリ制御装置。
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
請求項1記載のメモリ制御装置であって、
複数の前記メモリ装置とで構成し、
複数の前記キャッシュの数は複数の前記メモリ装置のメモリバンクの数の合計に等しく、前記アクセス制御装置は複数の前記メモリ装置のメモリバンクの状態を管理し最も早くアクセスできる前記キャッシュのアクセスを選び該当する前記メモリ装置だけにアクセスすることを特徴としたメモリ制御装置。
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.
請求項1記載のメモリ制御装置であって、
複数の前記メモリ装置にアクセスする複数の前記アクセス制御装置と、複数の前記キャッシュからアクセスされ複数の前記アクセス制御装置にアクセスする分離装置とで構成し、
複数の前記アクセス制御装置の数は複数の前記メモリ装置の数に等しくそれぞれ接続し、前記分離装置は複数の前記キャッシュそれぞれのアドレス情報から指定された部分に従って複数の前記アクセス制御装置に均等かつ排他的にアクセスすることを特徴としたメモリ制御装置。
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.
請求項4記載のメモリ制御装置であって、
前記分離装置は複数の前記メモリ装置間を跨ぐアクセスであれば直前のデータアクセス期間分前記アクセス制御装置へのアクセスを禁止し、跨がないアクセスであればそのまま前記アクセス制御装置へアクセスすることを特徴としたメモリ制御装置。
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.
請求項1記載のメモリ制御装置であって、
複数の前記キャッシュからアクセスされる結合装置とで構成し、
複数の前記キャッシュの数は前記メモリ装置のメモリバンクの数の整数倍に等しく、前記結合装置は複数の前記キャッシュそれぞれのアドレス情報から指定された部分又は予め前記キャッシュに与えられた識別情報に従って前記メモリ装置のメモリバンクの数になるように調停し、前記アクセス制御装置にアクセスすることを特徴としたメモリ制御装置。
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.
請求項1記載のメモリ制御装置であって、
複数のマスター装置からそれぞれアクセスされるインターフェイス装置とで構成し、
前記インターフェイス装置は複数の前記キャッシュに対する書き込みバッファと読み出しバッファを備え、
前記インターフェイス装置は前記アクセス制御装置の書き込みアクセスに対して、そのまま前記バスマトリクスに通知し、前記マスター装置のデータを順に前記書き込みバッファへ格納し、前記バスマトリクスが指定する書き込み情報を元に前記書き込みバッファからデータを取り出し複数の前記キャッシュに送り、
前記インターフェイス装置は前記アクセス制御装置の読み出しアクセスに対して、そのまま前記バスマトリクスに通知し、前記キャッシュが指定する読み出し情報を元に前記キャッシュから前記読み出しバッファへデータを格納し、前記読み出しバッファのデータを順に前記マスター装置へ返し、
複数の前記キャッシュは前記バスマトリクスがアクセスと共に指定する読み出し情報を管理し、読み出しデータと共に読み出し情報を返すことを特徴としたメモリ制御装置。
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.
請求項1記載のメモリ制御装置であって、
複数のマスター装置からそれぞれアクセスされるアドレス監視装置とで構成し、
前記アドレス監視装置は複数のマスター装置それぞれの書き込みアドレス情報の全て又は一部を登録し、登録アドレスの該当アクセスが前記バスマトリクスに受け付けられれば登録を外し、前記マスター装置の新たなアドレス情報の全て又は一部と登録アドレスとを比較し、一致するなら前記バスマトリクスに対するアクセスを保留し、そうでなければアクセスを許可し、
前記キャッシュは書き込みアドレス情報の全て又は一部を登録し、登録アドレスの該当アクセスが前記アクセス制御装置に受け付けられれば登録を外し、新たなアドレス情報の全て又は一部と登録アドレスとを比較し、一致するなら前記アクセス制御装置に対するアクセスを保留し、そうでなければアクセスを許可することを特徴としたメモリ制御装置。
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.
請求項1記載のメモリ制御装置であって、
前記マスター装置はアクセスに関し優先度情報を加え、
前記バスマトリクスは複数の前記キャッシュそれぞれに対応する調停装置を備え、
前記調停装置は前記マスター装置が指定する優先度ごとにアクセスを分け、それぞれラウンドロビン方式で調停し、優先度の高い順から前記ラウンドロビン方式の調停結果の有無を調べ、アクセスがあれば対応する前記キャッシュにアクセスすることを特徴としたメモリ制御装置。
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.
請求項1記載のメモリ制御装置であって、
前記キャッシュはいくつかのバンクで構成し、それぞれのバンクに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.
請求項1記載のメモリ制御装置であって、
前記キャッシュの全て又は一部を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.
JP2011039214A 2011-02-25 2011-02-25 Memory control device Active JP5640204B2 (en)

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)

* Cited by examiner, † Cited by third party
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

Patent Citations (7)

* Cited by examiner, † Cited by third party
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