JP5094050B2 - Memory control device, memory control method, and embedded system - Google Patents

Memory control device, memory control method, and embedded system Download PDF

Info

Publication number
JP5094050B2
JP5094050B2 JP2006166204A JP2006166204A JP5094050B2 JP 5094050 B2 JP5094050 B2 JP 5094050B2 JP 2006166204 A JP2006166204 A JP 2006166204A JP 2006166204 A JP2006166204 A JP 2006166204A JP 5094050 B2 JP5094050 B2 JP 5094050B2
Authority
JP
Japan
Prior art keywords
read
data
memory
master
transfer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2006166204A
Other languages
Japanese (ja)
Other versions
JP2007048274A (en
JP2007048274A5 (en
Inventor
利秋 南
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2006166204A priority Critical patent/JP5094050B2/en
Publication of JP2007048274A publication Critical patent/JP2007048274A/en
Publication of JP2007048274A5 publication Critical patent/JP2007048274A5/ja
Application granted granted Critical
Publication of JP5094050B2 publication Critical patent/JP5094050B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Memory System (AREA)

Description

本発明はメモリ制御装置および方法に関する。   The present invention relates to a memory control apparatus and method.

半導体技術・マイクロプロセッサ技術の進歩により、組込みシステムの応用分野は拡大の一途をたどっており、身の回りの電子機器・電気機器のほとんどに組込みシステムが使われるようになっている。また、近年、LSIの集積度が向上した結果、組み込み機器のコントローラ機能が一つのLSIの中に集積される、いわゆるシステムLSIが一般的になってきた。   Due to advances in semiconductor technology and microprocessor technology, the application fields of embedded systems are steadily expanding, and embedded systems are used in almost all electronic and electrical devices around us. In recent years, as the degree of integration of LSIs has improved, so-called system LSIs in which controller functions of embedded devices are integrated in one LSI have become common.

図7は例えば特許文献1において開示されるシステムLSIを用いて、OA機器の組み込みシステムを実現する構成の一例を示す図である。   FIG. 7 is a diagram showing an example of a configuration that realizes an embedded system of OA equipment using a system LSI disclosed in Patent Document 1, for example.

図7において110は組み込みシステム基板であり、システムLSI100、メモリ101、各種IOインターフェースが実装される。システムLSI100はシングル チップ・スキャニング・プリンティング エンジンである。システムLSI100は、より詳細にはプロセッサコア、プロセッサ周辺コントローラ、メモリコントローラ、スキャナコントローラ、プリンタコントローラ、PCIインターフェース、USBデバイスインターフェースなどを内蔵する。   In FIG. 7, reference numeral 110 denotes an embedded system board on which a system LSI 100, a memory 101, and various IO interfaces are mounted. The system LSI 100 is a single chip scanning printing engine. More specifically, the system LSI 100 includes a processor core, a processor peripheral controller, a memory controller, a scanner controller, a printer controller, a PCI interface, a USB device interface, and the like.

組み込み基板110に備えられるIOインターフェースは、スキャナIF131、FAX IF132、USB IF134、プリンタIF133等がある。これらのIOインターフェースは、それぞれスキャナ121、FAX122、PC124、プリンタエンジン123と接続され全体システムを構成する。さらにシステムLSI100にはPCIバスIF136が備えられている。これを用い、PCI−IDEブリッジ102を介してIDEバス135に接続されるHDD125を使用することができる。   The IO interface provided in the embedded substrate 110 includes a scanner IF 131, a FAX IF 132, a USB IF 134, a printer IF 133, and the like. These IO interfaces are connected to the scanner 121, the FAX 122, the PC 124, and the printer engine 123, respectively, to constitute the entire system. Further, the system LSI 100 is provided with a PCI bus IF 136. By using this, the HDD 125 connected to the IDE bus 135 via the PCI-IDE bridge 102 can be used.

図2はシステムLSI100をより詳細に説明する図である。   FIG. 2 is a diagram for explaining the system LSI 100 in more detail.

プロセッサ201内には最大でインストラクション、データそれぞれ16Kバイトの計32Kバイトのキャッシュメモリ、FPU(浮動小数点演算ユニット)、MMU(メモリ管理ユニット)、ユーザー定義可能なコプロセッサなどを内蔵することが可能である。   In the processor 201, it is possible to incorporate a maximum of 32K bytes of instruction, 16K bytes each of data, FPU (floating point arithmetic unit), MMU (memory management unit), user-definable coprocessor, etc. is there.

PCIバスインターフェース232を有するので、PCIバススロットを有するコンピュータシステムと共に用いることができる。また、PCIサテライト構成に加え、PCIホストバスブリッジ構成にてPCIバスコンフィギュレーションを発行することが可能である。したがって、安価なPCI周辺デバイスと組み合わせることにより、マルチファンクションペリフェラル(複合機能周辺機器)のメインエンジンとして使用することも可能である。さらにPCIバスインターフェースを有するレンダリング エンジン、圧縮・伸長エンジンと組み合わせることも可能である。   Since it has a PCI bus interface 232, it can be used with a computer system having a PCI bus slot. In addition to the PCI satellite configuration, a PCI bus configuration can be issued in a PCI host bus bridge configuration. Therefore, it can be used as a main engine of a multifunction peripheral (multifunctional peripheral device) by combining with an inexpensive PCI peripheral device. Further, it can be combined with a rendering engine having a PCI bus interface and a compression / decompression engine.

チップ内部に汎用IOコアを接続するIOバス(Bバス)221、及び、画像データ転送に最適化したグラフィックバス(Gバス:Graphics Bus)220の2系統の独立したバスを有する。そして、メモリ204(101)、プロセッサ201と、これらのバスを、クロスバスイッチであるシステムバスブリッジ203を介して接続する。このように構成することにより、マルチファンクションシステムにおける同時動作に必要な、並列性の高い高速データ転送を実現している。   There are two independent buses, an IO bus (B bus) 221 for connecting a general-purpose IO core inside the chip, and a graphic bus (G bus: Graphics Bus) 220 optimized for image data transfer. Then, the memory 204 (101) and the processor 201 are connected to these buses via a system bus bridge 203 which is a crossbar switch. With this configuration, high-speed data transfer with high parallelism necessary for simultaneous operation in the multifunction system is realized.

また画像データに代表される、連続したデータ列のアクセスに対しコストパフォーマンスの高いシンクロナスDRAM(SDRAM)をサポートするメモリコントローラ202を内蔵している。   In addition, a memory controller 202 that supports a synchronous DRAM (SDRAM) having high cost performance with respect to continuous data string access represented by image data is incorporated.

その他には、スキャナコントローラ205、プリンタコントローラ206、PCIコントローラ207、USBコントローラ208、UART209、タイマ・GPIO機能含むMISCモジュール210、LANコントローラ211等を内蔵している。230〜233はそれぞれ205〜208のIOインターフェースであり、図7の同名のインターフェース131、133、134、136とは同一のものである。   In addition, a scanner controller 205, a printer controller 206, a PCI controller 207, a USB controller 208, a UART 209, a MISC module 210 including a timer / GPIO function, a LAN controller 211, and the like are incorporated. Reference numerals 230 to 233 denote IO interfaces 205 to 208, respectively. The interfaces 131, 133, 134, and 136 of the same name in FIG.

さて、図3は典型的な複合動作のシーケンスを説明する図である。ここではスキャナ121で原稿をスキャンしつつ、読み取った原稿をプリンタエンジン123からプリントするいわゆるコピー動作を行っている。原稿をスキャンすることによって得られた画像データは、スキャナ121からスキャナインターフェース131(230)を介してシステムLSI100が内蔵するスキャナコントローラ205に送られる(301)。スキャナコントローラ205は受け取った画像データをDMAによってメモリ204(101)に格納する(302)。次いでプリンタコントローラ206はこのデータをDMAによりメモリ204から読み出し(303)、プリンタインターフェース231(133)を介してプリンタエンジン123に送る(304)。プリンタエンジン123はこれを印刷する。   FIG. 3 is a diagram for explaining a typical composite operation sequence. Here, while the original is scanned by the scanner 121, a so-called copying operation for printing the read original from the printer engine 123 is performed. Image data obtained by scanning the document is sent from the scanner 121 to the scanner controller 205 built in the system LSI 100 via the scanner interface 131 (230) (301). The scanner controller 205 stores the received image data in the memory 204 (101) by DMA (302). Next, the printer controller 206 reads this data from the memory 204 by DMA (303) and sends it to the printer engine 123 via the printer interface 231 (133) (304). The printer engine 123 prints this.

このとき、さらにPC124からUSBインターフェース134(233)を介してPDLデータが送信されている(311)。このPDLデータはUSBデバイスコントローラ208によって受信され、DMAによって一旦メモリ204に格納される(312)。その後システムLSI100内のプロセッサ201によって解釈され、展開された画像イメージが再度メモリ204に格納される(313)。最後にプリンタコントローラ206によりメモリ204から読み出され(314)、プリンタインターフェース231(133)を介してプリンタエンジン123に送られ(315)、印刷される。   At this time, PDL data is further transmitted from the PC 124 via the USB interface 134 (233) (311). The PDL data is received by the USB device controller 208 and temporarily stored in the memory 204 by DMA (312). Thereafter, the image 201 interpreted and expanded by the processor 201 in the system LSI 100 is stored again in the memory 204 (313). Finally, it is read from the memory 204 by the printer controller 206 (314), sent to the printer engine 123 via the printer interface 231 (133) (315), and printed.

図4はこのときのプロセッサ201が扱う物理アドレス空間を示す。実際にはプロセッサ201はMIPS R4000互換であり、プロセッサ201上のソフトウェアは仮想アドレスを用いて動作している。プロセッサ201は常にカーネルモードで動作しており、物理アドレス0x0000_0000〜0x1fff_ffff番地が、仮想アドレス0x8000_0000〜0x9fff_ffff番地(kseg0:cached)および0xa000_0000〜0xbfff_ffff番地(kseg1:uncached)に対応づけられている。   FIG. 4 shows a physical address space handled by the processor 201 at this time. Actually, the processor 201 is compatible with MIPS R4000, and the software on the processor 201 operates using a virtual address. The processor 201 always operates in the kernel mode, and the physical addresses 0x0000 — 0000 to 0x1fff_ffff are associated with the virtual addresses 0x8000 — 0000 to 0x9 fff_ffff (kseg0: cached) and 0xa000 — 0000 to 0xbfff_ffff (kseg1: uncached).

この従来例においては、メモリ204の容量は32MBであり、16bit×4bank×4M word構成の 256Mbit SDRAM1個が実装されている。したがってRAMとして利用可能な物理アドレス空間は0x0000_0000〜0x01ff_ffff番地までである。   In this conventional example, the capacity of the memory 204 is 32 MB, and one 256 Mbit SDRAM having a 16 bit × 4 bank × 4 M word configuration is mounted. Therefore, the physical address space that can be used as the RAM is from 0x0000 — 0000 to 0x01ff_ffff.

図3の複合動作が行われる場合、プロセッサ201上で動作するソフトウェアが、各ハードウェアが利用するメモリ204上のバッファ領域を管理する。通常はソフトウェアで動的にメモリ領域を確保する場合と同じように、Heap領域にメモリアロケート関数(OSが提供するシステム関数:malloc等)を用いて必要なサイズの領域を確保する。   When the composite operation of FIG. 3 is performed, software operating on the processor 201 manages a buffer area on the memory 204 used by each hardware. Normally, as in the case where a memory area is dynamically secured by software, a memory area function (system function provided by the OS: malloc or the like) is used to secure an area of a necessary size in the Heap area.

図3の複合動作の場合では、スキャナコントローラ205がDMAにより書き込むバッファ領域と、プリンタコントローラ206がDMAにより読み出すバッファ領域は同じである。もしこのバッファ領域が1つしかない場合、スキャナコントローラ205が書いたアドレスを後からプリンタコントローラ206が読み出す。しかしながら、通常スキャナから読み込む速度とプリンタが印刷する速度は異なる。したがって、スキャナコントローラ205とプリンタコントローラ206との間で同期を取る仕組みが無い限り、途中で読み出しアドレスが書き込みアドレスを追い越す可能性がある。   In the case of the composite operation of FIG. 3, the buffer area that the scanner controller 205 writes by DMA and the buffer area that the printer controller 206 reads by DMA are the same. If there is only one buffer area, the printer controller 206 reads the address written by the scanner controller 205 later. However, the reading speed from the scanner is usually different from the printing speed of the printer. Therefore, unless there is a mechanism for synchronization between the scanner controller 205 and the printer controller 206, the read address may overtake the write address in the middle.

これを避けるため、一般にバッファを2重に持つことが行われる。すなわち、スキャナコントローラ205がDMAにより一方のバッファ領域に書き込んでいる間、プリンタコントローラ206はもう一方のバッファ領域からDMAで読み出しを行う。双方のDMA転送が終了した時点で、それぞれの使用するバッファを入れ替え、次のDMAを開始する。   In order to avoid this, a double buffer is generally used. That is, while the scanner controller 205 is writing to one buffer area by DMA, the printer controller 206 reads from the other buffer area by DMA. When both DMA transfers are completed, the buffers to be used are replaced and the next DMA is started.

例えばスキャナ121からスキャナコントローラ205に対して1MBのデータが連続して送られてくる場合、まずメモリアロケート関数を、引数を1MBにしてコールする。そして、返されたアドレスを(仮想アドレスなので物理アドレスに変換して)スキャナコントローラ205のDMA開始アドレスとして設定する。ここでは0x0080_0000〜0x008f_ffff番地が確保され、先頭番地である0x800_0000番地がDMA開始アドレスとして設定される。次いでデータが到着するとスキャナコントローラ205はDMAにより当該開始アドレスから連続してデータを格納していく。このDMAが終了すると、プリンタコントローラ206に0x0080_0000番地がDMA開始アドレスとして設定される。その後DMA開始をソフトウェアにより指示されると、プリンタインターフェース231の信号に従って、設定された開始アドレスから順次データを読み出し、プリンタインターフェース231を介してプリンタエンジン123にデータを転送する。   For example, when 1 MB of data is continuously sent from the scanner 121 to the scanner controller 205, the memory allocation function is first called with an argument of 1 MB. The returned address is converted into a physical address because it is a virtual address, and is set as the DMA start address of the scanner controller 205. Here, addresses 0x0080_0000 to 0x008f_ffff are secured, and the address 0x800_0000 which is the head address is set as the DMA start address. Next, when data arrives, the scanner controller 205 stores data continuously from the start address by DMA. When this DMA is completed, the address 0x0080_0000 is set in the printer controller 206 as the DMA start address. After that, when the DMA start is instructed by the software, the data is sequentially read from the set start address in accordance with the signal of the printer interface 231, and the data is transferred to the printer engine 123 via the printer interface 231.

それと同時に、スキャナコントローラ205に対しては次のDMAの設定が行われる。再度メモリアロケート関数を、引数を1MBにしてコールし、0x0090_0000〜0x009f_ffff番地が確保されると、先頭番地である0x0090_0000番地がDMA開始アドレスとして設定される。スキャナインターフェース230よりデータが到着するとスキャナコントローラ205はDMAにより当該開始アドレスから連続してデータを格納していく。   At the same time, the next DMA is set for the scanner controller 205. When the memory allocation function is called again with the argument set to 1 MB and the addresses 0x0090_0000 to 0x009f_ffff are secured, the address 0x0090_0000 which is the head address is set as the DMA start address. When data arrives from the scanner interface 230, the scanner controller 205 stores data continuously from the start address by DMA.

このようにして、スキャナコントローラ205とプリンタコントローラ206との間で、2つの領域0x0080_0000〜0x008f_ffff番地と0x0090_0000〜0x009f_ffff番地を交互に使用しながら繰り返しDMA動作が行われる。   In this way, the DMA operation is repeatedly performed between the scanner controller 205 and the printer controller 206 while alternately using the two areas 0x0080_0000 to 0x008f_ffff and 0x0090_0000 to 0x009f_ffff.

一方、USBコントローラ208の場合は、0x00b0_0000〜0x00bf_ffff番地が確保され、先頭番地である0x00b0_0000番地がDMA開始アドレスとして設定される。PC(USBホスト)124からPDLデータが送られてくると、USBコントローラ208はDMAにより当該開始アドレスから連続してデータを格納していく。全ての転送が終了すると、割り込みによりソフトウェアに通知され、次いでソフトウェアによってPDLデータが解釈され、プリントイメージデータが生成される。この最終的に生成されたプリントイメージデータは、新たに確保されたバッファ領域に格納される。これには再びメモリアロケート関数が呼ばれ、3MBの領域0x00c0_0000〜0x00ef_ffff番地が確保される。次に0x00c0_0000番地をDMAの先頭アドレスとしてプリンタコントローラ206が起動される。このときのプリンタコントローラ206のDMA転送は前述のスキャナープリンタ動作時のプリンタコントローラ206のDMA転送とは排他的に行われる。   On the other hand, in the case of the USB controller 208, addresses 0x00b0_0000 to 0x00bf_ffff are secured, and the start address 0x00b0_0000 is set as the DMA start address. When PDL data is sent from a PC (USB host) 124, the USB controller 208 stores data continuously from the start address by DMA. When all transfers are completed, the software is notified by an interrupt, and then the PDL data is interpreted by the software and print image data is generated. The finally generated print image data is stored in a newly secured buffer area. For this, the memory allocation function is called again, and a 3 MB area 0x00c0_0000 to 0x00ef_ffff is secured. Next, the printer controller 206 is activated with the address 0x00c0_0000 as the start address of the DMA. The DMA transfer of the printer controller 206 at this time is performed exclusively with the DMA transfer of the printer controller 206 during the above-described scanner printer operation.

このように、スキャナとプリンタ、HDDへのアクセスが同時に起こる場合、システムLSIの内部では複数のハードウェアがメモリに対して同時にDMAアクセスを行っている。
特開2000−211216号公報
As described above, when access to the scanner, the printer, and the HDD occurs simultaneously, a plurality of hardwares simultaneously perform DMA access to the memory inside the system LSI.
JP 2000-21112 A

このように、システムLSI内部に一つしか存在しないメモリリソースに対し、複数マスタがアクセス要求を出す場合、必ずある確率でアクセス要求が重なることがある。プリンタコントローラのように、プリンタエンジンに対して連続してデータを供給しなければならない場合には、アクセスが競合した場合のレイテンシの増大を見込まなければならない。したがって、データレートを緩衝するためのFIFOの容量を、遅延値の最悪ケースを想定しても大丈夫なように大きくとっておく必要が生じる。このため回路規模が増大し、チップ価格が上昇するだけでなく、発熱量の増加や信頼性の低下等さまざまな悪影響を与えている。   As described above, when a plurality of masters issue access requests to only one memory resource in the system LSI, the access requests may always overlap with a certain probability. When data must be continuously supplied to the printer engine as in a printer controller, latency must be increased when access conflicts. Therefore, it is necessary to make the FIFO capacity for buffering the data rate large enough to be safe even in the worst case of the delay value. For this reason, the circuit scale is increased, the chip price is increased, and various adverse effects such as an increase in heat generation and a decrease in reliability are caused.

例えば、あるDMA転送では1転送あたり32バイトを転送するとする。このとき、FIFOメモリが32バイトしかないと、FIFOが空になって初めて次の転送を開始することができる。前述のプリンタコントローラのように、一度プリンタ動作が開始されるとプリンタエンジンにデータを間断なく供給することが必要な場合には、この構成は適用できない。FIFOには必ず複数のDMA転送分格納できるだけの容量が要求される。最低でもDMA転送2回分の容量、すなわち64バイトは必要となる。   For example, in a certain DMA transfer, 32 bytes are transferred per transfer. At this time, if the FIFO memory has only 32 bytes, the next transfer can be started only after the FIFO becomes empty. This configuration cannot be applied when it is necessary to supply data to the printer engine without interruption once the printer operation is started, as in the printer controller described above. The FIFO is required to have a capacity capable of storing a plurality of DMA transfers. A capacity of at least two DMA transfers, that is, 64 bytes is required.

いま、プリンタインターフェースが64バイトの容量のFIFOを備えているとする。FIFOの内容が32バイト以下になると、プリンタインターフェースは次のDMA転送要求をメモリコントローラに対して出すことができる。FIFOが空になるまでに、次のデータがメモリから読み出され、DMA転送によってFIFOに書き込まれれば、プリンタエンジンに切れ間なくデータを供給することができる。   Assume that the printer interface includes a FIFO having a capacity of 64 bytes. When the FIFO content is 32 bytes or less, the printer interface can issue the next DMA transfer request to the memory controller. If the next data is read from the memory and written to the FIFO by DMA transfer before the FIFO is emptied, the data can be supplied to the printer engine without interruption.

プリンタインターフェースがDMA転送要求をメモリコントローラに出したとき、同時にメモリアクセスを要求しているマスタが他になければ、FIFOが空になる前にデータをリードしFIFOに格納することができる。しかしこの時、直前に他のマスタがメモリコントローラに対しアクセス要求を出していた場合、そのメモリアクセス要求が処理されるまでプリンタコントローラはメモリからデータを読みFIFOに格納することができない。   When the printer interface issues a DMA transfer request to the memory controller, if there is no other master requesting memory access at the same time, data can be read and stored in the FIFO before the FIFO becomes empty. However, at this time, if another master has issued an access request to the memory controller immediately before, the printer controller cannot read the data from the memory and store it in the FIFO until the memory access request is processed.

条件によっては、この遅延時間の増加によって、プリンタコントローラのデータ読み出しが間に合わず、この間にFIFOが空になってしまう事態が生じてしまう。   Depending on the conditions, the increase in the delay time may cause a situation in which the printer controller cannot read the data in time, and the FIFO becomes empty during this time.

そのような場合を回避するために、プリンタコントローラの備えるFIFO容量は最悪のケースでも問題がないように、例えば128バイトの容量が備えられることになる。メモリの競合が少なければ、実際にはほとんどの場合64バイト、ないしは、せいぜい96バイトの容量を持てば間に合うのであるが、稀なケースにも対応できるようにするため回路規模が増大している。   In order to avoid such a case, the FIFO capacity of the printer controller is provided with a capacity of, for example, 128 bytes so that there is no problem even in the worst case. If there is little memory contention, in most cases it will be in time if it has a capacity of 64 bytes or 96 bytes at most, but the circuit scale has been increased in order to cope with rare cases.

本発明は、複数のマスタからのメモリアクセスが競合した場合にも、優先度の高いマスタが蒙るメモリアクセスレイテンシの増加を抑制し、緩衝FIFOの容量を削減できるようにすることを目的とする。 An object of the present invention is to suppress an increase in memory access latency experienced by a master having a high priority even when memory accesses from a plurality of masters compete, and to reduce the capacity of a buffer FIFO.

本発明のメモリ制御装置は、複数の要求元からの複数のリード要求を受信する受信手段と、前記受信手段により受信したリード要求に従ってメモリにアクセスするアクセス手段と、前記アクセス手段によってアクセスした結果のリードデータを格納する格納手段と、前記格納手段に格納しているリードデータを、当該リードデータを要求した要求元へ転送する転送手段とを有し、前記転送手段による第1の要求元へのデータ転送中に、前記格納手段が前記第1の要求元よりも優先度の高い第2の要求元へのリードデータを格納すると、前記転送手段は前記第1の要求元へのデータ転送を中断し前記第2の要求元へのデータ転送を開始することを特徴とするThe memory control device of the present invention includes a receiving unit that receives a plurality of read requests from a plurality of request sources, an access unit that accesses a memory according to the read request received by the receiving unit, and a result of access by the access unit. Storage means for storing the read data; and transfer means for transferring the read data stored in the storage means to the request source that requested the read data. The transfer means sends the read data to the first request source. If the storage means stores read data to a second request source having a higher priority than the first request source during data transfer, the transfer means interrupts data transfer to the first request source. The data transfer to the second request source is started .

本発明によれば、複数のマスタからのメモリアクセスが競合した場合にも、優先度の高いマスタが蒙るメモリアクセスレイテンシの増加を抑制し、緩衝FIFOの容量を削減できる。   According to the present invention, even when memory accesses from a plurality of masters compete, an increase in memory access latency experienced by a master with high priority can be suppressed and the capacity of the buffer FIFO can be reduced.

また、本発明によれば、システムLSI内部の複数のマスタからメモリアクセス要求が競合した場合にも、メモリのアクセス効率を低下させることなく、それと同時に優先度の高いマスタのメモリアクセスレイテンシの増加を抑えることが可能となる。   In addition, according to the present invention, even when memory access requests from a plurality of masters in the system LSI compete with each other, the memory access efficiency of the high priority master is increased at the same time without reducing the memory access efficiency. It becomes possible to suppress.

以下本発明の第1の実施例について、図を用いて詳細に説明する。   Hereinafter, a first embodiment of the present invention will be described in detail with reference to the drawings.

図8は本発明の第1の実施例のブロック図を説明する図である。図8において800はシステムLSIであり、プロセッサ、メモリコントローラ、DMA機能を備える複数のハードウェアエンジン、さらには説明の簡単のため図示されない複数の機能モジュールを内蔵している。801は前記システムLSI800に内蔵されるメモリコントローラによって制御されるメモリであり、4バンク構成の256Mbit 4個が実装される。802〜805は外部IOインターフェースであり、802がスキャナインターフェース、803がプリンタインターフェース、804がPCIインターフェース、805がUSBインターフェースである。外部IOインターフェース802〜805は、それぞれが前記システムLSI800の内部において前記複数のハードウェアエンジンと接続される。810はスキャナインターフェース802によってシステムLSI800と接続されるスキャナ、811はプリンタインターフェース803によってシステムLSI800と接続されるプリンタエンジンである。812はUSBインターフェース805によってシステムLSI800と接続されるUSBホスト、813はPCIインターフェース804によってシステムLSI800と接続されるPCI拡張スロットである。   FIG. 8 is a diagram for explaining a block diagram of the first embodiment of the present invention. In FIG. 8, reference numeral 800 denotes a system LSI, which includes a processor, a memory controller, a plurality of hardware engines having a DMA function, and a plurality of functional modules not shown for the sake of simplicity. Reference numeral 801 denotes a memory controlled by a memory controller built in the system LSI 800, and four 256Mbits having a 4-bank configuration are mounted. 802 to 805 are external IO interfaces, 802 is a scanner interface, 803 is a printer interface, 804 is a PCI interface, and 805 is a USB interface. Each of the external IO interfaces 802 to 805 is connected to the plurality of hardware engines inside the system LSI 800. A scanner 810 is connected to the system LSI 800 via a scanner interface 802, and a printer engine 811 is connected to the system LSI 800 via a printer interface 803. A USB host 812 is connected to the system LSI 800 via the USB interface 805, and a PCI expansion slot 813 is connected to the system LSI 800 via the PCI interface 804.

前記ハードウェアエンジンは、より具体的には、スキャナコントローラ、プリンタコントローラ、PCIインターフェース、USBデバイスインターフェースなどである。しかしながら、このハードウェアエンジンは、必ずしもIOインターフェースと関係しているものだけではなく、画像処理、画像符号化複合化、データ圧縮伸張などを行うハードウェアエンジンも含まれている。これらは、リード用のDMAコントローラとライト用のDMAコントローラの両方を備えている。これを次の図9を用いて詳細に説明する。   More specifically, the hardware engine is a scanner controller, a printer controller, a PCI interface, a USB device interface, or the like. However, this hardware engine is not necessarily related to the IO interface, but includes a hardware engine that performs image processing, image coding and decoding, data compression / decompression, and the like. These include both a read DMA controller and a write DMA controller. This will be described in detail with reference to FIG.

図9は本実施例における図9のシステムLSI800のより具体的な構成を説明する図である。   FIG. 9 is a diagram for explaining a more specific configuration of the system LSI 800 of FIG. 9 in the present embodiment.

図9において、901はプロセッサでありMIPS R4000互換の機能を有する。905はスキャナコントローラであり、スキャナインターフェース930を介して外部のスキャナ810と接続される。906はプリンタコントローラであり、プリンタインターフェース931を介して外部のプリンタエンジン811と接続される。907はPCIホストブリッジ機能を備えるPCIコントローラであり、PCIインターフェース932を介し外部の1ないし複数のPCIターゲットデバイスと接続される。908はUSBデバイスコントローラであり、USBインターフェース933を介し外部のUSBホスト812と接続さる。   In FIG. 9, reference numeral 901 denotes a processor having a function compatible with MIPS R4000. A scanner controller 905 is connected to an external scanner 810 via a scanner interface 930. A printer controller 906 is connected to an external printer engine 811 via a printer interface 931. A PCI controller 907 has a PCI host bridge function, and is connected to one or more external PCI target devices via a PCI interface 932. A USB device controller 908 is connected to an external USB host 812 via the USB interface 933.

904はメモリであり、総容量は128MBであり、16bit×4bank×4M word構成の256MbitDDRSDRAM4個により構成されるメモリである。メモリ904は、図8のメモリ801に相当する。   Reference numeral 904 denotes a memory having a total capacity of 128 MB and is configured by four 256 Mbit DDR SDRAMs having a 16 bit × 4 bank × 4 M word configuration. The memory 904 corresponds to the memory 801 in FIG.

909はJPEG圧縮・伸張エンジンであり、メモリ904上のJPEG符号データをリードDMAにより読み出し、復号したのち、生画像データをライトDMAによりメモリ904に書き込む機能を備える。また、JPEG圧縮・伸張エンジン909は、メモリ904上の生画像データをリードDMAにより読み出し、符号化したのち、符号データをライトDMAによりメモリ904に書き込む機能も備える。   Reference numeral 909 denotes a JPEG compression / decompression engine, which has a function of reading JPEG code data on the memory 904 by read DMA, decoding it, and writing raw image data to the memory 904 by write DMA. The JPEG compression / decompression engine 909 also has a function of reading the raw image data on the memory 904 by read DMA and encoding it, and then writing the code data to the memory 904 by write DMA.

920はシステムバスであり、バスマスタであるプロセッサ901、各ハードウェアエンジンと、バススレーブであるメモリコントローラ902、その他とを接続する。共有バスではなく、複数のバスマスタと複数のバススレーブ間を多重に接続可能なマルチレイヤ構造をとっている。   A system bus 920 connects a processor 901 that is a bus master, each hardware engine, a memory controller 902 that is a bus slave, and the like. Instead of a shared bus, a multi-layer structure is employed that allows multiple connections between multiple bus masters and multiple bus slaves.

902はDDR SDRAMをサポートするメモリコントローラであり、図1に詳細に示される。   Reference numeral 902 denotes a memory controller that supports DDR SDRAM, which is shown in detail in FIG.

図5および図6は本発明の第1の実施例におけるシステムバス920のバスプロトコルを説明する図である。図5はリード転送を示し、図6はライト転送を示す。前述のようにシステムバス920はマルチレイヤ構成であり、バスマスタから見た場合に任意のバススレーブとの間で1対1に接続されているようにみなすことができる。   5 and 6 are diagrams for explaining the bus protocol of the system bus 920 in the first embodiment of the present invention. FIG. 5 shows read transfer, and FIG. 6 shows write transfer. As described above, the system bus 920 has a multi-layer configuration, and can be regarded as being connected one-to-one with an arbitrary bus slave when viewed from the bus master.

本実施例において、システムバス920は以下の信号により構成される。
clk システムバスクロック
ts Bus Transaction Start Master → Slave
addr[31:2] Address Bus Master → Slave
mid[3:0] Master ID Master → Slave
rd_not_wr Read(H)/Write(L) Master → Slave
one_not_two Access Size Master → Slave
rd_byteen[3:0] Read Data Byte Enable Master → Slave
wr_data[31:0] Write Data Bus Master → Slave
wr_byteen[3:0] Write Data Byte Enable Master → Slave
srdy Slave Ready Slave → Master
rrdy Read Return Ready Slave → Master
rmid[3:0] Return Master ID Slave → Master
rd_data[31:0] Read Data Bus Slave → Master
rd_error Read Error Slave → Master
In this embodiment, the system bus 920 includes the following signals.
clk system bus clock
ts Bus Transaction Start Master → Slave
addr [31: 2] Address Bus Master → Slave
mid [3: 0] Master ID Master → Slave
rd_not_wr Read (H) / Write (L) Master → Slave
one_not_two Access Size Master → Slave
rd_byteen [3: 0] Read Data Byte Enable Master → Slave
wr_data [31: 0] Write Data Bus Master → Slave
wr_byteen [3: 0] Write Data Byte Enable Master → Slave
srdy Slave Ready Slave → Master
rrdy Read Return Ready Slave → Master
rmid [3: 0] Return Master ID Slave → Master
rd_data [31: 0] Read Data Bus Slave → Master
rd_error Read Error Slave → Master

以下、それぞれの信号を説明する。   Hereinafter, each signal will be described.

システムバス920は同期バスであり、システムバス920のすべての信号のアサート/デアサートは、システムバスクロックclkの立ち上がりエッジに同期して行なわれる。   The system bus 920 is a synchronous bus, and all signals of the system bus 920 are asserted / deasserted in synchronization with the rising edge of the system bus clock clk.

各バスマスタがバス転送をStartしたいときにTransaction Start(ts)のアサートを開始し、srdyがアサートされるまでTransaction Start(ts)のアサートを続ける。Transaction Start(ts)は、srdyがアサートされた次のClock サイクルでデアサートする。tsとsrdyの両方がアサートされているサイクルでバス転送が開始する。バスマスタは次のバス転送のためにtsの1サイクルのデアサート期間の後、Transaction Start(ts)を再びアサートすることができる。   Each bus master starts asserting Transaction Start (ts) when it wants to start bus transfer, and continues asserting Transaction Start (ts) until srdy is asserted. Transaction Start (ts) deasserts in the next Clock cycle in which srdy is asserted. Bus transfer starts in a cycle in which both ts and srdy are asserted. The bus master can reassert Transaction Start (ts) after a deassertion period of ts for the next bus transfer.

Address Bus(addr[31:2])(Master→Slave)は、tsと同時に確定され、tsのデアサートの1サイクル後のサイクルまで保持される。   Address Bus (addr [31: 2]) (Master → Slave) is determined at the same time as ts and held until one cycle after deassertion of ts.

Master ID(mid[3:0])(Master→Slave)は、アクセスを行なうバスマスタのIDである。Master ID (mid[3:0])は、tsと同時に確定され、tsのデアサートの1サイクル後のサイクルまで保持される。   Master ID (mid [3: 0]) (Master → Slave) is an ID of a bus master performing access. Master ID (mid [3: 0]) is determined at the same time as ts and held until one cycle after deassertion of ts.

Read(H)/Write(L)(rd_not_wr)(Master→Slave)は、バス転送のRead/Writeを示す。Read(H)/Write(L)は、tsと同時に確定され、tsのデアサートの1サイクル後のサイクルまで保持される。High:Readであり、Low:Writeである。   Read (H) / Write (L) (rd_not_wr) (Master → Slave) indicates Read / Write of bus transfer. Read (H) / Write (L) is determined at the same time as ts and is held until one cycle after deassertion of ts. High: Read and Low: Write.

Single or 2 beat Burst(one_not_two)(Master→Slave)は、システムバス920上のバス転送がSingle Transactionか2beat Burst Transactionかを示す。Singleの時は最初の1beat目のDataのみが有効である。Single or 2 beat Burst(one_not_two)は、tsと同時に確定され、tsのデアサートの1サイクル後のサイクルまで保持される。High:Singleであり、Low:2 beat Burstである。   Single or 2 beat Burst (one_not_two) (Master → Slave) indicates whether the bus transfer on the system bus 920 is a Single Transaction or a 2-beat Burst Transaction. In the case of Single, only the first 1-beat Data is valid. Single or 2 beat Burst (one_not_two) is determined at the same time as ts and held until one cycle after the deassertion of ts. High: Single, Low: 2 beat Burst.

Read Data Byte Enable(rd_byteen[3:0])(Master→Slave)は、Read時のByte Enableを示す。Read Data Byte Enable(rd_byteen[3:0])は、one_not_twoがSingleを示している時、その32bitの中でどのバイト位置へのReadであるかを示す。one_not_twoが2 beat burstを示している時は、Read Data Byte Enable(rd_byteen[3:0])はすべてEnableにしておかなければならない。wr_byteen[3:0]はWrite時のData Phaseで有効であるが、Read Data Byte Enable(rd_byteen[3:0])はRead時のAddress Phaseで有効である。Read Data Byte Enable(rd_byteen[3:0])は、tsと同時に確定され、tsのデアサートの1サイクル後のサイクルまで保持される。   Read Data Byte Enable (rd_byte [3: 0]) (Master → Slave) indicates Byte Enable at the time of Read. Read Data Byte Enable (rd_byte [3: 0]) indicates to which byte position in the 32 bits the Read is read when one_not_two indicates Single. When one_not_two indicates 2 beat burst, all Read Data Byte Enable (rd_byte [3: 0]) must be set to Enable. wr_byteen [3: 0] is valid in Data Phase at Write, but Read Data Byte Enable (rd_byte [3: 0]) is valid in Address Phase at Read. Read Data Byte Enable (rd_byte [3: 0]) is determined at the same time as ts, and is held until one cycle after deassertion of ts.

32bitのData Busで、Write Data Bus(wr_data[31:0])(Master→Slave)は、マスタからスレーブへのWrite Dataである。Write Data Bus(wr_data[31:0])は、tsとsrdyの両方がアサートされたサイクルの次のサイクルから有効である。更に、Write Data Bus(wr_data[31:0])は、Single Transaction時は最初の1beat目のDataのみが、2beat Burst Transaction時は1beat目と2beat目の両方のDataが有効である。どのByteが有効かはwr_byteen[3:0]によって示される。システムバス920はBig Endian Busなので、MSB側が0番地となる。   A 32-bit Data Bus, Write Data Bus (wr_data [31: 0]) (Master → Slave) is Write Data from the master to the slave. Write Data Bus (wr_data [31: 0]) is valid from the cycle following the cycle in which both ts and srdy are asserted. Further, Write Data Bus (wr_data [31: 0]) is valid only for the first 1-beat data during Single Transaction, and for both 1-beat and 2-beat data during 2 Beat Burst Transaction. Which Byte is valid is indicated by wr_byteen [3: 0]. Since the system bus 920 is Big Endian Bus, the MSB side is address 0.

Write Data Byte Enable(wr_byteen[3:0])(Master → Slave)は、Write Dataのどのバイト位置が有効かを示す。Write Data Byte Enable(wr_byteen[3:0])は、wr_data[31:0]と同じく、tsとsrdyの両方がアサートされたサイクルの次のサイクルから有効である。更に、Write Data Byte Enable(wr_byteen[3:0])は、Single Transaction時は最初の1beat目のみで、2beat Burst Transaction時は1beat目と2beat目の両方で有効である。   Write Data Byte Enable (wr_byte [3: 0]) (Master → Slave) indicates which byte position of Write Data is valid. Write Data Byte Enable (wr_byte [3: 0]) is valid from the cycle following the cycle in which both ts and srdy are asserted, as in wr_data [31: 0]. Further, Write Data Byte Enable (wr_byte [3: 0]) is effective only in the first 1-beat at the time of Single Transaction, and effective at both 1-beat and 2-beat at the time of 2 Beat Burst Transaction.

wr_dataとの対応は以下の通りである。
wr_byteen[3] wr_data[31:24]
wr_byteen[2] wr_data[23:16]
wr_byteen[1] wr_data[15:8]
wr_byteen[0] wr_data[7:0]
Slave Ready(srdy)(Slave→Master)は、スレーブのBufferがマスタからのバス転送を受け取る準備ができていることを示す。Slave Ready(srdy)がアサートされていれば、マスタはいつでもバス転送を始めることができ、スレーブは必ずそのバス転送を受け取らなければならない。
Correspondence with wr_data is as follows.
wr_byte [3] wr_data [31:24]
wr_byte [2] wr_data [23:16]
wr_byteen [1] wr_data [15: 8]
wr_byte [0] wr_data [7: 0]
Slave Ready (srdy) (Slave → Master) indicates that the slave Buffer is ready to receive a bus transfer from the master. If Slave Ready (srdy) is asserted, the master can initiate a bus transfer at any time and the slave must accept the bus transfer.

Read Return Ready(rrdy)(Slave→Master)は、スレーブからのRead Returnを示す信号である。スレーブはRead Dataの準備ができたらRead Return Ready(rrdy)をアサートし、Read ReturnをStartする。Read Return Ready(rrdy)はいつでもアサートしてよい。Read Return Ready(rrdy)のアサートと同じサイクルでRead Dataが返される。2beat Burstであった場合は、Read Return Ready(rrdy)が2サイクル期間アサートされ、2beat分の Read Dataが返される。その際、Read Return Ready(rrdy)は連続してアサートされる必要は無く、間にウェイトサイクルをはさむことができる。   Read Return Ready (rrdy) (Slave → Master) is a signal indicating Read Return from the slave. When the slave is ready for Read Data, the slave asserts Read Return Ready (rrdy) and starts Read Return. Read Return Ready (rrdy) may be asserted at any time. Read Data is returned in the same cycle as assertion of Read Return Ready (rrdy). If it is 2 beat Burst, Read Return Ready (rrdy) is asserted for 2 cycles, and Read data for 2 beats is returned. At that time, Read Return Ready (rrdy) does not need to be continuously asserted, and a wait cycle can be interposed therebetween.

Return Master ID(rmid[3:0])(Slave→Master)は、Read Returnを受けるべきマスタのIDである。Read Requestを受け付けた時にアサートされたmid[3:0]を保持しておき、同じIDを返す。マスタはrsのアサート時のReturn Master ID(rmid[3:0])をデコードし、自分のMaster IDである場合にそのRead Returnを自分へのRead Returnだと判断する。Return Master ID (rmid[3:0])は、rrdyと同時にアサートする。   Return Master ID (rmid [3: 0]) (Slave → Master) is an ID of a master that should receive Read Return. It holds mid [3: 0] asserted when Read Request is received, and returns the same ID. The master decodes the Return Master ID (rmid [3: 0]) at the time of assertion of rs, and determines that the Read Return is the Read Return to itself when it is its Master ID. Return Master ID (rmid [3: 0]) is asserted simultaneously with rrdy.

32bitのData Busで、Read Data Bus(rd_data[31:0])(Slave→Master)は、スレーブからマスタへのRead Dataである。rrdyがアサートされるサイクルで有効なデータが返される。   A 32-bit Data Bus and Read Data Bus (rd_data [31: 0]) (Slave → Master) is Read Data from the slave to the master. Valid data is returned in the cycle in which rrdy is asserted.

Read Error(rd_error)(Slave→Master)は、スレーブからのエラーをMasterに通知する。エラーが発生した場合、スレーブはRead Return時にrrdyと同じサイクルでRead Error(rd_error)をアサートする。   Read Error (rd_error) (Slave → Master) notifies the master of an error from the slave. When an error occurs, the slave asserts Read Error (rd_error) in the same cycle as rrdy at Read Return.

以上が、信号の説明である。   The above is the description of the signal.

次に、Transaction typeを説明する。   Next, the transaction type will be described.

システムバス920では、Read Writeとも、Single Transactionと2 beat Transactionとが存在する。   In the system bus 920, both Read Write and Single Beat Transaction and 2-beat Transaction exist.

Single Transactionと2 beat Transactionの切り替えはone_not_twoによって行なう。   Switching between Single Transaction and 2-beat Transaction is performed by one_not_two.

one_not_two Access Size
0 2 beat
1 single
また、32bit(4byte)以下のバス転送(byte,half word)は、すべてSingle バス転送で行い、Writeの場合はwr_byteen[3:0]において、Readの場合はrd_byteen[3:0]において制御を行う。
2 beatのBurst Read時は、rd_byteen[3:0]をすべてEnableにしなければならない。
また、2 beatのBurst Access時、Addressは必ず64bitの境界に合わせなければならない。つまりaddr[2]は0となる。
one_not_two Access Size
0 2 beat
1 single
All bus transfers (bytes, half words) of 32 bits (4 bytes) or less are performed by single bus transfer. In the case of Write, control is performed in wr_byte [3: 0], and in the case of Read, control is performed in rd_byte [3: 0]. Do.
At the time of 2-beat burst read, all rd_byteen [3: 0] must be enabled.
In addition, at the time of 2-beat burst access, the address must be aligned with a 64-bit boundary. That is, addr [2] is 0.

次に、図6を参照しながら、write transactionを説明する。   Next, the write transaction will be described with reference to FIG.

基本Protocolは、以下のとおりである。   The basic protocol is as follows.

サイクル−2において、マスタはWrite バス転送を開始する際に、対象となるスレーブに対応したtsをアサートする。同時にone_not_two,mid[3:0],addr[31:2]をアサートする。   In cycle-2, the master asserts ts corresponding to the target slave when starting a write bus transfer. At the same time, one_not_two, mid [3: 0], addr [31: 2] are asserted.

サイクル−3において、対象となるスレーブに対応したsrdyがアサートされているので、Write バス転送の開始となり、マスタは、tsをデアサートする。また、マスタは、wr_data[31:0],wr_byteen[3:0]をアサートし、1Beat目のWrite Dataを出力する。   In cycle-3, since srdy corresponding to the target slave is asserted, the write bus transfer is started, and the master deasserts ts. Further, the master asserts wr_data [31: 0] and wr_byte [3: 0], and outputs Write Data for the first beat.

サイクル−4において、マスタは、one_not_two,mid[3:0],addr[31:2]をデアサートする。また、マスタは、wr_data[31:0],wr_byteen[3:0]を切り替え、2 beat目のWrite Dataを出力する。   In cycle-4, the master deasserts one_not_two, mid [3: 0], addr [31: 2]. Further, the master switches wr_data [31: 0] and wr_byte [3: 0], and outputs the second beat Write Data.

サイクル−5において、Write バス転送は、終了する。   In cycle-5, the write bus transfer ends.

なお、マスタがtsをアサートしても、srdyがデアサートされていた場合(サイクル−8)、マスタはtsをアサートし続ける。そして、srdyがアサートされると(サイクル−9)、tsをデアサートする(サイクル−10)。   Even if the master asserts ts, if srdy is deasserted (cycle-8), the master continues to assert ts. When srdy is asserted (cycle-9), ts is deasserted (cycle-10).

マスタは次のバス転送を開始するためにtsの1サイクルのデアサート期間の後、再びアサートすることができる。(サイクル−11)
Write バス転送が連続した場合で、もっとも各バス転送間が詰まった状態では、間隔を空けずにDataをWriteし続けることができる。
The master can assert again after a one-cycle deassertion period of ts to initiate the next bus transfer. (Cycle-11)
When the write bus transfer is continuous and the interval between the bus transfers is clogged, the data can be continuously written without leaving an interval.

次に、図5を参照しながら、Read transactionを説明する。   Next, Read transaction will be described with reference to FIG.

Read バス転送はマスタからスレーブへのRead Commandのバス転送と、スレーブからマスタへのRead DataのRead Returnに分かれている。それぞれは独立しており、信号線も独立したものとなっている。   Read bus transfer is divided into read command bus transfer from the master to the slave, and read return of the read data from the slave to the master. Each is independent, and the signal lines are also independent.

基本Protocolは、以下のとおりである。   The basic protocol is as follows.

サイクル−2において、マスタはRead バス転送を開始する際に、対象となるスレーブに対応したtsをアサートする。同時にone_not_two,rd_not_wr,rd_byteen[3:0],mid[3:0],addr[31:2]をアサートする。   In cycle-2, the master asserts ts corresponding to the target slave when it starts Read bus transfer. At the same time, one_not_two, rd_not_wr, rd_byte [3: 0], mid [3: 0], addr [31: 2] are asserted.

サイクル−3において、対象となるスレーブに対応したsrdyがアサートされているので、Read バス転送の開始となり、tsをデアサートする。   In cycle-3, since srdy corresponding to the target slave is asserted, Read bus transfer starts and ts is deasserted.

サイクル−4において、マスタは、one_not_two,rd_not_wr,rd_byteen[3:0],mid[3:0],addr[31:2]をデアサートする。   In cycle-4, the master deasserts one_not_two, rd_not_wr, rd_byte [3: 0], mid [3: 0], addr [31: 2].

Read バス転送のRead Commandバス転送終了は、以下のとおりである。   The completion of Read Command bus transfer of Read bus transfer is as follows.

サイクル−6において、スレーブはRead Dataの準備ができたら、rrdyとrmid[3:0]をアサートしてRead Returnを開始する。rmid[3:0]にはRead Commandでマスタから受け取ったMaster IDをのせる。   In cycle-6, when the slave is ready for Read Data, it asserts rrdy and rmid [3: 0] and starts Read Return. In rmid [3: 0], the Master ID received from the master by Read Command is placed.

また、 rd_data[31:0]をアサートし、1Beat目のRead Dataを出力する。   Also, rd_data [31: 0] is asserted, and Read Data of the first Beat is output.

次に、サイクル−7において、スレーブは、rrdyをデアサートする。rmid[3:0]をデアサートする。   Next, in cycle-7, the slave deasserts rrdy. Deassert rmid [3: 0].

サイクル−8において、スレーブは、再度rrdyをアサートとする。ここでは1サイクルのウェイトが入っているが、任意のウェイトサイクルを入れることができる。また、rd_data[31:0]に2 beat目のRead Dataを出力する。   In cycle-8, the slave asserts rrdy again. Here, one cycle wait is included, but any wait cycle can be inserted. Also, Read data of the second beat is output to rd_data [31: 0].

サイクル−9において、スレーブは、rrdyをデアサートする。また、スレーブは、rmid[3:0]をデアサートする。   In cycle-9, the slave deasserts rrdy. The slave also deasserts rmid [3: 0].

サイクル−10において、Read Returnは終了する。   In cycle-10, Read Return ends.

なお、マスタがtsをアサートしても、srdyがデアサートされていた場合(サイクル−8,9)、マスタはtsをアサートし続ける。そして、srdyがアサートされると、tsをデアサートする。(サイクル−10)
マスタは、次のバス転送を開始するためにtsの1サイクルのデアサート期間の後、再びアサートすることができる。(サイクル−11)
スレーブは、さらにReturnすべきDataがある場合は、次のRead Returnを開始するためにrrdyを連続してアサートすることができる。(サイクル−16)
Read バス転送が連続した場合には、リードデータバス上で間隔を空けずにDataをReadし続けることができる。
Even if the master asserts ts, if srdy is deasserted (cycles -8, 9), the master continues to assert ts. When srdy is asserted, ts is deasserted. (Cycle-10)
The master can assert again after a one-cycle deassertion period of ts to initiate the next bus transfer. (Cycle-11)
The slave can continuously assert rrdy to start the next Read Return when there is more Data to Return. (Cycle-16)
When Read bus transfer continues, Data can continue to be read without leaving an interval on the read data bus.

次に、実際の動作を例に挙げて本発明の第1の実施例の説明を行う。   Next, an actual operation will be described as an example to describe the first embodiment of the present invention.

図10は図9においてプロセッサ901、プリンタコントローラ906が同時にメモリコントローラ902からリードを行う場合のタイミングチャートを示したものである。物理アドレスとメモリデバイスのバンクアドレス、ロウアドレス、カラムアドレスとの対応は図15に示すとおりである。   FIG. 10 shows a timing chart when the processor 901 and the printer controller 906 in FIG. 9 simultaneously read from the memory controller 902. The correspondence between the physical address and the bank address, row address, and column address of the memory device is as shown in FIG.

以下、プロセッサ901をマスタ1、プリンタコントローラ906をマスタ2、メモリコントローラ902をスレーブと呼ぶ。   Hereinafter, the processor 901 is called a master 1, the printer controller 906 is called a master 2, and the memory controller 902 is called a slave.

図10において、初めにマスタ1が転送を開始する(サイクル1)。スレーブはsrdyをアサートし、このコマンドを受け付ける。アドレスは0x00000400番地である。紙面の都合で図示されないが、このコマンドはリード(rd_not_wr=1)であり、かつ2ビート(one_not_two=0)である。   In FIG. 10, first, the master 1 starts transfer (cycle 1). The slave asserts srdy and accepts this command. The address is 0x00004000. Although not shown due to space limitations, this command is read (rd_not_wr = 1) and 2 beats (one_not_two = 0).

同時にマスタ2が転送を開始する(サイクル2)。スレーブはsrdyをアサートし、このコマンドを受け付ける(サイクル4)。アドレスは0x00037bfc番地である。このコマンドも2ビートのリードコマンドである。   At the same time, the master 2 starts transfer (cycle 2). The slave asserts srdy and accepts this command (cycle 4). The address is address 0x00037bfc. This command is also a 2-beat read command.

この後同様にして、スレーブはマスタ2、マスタ1からそれぞれアドレス0x00037c00番地、アドレス0x00000410番地への2ビート・リードコマンドを受け付ける。   Thereafter, in the same manner, the slave receives 2-beat read commands from the master 2 and the master 1 to the address 0x00037c00 and the address 0x000000410, respectively.

メモリコントローラ902は、前記リードコマンドを受け付けると一旦コマンドキュー(図1の702)に格納し、受け付けた順にメモリ904に対しアクセスを行うのであるが、このときシステムバスの1ビート分を単位としてアクセスを行う。本実施例においては、システムバスは32ビットで構成されているので、32ビット単位でのアクセスを行うことになる。メモリ904のバス幅は16ビットであるから、メモリに対して2ビートリードアクセスを発行し、そのリード結果を32ビットにまとめてマスタに返すよう動作する。ここでメモリ904がDDR SDRAMにより構成されていることに注意する必要がある。   When the memory controller 902 accepts the read command, it temporarily stores it in the command queue (702 in FIG. 1), and accesses the memory 904 in the accepted order. I do. In this embodiment, since the system bus is composed of 32 bits, access is performed in units of 32 bits. Since the bus width of the memory 904 is 16 bits, it issues a 2-beat read access to the memory, and operates to collect the read results into 32 bits and return them to the master. Here, it should be noted that the memory 904 is composed of DDR SDRAM.

すなわち、メモリ904に対する2ビートのアクセスは、システムバスクロックの1クロックでデータが転送される。   That is, in the 2-beat access to the memory 904, data is transferred by one system bus clock.

また、DDRメモリは同一デバイスの同一ページ、あるいは同一デバイスの別バンクに存在するページに対するアクセスは連続したサイクルで行うことができる。   In the DDR memory, access to the same page of the same device or a page existing in another bank of the same device can be performed in a continuous cycle.

いま、マスタ1の最初のリード要求のアドレスである0x00000400番地とマスタ2の最初のリード要求のアドレスである0x00037bfc番地は同一デバイス(同一チップセレクト)でかつ別のバンクに存在するページに存在する。   Now, the address 0x00004000 which is the address of the first read request of the master 1 and the address 0x00037bfc which is the address of the first read request of the master 2 are in the same device (same chip select) and in pages existing in different banks.

従って、これらのページへのアクセスは連続したサイクルで行うことができる。   Therefore, these pages can be accessed in a continuous cycle.

そこで、本発明の第1の実施例に係るメモリコントローラ902においては、マスタ1およびマスタ2からの各々2ビート(32ビット×2=64ビット)のアクセスを、32ビット単位のアクセスに分割し、それらを交互に行うように動作する。このようにしても各メモリアクセスは連続したサイクルで行えるため、無駄な待ちサイクルが生じない。   Therefore, in the memory controller 902 according to the first embodiment of the present invention, each 2-beat (32 bits × 2 = 64 bits) access from the master 1 and the master 2 is divided into 32-bit access, It works to do them alternately. Even in this way, each memory access can be performed in a continuous cycle, so that no wasteful waiting cycle occurs.

このときのシステムバスとメモリバス上でのタイミングの関係を図11に示す。ここに示されるように、メモリコントローラ902は、転送単位がメモリアクセス要求の転送単位(64ビット)より小さい複数のコマンドを生成する。メモリコントローラ902は、メモリアクセス要求が複数の要求元(マスタ1、2)から行われている場合、複数のコマンドをメモリ904に対し要求元毎に交互に発行する。このようにして、複数のメモリアクセス要求が時分割並列的に実行される。なお、メモリコントローラ902は、メモリアクセス要求がメモリ読み出し要求である場合にのみ、このように、複数のコマンドをメモリ904に対し要求元毎に交互に発行する。なお、コマンドキュー701(図1)は、受け付けたメモリアクセス要求を順に格納し、コマンドキュー701の先頭および2番目のアクセス要求についてのみ、前記複数のコマンドを交互に発行する候補とする。   FIG. 11 shows the timing relationship on the system bus and the memory bus at this time. As shown here, the memory controller 902 generates a plurality of commands whose transfer unit is smaller than the transfer unit (64 bits) of the memory access request. When a memory access request is made from a plurality of request sources (masters 1 and 2), the memory controller 902 issues a plurality of commands to the memory 904 alternately for each request source. In this way, a plurality of memory access requests are executed in a time division parallel manner. Note that the memory controller 902 issues a plurality of commands alternately to the memory 904 for each request source only when the memory access request is a memory read request. The command queue 701 (FIG. 1) stores received memory access requests in order, and only the first and second access requests in the command queue 701 are candidates for alternately issuing the plurality of commands.

前述のように動作した結果、サイクル11において、スレーブはrrdyをアサートし、1ビートのリードリターンを返す。このときMID=1であり、マスタ1がこのリードリターンを受け取る。次いでサイクル12において、スレーブはrrdyをアサートし、1ビートのリードリターンを返す。このときMID=2であり、マスタ2がこのリードリターンを受け取る。   As a result of the operation described above, in cycle 11, the slave asserts rrdy and returns a read return of 1 beat. At this time, MID = 1, and the master 1 receives this read return. Then in cycle 12, the slave asserts rrdy and returns a 1-beat read return. At this time, MID = 2, and the master 2 receives this read return.

次のサイクル13には1サイクルのウェイトサイクルが入るが、これは本実施例におけるメモリコントローラの実装上の内部タイミングの生成方法に依存しているが、本発明の説明には直接関係がないため説明は省略する。もちろんメモリコントローラの実装方法によってはこのサイクルは不要である。   The next cycle 13 includes one wait cycle, which depends on the internal timing generation method in the implementation of the memory controller in this embodiment, but is not directly related to the description of the present invention. Description is omitted. Of course, this cycle is not necessary depending on the mounting method of the memory controller.

さらにサイクル14においては、スレーブはrrdyをアサートし、1ビートのリードリターンを返す。このときMID=1であり、マスタ1がこのリードリターンを受け取るが、これはマスタ1が発行した最初のリードアクセス要求に対する2ビート目のデータである。次いでサイクル15において、スレーブはrrdyをアサートし、1ビートのリードリターンを返す。このときMID=2であり、マスタ2がこのリードリターンを受け取る。これはマスタ2が発行した最初のリードアクセス要求に対する2ビート目のデータである。   Further, in cycle 14, the slave asserts rrdy and returns a one-beat read return. At this time, MID = 1, and the master 1 receives this read return, which is data of the second beat for the first read access request issued by the master 1. Then in cycle 15, the slave asserts rrdy and returns a 1-beat read return. At this time, MID = 2, and the master 2 receives this read return. This is the second beat data for the first read access request issued by the master 2.

すなわち、従来例においては、マスタ2に対する最初のリードリターンデータはマスタ1のアクセス要求に対する全てのリードリターンが完了した後、すなわち13サイクルないし14サイクル目になる。これに対し、本発明の第1の実施例においてはそれよりも早いサイクルでマスタ2に対し最初のリードリターンデータが返されることになる。   That is, in the conventional example, the first read return data for the master 2 is the 13th to 14th cycles after all the read returns for the access request of the master 1 are completed. On the other hand, in the first embodiment of the present invention, the first read return data is returned to the master 2 in a cycle earlier than that.

以降、同様にして、マスタ1,2の2番目のリードアクセス要求に対しても、サイクル22、23,25,26において1ビートのデータがマスタ毎に交互に返される。   Thereafter, similarly, in response to the second read access request of the masters 1 and 2, 1-beat data is alternately returned for each master in cycles 22, 23, 25, and 26.

このようにして、本発明の第1の実施例においては、システムLSI内部の複数のマスタからメモリアクセス要求が同時に生じた場合、それらの転送単位を分割し、交互にメモリアクセスを行う。これにより、各マスタに対する最初のリターンデータの平均レイテンシを小さくすることができる。   In this way, in the first embodiment of the present invention, when memory access requests are simultaneously generated from a plurality of masters in the system LSI, those transfer units are divided and memory access is performed alternately. As a result, the average latency of the first return data for each master can be reduced.

そのため各々が必要とするFIFOの容量を削減することが可能となり、回路規模を抑えることができる。   Therefore, it is possible to reduce the capacity of the FIFO required for each, and the circuit scale can be suppressed.

以上において、本発明が特定の実施例に関して図示されかつ説明されたが、さらに他の修正および改善が可能である。   Although the present invention has been shown and described with respect to particular embodiments, further modifications and improvements are possible.

例えば、本発明の第1の実施例においては、説明の簡単のため、システムバスのバースト転送は1ビートないし2ビートの場合について説明したが、これに限定されるものではない。実際には、ビート長が長くなる程、本発明の効果が顕著になることが理解されるべきである。   For example, in the first embodiment of the present invention, the burst transfer of the system bus has been described for the case of 1 beat to 2 beats for the sake of simplicity, but the present invention is not limited to this. In fact, it should be understood that the longer the beat length, the more pronounced the effect of the present invention.

また例えば、本発明の第1の実施例においては、メモリデバイスにアクセスする際のビート長が2である場合について説明したが、任意のビート長について適用できる。   For example, in the first embodiment of the present invention, the case where the beat length when accessing the memory device is 2 has been described. However, the present invention can be applied to any beat length.

次の本発明の第2の実施例を説明する。本実施例のブロック図、システムLSI800の構成を説明する図、メモリコントローラ詳細は、それぞれ、図8、図9、図1と共通である。   Next, a second embodiment of the present invention will be described. The block diagram of the present embodiment, the diagram explaining the configuration of the system LSI 800, and the details of the memory controller are the same as those in FIGS. 8, 9, and 1, respectively.

図12および図13は本発明の第2の実施例におけるシステムバス920のバスプロトコルを説明する図である。図12はリード転送を示し、図13はライト転送を示す。前述のようにシステムバス920はマルチレイヤ構成であり、バスマスタから見た場合に任意のバススレーブとの間で1対1に接続されているようにみなすことができる。   12 and 13 are diagrams for explaining the bus protocol of the system bus 920 in the second embodiment of the present invention. FIG. 12 shows read transfer, and FIG. 13 shows write transfer. As described above, the system bus 920 has a multi-layer configuration, and can be regarded as being connected one-to-one with an arbitrary bus slave when viewed from the bus master.

以下、システムバス902を構成する信号を説明する。ただし、本実施例において、システムバス902を構成する信号の説明は、第1の実施例と共通する信号については、省略する。
b_size[3:0] Access Size Master → Slave
Burst size(b_size[3:0])(Master→Slave)は、システムバス920上のバス転送のバースト数を示す。1から16ビートまで指定可能である。tsと同時に確定させ、tsのデアサートの1サイクル後のサイクルまで保持する。
Hereinafter, signals constituting the system bus 902 will be described. However, in the present embodiment, description of signals constituting the system bus 902 is omitted for signals common to the first embodiment.
b_size [3: 0] Access Size Master → Slave
Burst size (b_size [3: 0]) (Master → Slave) indicates the number of bus transfer bursts on the system bus 920. 1 to 16 beats can be specified. It is determined at the same time as ts and held until one cycle after the deassertion of ts.

0000は1 beat、0001は、2 beat、、、1111は、16 beatである。   0000 is 1 beat, 0001 is 2 beat, and 1111 is 16 beat.

Read Data Byte Enable(rd_byteen[3:0])((Master→Slave)は、Read時のByte Enableを示す。   Read Data Byte Enable (rd_byte [3: 0]) ((Master → Slave)) indicates Byte Enable at the time of Read.

b_size[3:0]がSingleを示している時、その32bitの中でどのバイト位置へのReadであるかを示す。b_sizeが2 beat burst以上を示している時は、本信号は無効ですべてEnableとして扱われる。wr_byteen[3:0]はWrite時のData Phaseで有効であるが、Read Data Byte Enable(rd_byteen[3:0])はRead時のAddress Phaseで有効である。Read Data Byte Enable(rd_byteen[3:0])は、tsと同時に確定させ、tsのデアサートの1サイクル後のサイクルまで保持する。   When b_size [3: 0] indicates Single, it indicates which byte position in the 32 bits is Read. When b_size indicates 2 beat burst or more, this signal is invalid and is treated as all enabled. wr_byteen [3: 0] is valid in Data Phase at Write, but Read Data Byte Enable (rd_byte [3: 0]) is valid in Address Phase at Read. Read Data Byte Enable (rd_byteen [3: 0]) is determined at the same time as ts and held until one cycle after the deassertion of ts.

次に、図13を参照しながら、write transactionを説明する。   Next, the write transaction will be described with reference to FIG.

基本Protocolは、以下のとおりである。   The basic protocol is as follows.

サイクル−2において、マスタはWrite バス転送を開始する際に、対象となるスレーブに対応したtsをアサートする。同時にb_size[3:0],rd_not_wr,mid[3:0],addr[31:2]をアサートする。   In cycle-2, the master asserts ts corresponding to the target slave when starting a write bus transfer. At the same time, b_size [3: 0], rd_not_wr, mid [3: 0], and addr [31: 2] are asserted.

サイクル−3において、対象となるスレーブに対応したsrdyがアサートされているので、Write バス転送の開始となり、マスタはtsをデアサートする。また、マスタはwr_data[31:0],wr_byteen[3:0]をアサートし、1Beat目のWrite Dataを出力する。   In cycle-3, since srdy corresponding to the target slave is asserted, the write bus transfer starts and the master deasserts ts. In addition, the master asserts wr_data [31: 0] and wr_byte [3: 0] and outputs Write Data for the first beat.

サイクル−4において、マスタはb_size[3:0],rd_not_wr,mid[3:0],addr[31:2]をデアサートする。また、マスタはwr_data[31:0],wr_byteen[3:0]を切り替え、2 beat目のWrite Dataを出力する。   In cycle-4, the master deasserts b_size [3: 0], rd_not_wr, mid [3: 0], addr [31: 2]. In addition, the master switches wr_data [31: 0] and wr_byte [3: 0], and outputs the second beat Write Data.

サイクル−5において、Write バス転送は終了する。   In cycle-5, the Write bus transfer ends.

マスタがtsをアサートしても、srdyがデアサートされていた場合(サイクル−8,9)はマスタはtsをアサートし続ける。そして、srdyがアサートされると、tsをデアサートする。(サイクル−10)
マスタは次のバス転送を開始するためにtsの1サイクルのデアサート期間の後、再びアサートすることができる。(サイクル−11)
Write バス転送が連続した場合で、もっとも各バス転送間が詰まった状態では、間隔を空けずにDataをWriteし続けることができる。
Even if the master asserts ts, if srdy is deasserted (cycles -8, 9), the master continues to assert ts. When srdy is asserted, ts is deasserted. (Cycle-10)
The master can assert again after a one-cycle deassertion period of ts to initiate the next bus transfer. (Cycle-11)
When the write bus transfer is continuous and the interval between the bus transfers is clogged, the data can be continuously written without leaving an interval.

次に、図12を参照しながら、Read transactionを説明する。   Next, Read transaction will be described with reference to FIG.

Read バス転送はマスタからスレーブへのRead Commandのバス転送と、スレーブからマスタへのRead DataのRead Returnに分かれている。それぞれは独立しており、信号線も独立したものとなっている。   Read bus transfer is divided into read command bus transfer from the master to the slave, and read return of the read data from the slave to the master. Each is independent, and the signal lines are also independent.

基本Protocolは、以下のとおりである。   The basic protocol is as follows.

サイクル−2において、マスタはRead バス転送を開始する際には、対象となるスレーブに対応したtsをアサートする。また、マスタは、同時にb_size[3:0],rd_not_wr,rd_byteen[3:0],mid[3:0],addr[31:2]をアサートする。   In cycle-2, when the master starts Read bus transfer, it asserts ts corresponding to the target slave. At the same time, the master asserts b_size [3: 0], rd_not_wr, rd_byteen [3: 0], mid [3: 0], addr [31: 2].

サイクル−3において、対象となるスレーブに対応したsrdyがアサートされているので、Read バス転送の開始となり、マスタは、tsをデアサートする。   In cycle-3, since srdy corresponding to the target slave is asserted, Read bus transfer starts, and the master deasserts ts.

サイクル−4:において、マスタは、b_size[3:0],rd_not_wr,rd_byteen[3:0],mid[3:0],addr[31:2]をデアサートする。   In cycle-4: the master deasserts b_size [3: 0], rd_not_wr, rd_byteen [3: 0], mid [3: 0], addr [31: 2].

Read バス転送のRead Commandバス転送終了は、以下のとおりである。   The completion of Read Command bus transfer of Read bus transfer is as follows.

サイクル−6において、スレーブはRead Dataの準備ができたら、rrdyとrmid[3:0]をアサートしてRead Returnを開始する。rmid[3:0]にはRead Commandでマスタから受けとったMaster IDをのせる。   In cycle-6, when the slave is ready for Read Data, it asserts rrdy and rmid [3: 0] and starts Read Return. In rmid [3: 0], the Master ID received from the master by Read Command is placed.

また、スレーブは、rd_data[31:0]をアサートし、1Beat目のRead Dataを出力する。   Further, the slave asserts rd_data [31: 0] and outputs Read Data of the first beat.

サイクル−7において、rd_data[31:0]に2 beat目のRead Dataを出力する。   In cycle-7, the second beat Read Data is output to rd_data [31: 0].

サイクル−10において、スレーブはrrdyをデアサートする。また、スレーブはrmid[3:0]をデアサートする。   In cycle-10, the slave deasserts rrdy. The slave also deasserts rmid [3: 0].

サイクル−10において、Read Returnは終了する。   In cycle-10, Read Return ends.

マスタがtsをアサートしても、srdyがデアサートされていた場合(サイクル−8,9)はマスタはtsをアサートし続ける。そして、srdyがアサートされると、tsをデアサートする。(サイクル−10)
マスタは、次のバス転送を開始するためにtsの1サイクルのデアサート期間の後、再びアサートすることができる。(サイクル−11)
スレーブは、さらにReturnすべきDataがある場合は、次のRead Returnを開始するためにrrdyを連続してアサートすることができる。(サイクル−16)
Readバス転送が連続した場合には、リードデータバス上で間隔を空けずにDataをReadし続けることができる。
Even if the master asserts ts, if srdy is deasserted (cycles -8, 9), the master continues to assert ts. When srdy is asserted, ts is deasserted. (Cycle-10)
The master can assert again after a one-cycle deassertion period of ts to initiate the next bus transfer. (Cycle-11)
The slave can continuously assert rrdy to start the next Read Return when there is more Data to Return. (Cycle-16)
When the read bus transfer is continued, it is possible to continue reading data without leaving an interval on the read data bus.

次に、実際の動作を例に挙げて本発明の一実施例の説明を行う。   Next, an embodiment of the present invention will be described by taking an actual operation as an example.

図14は図9においてプロセッサ901、プリンタコントローラ906が同時にメモリコントローラ902からリードを行う場合のタイミングチャートを示したものである。物理アドレスとメモリデバイスのバンクアドレス、ロウアドレス、カラムアドレスとの対応は図15に示すとおりである。   FIG. 14 shows a timing chart when the processor 901 and the printer controller 906 in FIG. 9 simultaneously read from the memory controller 902. The correspondence between the physical address and the bank address, row address, and column address of the memory device is as shown in FIG.

以下、プロセッサ901をマスタ1、プリンタコントローラ906をマスタ2、メモリコントローラ902をスレーブと呼ぶ。   Hereinafter, the processor 901 is called a master 1, the printer controller 906 is called a master 2, and the memory controller 902 is called a slave.

また本実施例においては、マスタ2に対しマスタ1より高いプライオリティが与えられている。本実施例においては、このプライオリティの与え方について詳細には説明しないが、予め固定で設定されても良いし、実行時に動的に指定できるように構成しても良い。   In this embodiment, the master 2 is given higher priority than the master 1. In the present embodiment, the method of giving priority will not be described in detail, but it may be fixed in advance or configured so that it can be dynamically specified at the time of execution.

図14において、初めにマスタ1が転送を開始する(サイクル1)。スレーブはsrdyをアサートし、このコマンドを受け付ける。アドレスは0x00000400番地である。紙面の都合で図示されないが、このコマンドはリード(rd_not_wr=1)であり、かつ8ビート(b_size=0111)である。同時にマスタ2が転送を開始する(サイクル2)。スレーブはsrdyをアサートし、このコマンドを受け付ける(サイクル4)。アドレスは0x00037bfc番地である。このコマンドも8ビートのリードコマンドである。   In FIG. 14, first, the master 1 starts transfer (cycle 1). The slave asserts srdy and accepts this command. The address is 0x00004000. Although not shown due to space limitations, this command is read (rd_not_wr = 1) and 8 beats (b_size = 0111). At the same time, the master 2 starts transfer (cycle 2). The slave asserts srdy and accepts this command (cycle 4). The address is address 0x00037bfc. This command is also an 8-beat read command.

メモリコントローラ902は、前記リードコマンドを受け付けると一旦コマンドキュー(図1の702)に格納する。ここでバンク衝突の判定を行う。この例ではマスタ1、マスタ2のメモリアクセスともバンク衝突がないので受け付けた順にメモリ904に対しアクセスを行う。もしマスタ1のメモリアクセスがバンク衝突を起こしており、マスタ2のメモリアクセスがバンク衝突を起こさないのであれば、マスタ2のメモリアクセス要求が先に処理される。   When the memory controller 902 accepts the read command, it temporarily stores it in the command queue (702 in FIG. 1). Here, the bank collision is judged. In this example, since there is no bank collision in the memory access of the master 1 and the master 2, the memory 904 is accessed in the accepted order. If the memory access of the master 1 causes a bank collision and the memory access of the master 2 does not cause a bank collision, the memory access request of the master 2 is processed first.

さて、本実施例においては、システムバスは32ビットで構成されているので、マスタはシステムバス上では32ビット単位でのアクセスを行う。メモリ904のバス幅は64ビットであるから、システムバス上の8ビート転送に対応し、メモリコントローラ902はメモリ904に対して4ビートリードアクセスを発行し、そのリード結果を32ビット毎にマスタに返すよう動作する。   In the present embodiment, since the system bus is composed of 32 bits, the master performs access in units of 32 bits on the system bus. Since the bus width of the memory 904 is 64 bits, it corresponds to 8-beat transfer on the system bus, and the memory controller 902 issues 4-beat read access to the memory 904, and the read result is sent to the master every 32 bits. Operates to return.

ここでメモリ904がDDR SDRAMにより構成されていることに注意する必要がある。すなわちメモリ904に対する2ビートのアクセスはシステムバスクロックの1クロックでデータが転送される。   Here, it should be noted that the memory 904 is composed of DDR SDRAM. That is, in the 2-beat access to the memory 904, data is transferred by one system bus clock.

また、DDRメモリは同一デバイスの同一ページ、あるいは同一デバイスの別バンクに存在するページに対するアクセスは連続したサイクルで行うことができる。   In the DDR memory, access to the same page of the same device or a page existing in another bank of the same device can be performed in a continuous cycle.

いま、マスタ1の最初のリード要求のアドレスである0x00000400番地とマスタ2の最初のリード要求のアドレスである0x00037bfc番地は同一デバイス(同一チップセレクト)でかつ別のバンクに存在するページに存在する。従って、これらのページへのアクセスは連続したサイクルで行うことができる。   Now, the address 0x00004000 which is the address of the first read request of the master 1 and the address 0x00037bfc which is the address of the first read request of the master 2 are in the same device (same chip select) and in pages existing in different banks. Therefore, these pages can be accessed in a continuous cycle.

図16にこのときのシステムバスとメモリバス上でのタイミングの関係を示す。   FIG. 16 shows the timing relationship on the system bus and the memory bus at this time.

図16において本発明の一実施例に係るメモリコントローラ902は、最初にマスタ1からの8ビート(32ビット×8=256ビット)のアクセスに対し、サイクル4においてメモリ904に対しリードコマンドを発行する。メモリバス上では64ビット×4ビートの転送が行われ、読み出されたデータは一旦前記リードデータバッファ704(図1)に格納される(サイクル8〜サイクル11)。それと共に準備のできたデータから32ビットづつ順にマスタ1に返される(サイクル9〜サイクル12)。   In FIG. 16, the memory controller 902 according to one embodiment of the present invention first issues a read command to the memory 904 in cycle 4 in response to an 8-beat (32 bits × 8 = 256 bits) access from the master 1. . Transfer of 64 bits × 4 beats is performed on the memory bus, and the read data is temporarily stored in the read data buffer 704 (FIG. 1) (cycle 8 to cycle 11). At the same time, the prepared data is returned to the master 1 in order of 32 bits (cycle 9 to cycle 12).

この間、メモリコントローラ902は後続のマスタ2からの8ビート(32ビット×8=256ビット)のアクセスを処理するため、サイクル8においてメモリ904に対し再度リードコマンドを発行する。これにより、メモリバス上では前回の転送に引き続き64ビット×4ビートの転送が行われる(サイクル12〜サイクル15)。このとき、マスタ1に対しマスタ2の優先度が高いため、サイクル12において最初のリードデータが読み出されると、メモリコントローラ902はマスタ1へのリードリターンを中断し、サイクル13からマスタ2に対してリードデータを返すように動作する。マスタ2に対する8ビートのリードリターンが全て終了すると、メモリコントローラ902はサイクル21よりマスタ1へのリードリターンを再開する。すなわち、本実施例では、複数の要求元(マスタ1、2)からのリード要求に従ってメモリ904にアクセスした結果のリードデータをリードデータバッファ704に格納し、リードバッファ704からリードデータを複数の要求元(マスタ1、2)に設定された優先度に従った順番で転送する。また、コマンドキュー702には、受け付けたリード要求を順に格納し、コマンドキュー702からバンク衝突を回避するようにコマンドを取り出しメモリ904にアクセスする。   During this time, the memory controller 902 issues a read command to the memory 904 again in cycle 8 in order to process an access of 8 beats (32 bits × 8 = 256 bits) from the subsequent master 2. As a result, a transfer of 64 bits × 4 beats is performed on the memory bus subsequent to the previous transfer (cycle 12 to cycle 15). At this time, since the priority of the master 2 is higher than that of the master 1, when the first read data is read in the cycle 12, the memory controller 902 interrupts the read return to the master 1, and from the cycle 13 to the master 2 Operates to return read data. When all the 8-beat read / return operations for the master 2 are completed, the memory controller 902 resumes the read / return operation to the master 1 from the cycle 21. That is, in this embodiment, read data obtained as a result of accessing the memory 904 in accordance with read requests from a plurality of request sources (masters 1 and 2) is stored in the read data buffer 704, and read data is read from the read buffer 704 by a plurality of requests. Transfer in the order according to the priority set in the original (master 1, 2). In addition, the received read requests are sequentially stored in the command queue 702, and a command is extracted from the command queue 702 so as to avoid a bank collision, and the memory 904 is accessed.

以上に示される通り、マスタ2に対する最初のリードリターンデータは、マスタ1のアクセス要求に対する全てのリードリターンが完了する前に(サイクル17以前)、最初のリードリターンデータが返されることになる。   As described above, the first read return data for the master 2 is returned before all the read returns for the access request of the master 1 are completed (before the cycle 17).

このようにして、本発明の第2の実施例においては、システムLSI内部の複数のマスタからメモリアクセス要求が競合した場合にも、メモリのアクセス効率を低下させることなく、それと同時に優先度の高いマスタのメモリアクセスレイテンシの増加を抑えることが可能となる。   As described above, in the second embodiment of the present invention, even when memory access requests from a plurality of masters in the system LSI compete with each other, the memory access efficiency is not lowered, and at the same time, the priority is high. An increase in the memory access latency of the master can be suppressed.

以上において、本発明が特定の実施例に関して図示されかつ説明されたが、さらに他の修正および改善が可能である。   Although the present invention has been shown and described with respect to particular embodiments, further modifications and improvements are possible.

例えば、本発明の第2の実施例においては、システムバスとして特定の信号、プロトコルを備えるバスを使用する場合について説明したが、もちろんこれに限定するものではなく、任意のバスをシステムバスとして利用し構成しても良い。また、必要に応じてメモリコントローラのバスインターフェースを複数持つように構成しても良い。   For example, in the second embodiment of the present invention, the case where a bus having a specific signal and protocol is used as the system bus has been described. However, the present invention is not limited to this, and an arbitrary bus is used as the system bus. It may be configured. Further, a plurality of memory controller bus interfaces may be provided as necessary.

また例えば、本発明の第2の実施例においては、説明の簡単のため、マスタ間の優先度の設定方法については詳細には説明しなかったが、例えばプライオリティ信号を備えるシステムバスを利用して、転送単位で優先度を与えるようにしても良い。   Also, for example, in the second embodiment of the present invention, the method for setting the priority between masters has not been described in detail for the sake of simplicity. For example, a system bus having a priority signal is used. Alternatively, priority may be given in units of transfer.

また例えば、本発明の第1、第2の実施例においては、メモリデバイスとしてDDR SDRAMを用いる場合を例にとって説明したが、もちろんこれに限定されるものではない。   For example, in the first and second embodiments of the present invention, the case where a DDR SDRAM is used as a memory device has been described as an example, but the present invention is not limited to this.

また例えば、本発明の第2の実施例においては、メモリデバイスにアクセスする際のビート長が8である場合について説明したが、任意のビート長について適用できる。   Further, for example, in the second embodiment of the present invention, the case where the beat length when accessing the memory device is 8 has been described, but any beat length can be applied.

したがって、本発明は前述の実施例に示された特定の形式に限定されるものではなく、かつ添付の特許請求の範囲において本発明の精神および範囲から離れることのない全ての修正をカバーすることを考えていることが理解されるべきである。   Accordingly, the invention is not limited to the specific forms shown in the foregoing embodiments, and covers all modifications that do not depart from the spirit and scope of the invention in the appended claims. It should be understood that

本発明の第1の実施例におけるメモリコントローラの構成を説明する図である。It is a figure explaining the structure of the memory controller in 1st Example of this invention. 従来例の一構成例を説明する図である。It is a figure explaining one structural example of a prior art example. 組み込み機器の複合動作シーケンスを説明する図である。It is a figure explaining the composite operation | movement sequence of an embedded device. 従来例におけるメモリの使用法を説明する図である。It is a figure explaining the usage method of the memory in a prior art example. 本発明の第1の実施例におけるシステムバスのプロトコルを説明する図である。It is a figure explaining the protocol of the system bus | bath in 1st Example of this invention. 本発明の第1の実施例におけるシステムバスのプロトコルを説明する図である。It is a figure explaining the protocol of the system bus | bath in 1st Example of this invention. 従来例の一構成例を説明する図である。It is a figure explaining one structural example of a prior art example. 本発明の第1の実施例のシステム構成を説明する図である。It is a figure explaining the system configuration | structure of the 1st Example of this invention. 本発明の第1の実施例のシステムLSIを説明する図である。It is a figure explaining the system LSI of 1st Example of this invention. 本発明の第1の実施例におけるシステムバス上の動作タイミングを説明する図である。It is a figure explaining the operation timing on the system bus in the 1st example of the present invention. 本発明の第1の実施例におけるシステムバス上およびメモリバス上の動作タイミングを説明する図である。It is a figure explaining the operation timing on a system bus and a memory bus in the 1st example of the present invention. 本発明の一実施例におけるシステムバスのプロトコルを説明する図である。It is a figure explaining the protocol of the system bus in one Example of this invention. 本発明の一実施例におけるシステムバスのプロトコルを説明する図である。It is a figure explaining the protocol of the system bus in one Example of this invention. 本発明の一実施例におけるシステムバス上の動作タイミングを説明する図である。It is a figure explaining the operation timing on the system bus in one Example of this invention. 物理アドレスとバンクアドレス、ロウアドレス、カラムアドレスの関係の一例を説明する図である。It is a figure explaining an example of the relationship between a physical address, a bank address, a row address, and a column address. 本発明の一実施例におけるシステムバス上およびメモリバス上の動作タイミングを説明する図である。It is a figure explaining the operation timing on a system bus and a memory bus in one example of the present invention.

Claims (9)

複数の要求元からの複数のリード要求を受信する受信手段と、
前記受信手段により受信したリード要求に従ってメモリにアクセスするアクセス手段と、
前記アクセス手段によってアクセスした結果のリードデータを格納する格納手段と、
前記格納手段に格納しているリードデータを、当該リードデータを要求した要求元へ転送する転送手段とを有し、
前記転送手段による第1の要求元へのデータ転送中に、前記格納手段が前記第1の要求元よりも優先度の高い第2の要求元へのリードデータを格納すると、前記転送手段は前記第1の要求元へのデータ転送を中断し前記第2の要求元へのデータ転送を開始することを特徴とするメモリ制御装置。
Receiving means for receiving a plurality of read requests from a plurality of request sources ;
Access means for accessing the memory according to the read request received by the receiving means ;
Storage means for storing read data as a result of access by the access means;
Transfer means for transferring the read data stored in the storage means to the request source that requested the read data;
During the data transfer to the first request source by the transfer means , the storage means stores the read data to the second request source having a higher priority than the first request source. A memory control device, wherein data transfer to a first request source is interrupted and data transfer to the second request source is started .
前記複数のリード要求を受け付け順に格納するコマンドキューを更に備え、前記アクセス手段は、バンク衝突を回避するように前記コマンドキューからコマンドを取り出し前記メモリにアクセスすることを特徴とする請求項1に記載のメモリ制御装置。2. The command queue according to claim 1, further comprising a command queue for storing the plurality of read requests in the order of acceptance, wherein the access unit retrieves a command from the command queue and accesses the memory so as to avoid a bank collision. Memory controller. 複数の要求元からの複数のリード要求を受信する受信工程と、
前記受信工程で受信したリード要求に従ってメモリにアクセスするアクセス工程と、
前記アクセス工程でアクセスした結果のリードデータを格納する格納工程と
前記格納工程で格納したリードデータを、当該リードデータを要求した要求元へ転送する転送工程とを有し、
前記転送工程において、第1の要求元へのデータ転送中に前記第1の要求元よりも優先度の高い第2の要求元へのリードデータを格納すると、前記第1の要求元へのデータ転送を中断し前記第2の要求元へのデータ転送を開始することを特徴とするメモリ制御方法。
Receiving a plurality of read requests from a plurality of request sources ;
An access step of accessing the memory according to the read request received in the reception step ;
A storage step of storing read data as a result of access in the access step ;
A transfer step of transferring the read data stored in the storage step to a request source that requested the read data;
In the transfer step, if read data to a second request source having a higher priority than the first request source is stored during data transfer to the first request source, data to the first request source is stored. A memory control method characterized by interrupting transfer and starting data transfer to the second request source .
メモリコントローラと、システムバスと、メモリとを備える組み込み機器であって、
前記メモリコントローラは、複数の要求元からの複数のリード要求を受信する受信手段と、前記受信手段により受信したリード要求に従ってメモリにアクセスするアクセス手段と、前記アクセス手段によってアクセスした結果のリードデータを一時格納するバッファ、前記バッファに格納しているリードデータを、当該リードデータを要求した要求元へ転送する転送手段とを有し、前記転送手段による第1の要求元へのデータ転送中に、前記バッファが前記第1の要求元よりも優先度の高い第2の要求元へのリードデータを格納すると、前記転送手段は前記第1の要求元へのデータ転送を中断し前記第2の要求元へのデータ転送を開始することを特徴とする組み込みシステム
An embedded device including a memory controller, a system bus, and a memory,
The memory controller includes: a receiving unit that receives a plurality of read requests from a plurality of request sources; an access unit that accesses a memory in accordance with the read request received by the receiving unit; and read data obtained as a result of accessing by the access unit A buffer for temporarily storing; and a transfer means for transferring the read data stored in the buffer to the request source that requested the read data. During the data transfer to the first request source by the transfer means When the buffer stores the read data to the second request source having a higher priority than the first request source, the transfer means interrupts the data transfer to the first request source, and the second request source Embedded system characterized by initiating data transfer to the requester .
前記メモリコントローラは受け付けたリード要求を順に格納するコマンドキューを更に備え、前記アクセス手段はバンク衝突を回避するように前記コマンドキューからコマンドを取り出し前記メモリにアクセスすることを特徴とする請求項4に記載の組み込みシステム。5. The memory controller according to claim 4, further comprising a command queue for sequentially storing received read requests, wherein the access means takes out a command from the command queue and accesses the memory so as to avoid a bank collision. The described embedded system. 前記システムバスは、バスマスタの識別子をスレーブに転送し、スレーブはバスマスタにリードデータを返す際に前記バスマスタの識別子とともに返すことを特徴とする請求項4に記載の組み込みシステム。5. The embedded system according to claim 4, wherein the system bus transfers an identifier of the bus master to the slave, and the slave returns the identifier together with the identifier of the bus master when returning read data to the bus master. 前記メモリがDDR SDRAMにより構成されることを特徴とする請求項4に記載の組み込みシステム。The embedded system according to claim 4, wherein the memory is constituted by a DDR SDRAM. 前記システムバスは、マルチレイヤ構造であることを特徴とする請求項4に記載の組み込みシステム。The embedded system according to claim 4, wherein the system bus has a multilayer structure. 前記メモリコントローラおよびシステムバスは一つのシステムLSIに内蔵されていることを特徴とする請求項4に記載の組み込みシステム。5. The embedded system according to claim 4, wherein the memory controller and the system bus are built in one system LSI.
JP2006166204A 2005-07-14 2006-06-15 Memory control device, memory control method, and embedded system Expired - Fee Related JP5094050B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006166204A JP5094050B2 (en) 2005-07-14 2006-06-15 Memory control device, memory control method, and embedded system

Applications Claiming Priority (5)

Application Number Priority Date Filing Date Title
JP2005205708 2005-07-14
JP2005205708 2005-07-14
JP2005205707 2005-07-14
JP2005205707 2005-07-14
JP2006166204A JP5094050B2 (en) 2005-07-14 2006-06-15 Memory control device, memory control method, and embedded system

Publications (3)

Publication Number Publication Date
JP2007048274A JP2007048274A (en) 2007-02-22
JP2007048274A5 JP2007048274A5 (en) 2009-07-16
JP5094050B2 true JP5094050B2 (en) 2012-12-12

Family

ID=37851014

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006166204A Expired - Fee Related JP5094050B2 (en) 2005-07-14 2006-06-15 Memory control device, memory control method, and embedded system

Country Status (1)

Country Link
JP (1) JP5094050B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10353747B2 (en) 2015-07-13 2019-07-16 Futurewei Technologies, Inc. Shared memory controller and method of using same

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01191964A (en) * 1988-01-27 1989-08-02 Nec Corp Transfer method for memory bus data
JP4313456B2 (en) * 1999-03-04 2009-08-12 パナソニック株式会社 Memory control device
JP2001318906A (en) * 2000-05-08 2001-11-16 Mitsubishi Electric Corp Multiprocessor device
JP2002123420A (en) * 2000-10-13 2002-04-26 Matsushita Electric Ind Co Ltd Memory access device

Also Published As

Publication number Publication date
JP2007048274A (en) 2007-02-22

Similar Documents

Publication Publication Date Title
US7716387B2 (en) Memory control apparatus and method
JP3524337B2 (en) Bus management device and control device for multifunction device having the same
JP2004171209A (en) Shared memory data transfer device
US6697898B1 (en) Information processing system for composite appliance
JP2000211216A (en) Information processing method and system for composite device
JP2000211210A (en) Method and apparatus for control of composite device
JP3976927B2 (en) Bus control device
JP3444154B2 (en) Memory access control circuit
JP2000148650A (en) Controller for composite equipment
US6738837B1 (en) Digital system with split transaction memory access
JP2004118252A (en) Semiconductor data processor
JP2000215149A (en) Controller for composite device
JP3803196B2 (en) Information processing apparatus, information processing method, and recording medium
JP5094050B2 (en) Memory control device, memory control method, and embedded system
US5517624A (en) Multiplexed communication protocol between central and distributed peripherals in multiprocessor computer systems
JP7468112B2 (en) INTERFACE CIRCUIT AND METHOD FOR CONTROLLING INTERFACE CIRCUIT - Patent application
JP2007108882A (en) Memory controller, memory-controlling method, and information processing device
JP2004046851A (en) Bus management device, and controller for composite apparatus including the same
JP3425421B2 (en) Multiprocessor system
JP3206656B2 (en) Prefetch device and prefetch method on bus
JP4136163B2 (en) Data input / output device and controller of data input / output device
JP2000215156A (en) Information processing system of hybrid equipment
JPH11212903A (en) Data processing system, peripheral device and microcomputer
JP2000215157A (en) Bus controller
JP2006155220A (en) Semiconductor integrated circuit and access control method therefor

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090603

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090603

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20100201

RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20100630

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120207

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120214

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120416

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: 20120911

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120918

R151 Written notification of patent or utility model registration

Ref document number: 5094050

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150928

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees