JP2009217310A - Memory access method and memory access device - Google Patents

Memory access method and memory access device Download PDF

Info

Publication number
JP2009217310A
JP2009217310A JP2008057324A JP2008057324A JP2009217310A JP 2009217310 A JP2009217310 A JP 2009217310A JP 2008057324 A JP2008057324 A JP 2008057324A JP 2008057324 A JP2008057324 A JP 2008057324A JP 2009217310 A JP2009217310 A JP 2009217310A
Authority
JP
Japan
Prior art keywords
data
write buffer
write
shared memory
memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2008057324A
Other languages
Japanese (ja)
Inventor
Keisuke Aono
啓介 青野
Masanori Kubota
政典 久保田
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.)
Victor Company of Japan Ltd
Original Assignee
Victor Company of Japan Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Victor Company of Japan Ltd filed Critical Victor Company of Japan Ltd
Priority to JP2008057324A priority Critical patent/JP2009217310A/en
Publication of JP2009217310A publication Critical patent/JP2009217310A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To perform burst transfer from a write buffer to a memory in write cycles fewer than a conventional manner. <P>SOLUTION: A bus master 11 writes an address, a byte mask, and write data in a write buffer 12. The write buffer control unit 13 determines data to be transferred to a shared memory 20 based on the state of a byte mask output to be output from the write buffer 12, and controls a register update control signal. Thus, data to be transferred to the shared memory 20 are set in a register 14. When the data transfer to the shared memory 20 is started, the write buffer control unit 13 controls a selector control signal, and causes a selector 15 to select data with no byte mask set thereto and stored in the register 14, and performs burst transfer through a shared bus 40 to the shared memory 20. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明はメモリアクセス方法及びメモリアクセス装置に係り、特にバイトマスク機能を用いたメモリの書き込みを可能にするメモリアクセス方法及びメモリアクセス装置に関する。   The present invention relates to a memory access method and a memory access device, and more particularly to a memory access method and a memory access device that enable memory writing using a byte mask function.

従来、中央処理装置(CPU:Central Processing Unit)がメモリにデータを書き込むメモリアクセス方法では、CPUとメモリとの間に書き込みバッファを設け、CPUはその書き込みバッファに、ライトアドレス、ライトデータ、バイトマスクデータを一旦書き込み、その後、書き込みバッファ制御ユニットが、メモリへの書き込み動作を行っている。   Conventionally, in a memory access method in which a central processing unit (CPU) writes data to a memory, a write buffer is provided between the CPU and the memory, and the CPU includes a write address, write data, and a byte mask. Data is once written, and then the write buffer control unit performs a write operation to the memory.

また、書き込みバッファ制御ユニットが、CPUが複数回に渡って書き込みバッファに書き込んだデータをひとまとめにしてメモリにバースト転送するメモリアクセス方法も従来知られている(例えば、特許文献1参照)。   In addition, a memory access method in which the write buffer control unit burst-transfers data written to the write buffer a plurality of times by the CPU to the memory is also known (see, for example, Patent Document 1).

この特許文献1記載のメモリアクセス方法による、共有メモリアーキテクチャ(UMA:Unified Memory Architecture)のシステムにおける書き込みバッファから共有メモリへのバースト転送による書き込みアクセス動作について図7と共に説明する。   A write access operation by burst transfer from a write buffer to a shared memory in a shared memory architecture (UMA) system by the memory access method described in Patent Document 1 will be described with reference to FIG.

共有メモリがデータバス幅32ビットのSDR SDRAM(Single Data Rate Synchronous Dynamic Random Access Memory)であるとする。図7(A)は、SDRAMの動作クロックCLK、同図(B)は、SDRAMを制御するコマンド信号を示す。このコマンド信号は、CS(Chip Select)、RAS(Row Address Strobe)、CAS(Cas Address Strobe)、WE(Write Enable)からなる。   Assume that the shared memory is an SDR SDRAM (Single Data Rate Synchronous Dynamic Random Access Memory) having a data bus width of 32 bits. FIG. 7A shows an operation clock CLK of the SDRAM, and FIG. 7B shows a command signal for controlling the SDRAM. This command signal includes CS (Chip Select), RAS (Row Address Strobe), CAS (Cas Address Strobe), and WE (Write Enable).

また、図7(B)において、コマンドバス上の「ACT」はACTIVEコマンド、「WRITEa」、「WRITEb」は、それぞれWRITEコマンドを表す。また、図7(C)は、バイトマスクのデータDQMを示し、同図(D)はデータバスのデータDQを示す。これらのコマンド信号、DQM、DQの各値は、クロックCLKの立ち上がりでSDRAMに取り込まれる。   In FIG. 7B, “ACT” on the command bus represents an ACTIVE command, and “WRITEa” and “WRITEb” represent WRITE commands. FIG. 7C shows byte mask data DQM, and FIG. 7D shows data bus data DQ. These command signals, DQM, and DQ values are taken into the SDRAM at the rising edge of the clock CLK.

共有メモリであるSDRAMへのバースト転送モードを、例えばBL(Burst Length)=4に設定する。CPUは、まず、図7(B)に示すように、ACTコマンドを発行し、3サイクル後にWRITEaコマンドを発行して4サイクル期間DQM、DQを制御する。続いて、WRITEbコマンドを発行し、4サイクル期間DQM、DQを制御する。通常のSDRAMアクセスではPRE(Precharge)コマンドが続くが、ここでは割愛する。また、WRITEaとWRITEbでアクセスする行アドレス(ロウアドレス)は、同一の場合である。この動作では、ACTからWRITE動作完了までに11サイクル必要である。   The burst transfer mode to SDRAM which is a shared memory is set to BL (Burst Length) = 4, for example. First, as shown in FIG. 7B, the CPU issues an ACT command, and after 3 cycles, issues a WRITEa command to control the 4-cycle periods DQM and DQ. Subsequently, a WRITEb command is issued to control the DQM and DQ during the 4-cycle period. In normal SDRAM access, a PRE (Precharge) command continues, but is omitted here. The row addresses (row addresses) accessed by WRITEa and WRITEb are the same. In this operation, 11 cycles are required from the ACT to the completion of the WRITE operation.

図8は、この従来のメモリアクセス方法によるシーケンス図を示す。このシーケンス図は、共有メモリ50が共有バスを介してCPU内のバスマスタ51及び周辺バスマスタ52に接続されたシステムである。バスマスタ51が図示しない書き込みバッファからデータを読み出して、共有バスを介して共有メモリ50にバースト転送して書き込む(図8に53で示す)。   FIG. 8 shows a sequence diagram according to this conventional memory access method. This sequence diagram is a system in which a shared memory 50 is connected to a bus master 51 and a peripheral bus master 52 in a CPU via a shared bus. The bus master 51 reads data from a write buffer (not shown) and burst-transfers and writes the data to the shared memory 50 via the shared bus (denoted by 53 in FIG. 8).

その後、周辺バスマスタ52が、書き込みバッファからデータを読み出して、共有バスを介して共有メモリ50にバースト転送して書き込む(図8に54で示す)。この例では、バスマスタ51がバースト転送してから、転送待ち時間T1経過してから周辺バスマスタ52がバースト転送を行う。   Thereafter, the peripheral bus master 52 reads the data from the write buffer, writes the data by burst transfer to the shared memory 50 via the shared bus (indicated by 54 in FIG. 8). In this example, the peripheral bus master 52 performs burst transfer after the transfer waiting time T1 elapses after the bus master 51 performs burst transfer.

このようにして、CPUがメモリ書き込み完了を待つ時間を短縮し、メモリ転送効率を高める効果を得ている。特に、メモリの動作クロックに比べてCPUの動作クロックが高速であるほど、得られる効果は大きい。   In this way, it is possible to shorten the time that the CPU waits for the completion of memory writing and to increase the memory transfer efficiency. In particular, the faster the CPU operating clock is, the greater the effect obtained.

特開2001−147854号公報JP 2001-147854 A

しかしながら、特に、バスマスタの処理系データ幅に比べて共有バスのバス幅が広く、バスマスタであるCPUが単一、もしくは短いワード数のメモリ書き込み動作を行う場合には、書き換えないデータを保護するためにバイトマスクを多用することになる。これにより、書き込みバッファからメモリへバースト転送する際に、あるライトサイクルにおいて書き込むデータ全てに対してバイトマスクがセットされている、という状況が発生する。このようなライトサイクルは、メモリ内部のデータに一切の変更を加えないことから、本来不要なライトサイクルであり、メモリアクセス効率の面で、好ましくない。   However, in particular, when the bus width of the shared bus is wider than the processing data width of the bus master, and the CPU as the bus master performs a memory write operation with a single or a short number of words, in order to protect data that cannot be rewritten. A lot of byte masks are used. As a result, when burst transfer is performed from the write buffer to the memory, a situation occurs in which a byte mask is set for all data to be written in a certain write cycle. Such a write cycle is an essentially unnecessary write cycle because no change is made to the data in the memory, and is not preferable in terms of memory access efficiency.

例えば、図7と共に説明した従来のメモリアクセス方法では、図7(C)に示すように、DQM[3:0]が0xfとなる期間が合計6サイクル存在しており、ライトサイクルであるにもかかわらず、共有メモリ(SDRAM)のデータ書き換えが発生しないことから、無駄なライトサイクルといえる。   For example, in the conventional memory access method described with reference to FIG. 7, there are a total of 6 cycles in which DQM [3: 0] is 0xf as shown in FIG. Regardless, since data rewriting of the shared memory (SDRAM) does not occur, this is a useless write cycle.

本発明は以上の点に鑑みなされたもので、従来よりも少ないライトサイクル数で書き込みバッファからメモリへのバースト転送を行い得るメモリアクセス方法及びメモリアクセス装置を提供することを目的とする。   The present invention has been made in view of the above points, and an object thereof is to provide a memory access method and a memory access device capable of performing burst transfer from a write buffer to a memory with a smaller number of write cycles than in the prior art.

上記の目的を達成するため、第1の発明は、共有バスを介して共有メモリにデータをバースト転送して書き込むメモリアクセス方法において、バスマスタからデータ、バイトマスク、及びアドレスを書き込みバッファに一旦書き込む第1のステップと、書き込みバッファに書き込まれたデータ及びアドレスを共有メモリにバースト転送する際に、転送するデータが、そのデータに対応するバイトマスクが全て設定されているデータであるか否かを判定する第2のステップと、第2のステップにより、バイトマスクが全て設定されているデータではないと判定されたデータを選択してアドレスと共に共有バスを介して共有メモリへバースト転送する第3のステップとを含むことを特徴とする。   To achieve the above object, according to a first aspect of the present invention, there is provided a memory access method in which data is burst-transferred and written to a shared memory via a shared bus, and the data, byte mask, and address are temporarily written from a bus master to a write buffer. 1 and when the data and address written in the write buffer are burst transferred to the shared memory, it is determined whether or not the data to be transferred is data in which all the byte masks corresponding to the data are set. And a third step of selecting data determined not to have all the byte masks set by the second step and transferring the burst together with the address to the shared memory via the shared bus It is characterized by including.

また、上記の目的を達成するため、第2の発明は、共有バスを介して共有メモリにデータをバースト転送して書き込むメモリアクセス装置において、データ、バイトマスク、及びアドレスを出力するバスマスタと、バスマスタから出力されたデータ、バイトマスク、及びアドレスを一旦書き込む書き込みバッファと、書き込みバッファに書き込まれたデータ及びアドレスを共有メモリにバースト転送する際に、転送するデータが、そのデータに対応するバイトマスクが全て設定されているデータであるか否かを判定する書き込みバッファ制御ユニットと、書き込みバッファ制御ユニットにより、バイトマスクが全て設定されているデータではないと判定されたデータを選択してアドレスと共に共有バスを介して共有メモリへバースト転送する選択手段とを有することを特徴とする。   In order to achieve the above object, the second invention provides a bus master that outputs data, a byte mask, and an address in a memory access device that writes data by burst transfer to a shared memory via a shared bus; The write buffer that temporarily writes the data, byte mask, and address output from the memory, and when the data and address written in the write buffer are burst transferred to the shared memory, the data to be transferred has a byte mask corresponding to the data. A write buffer control unit that determines whether or not all data is set, and a data that is determined not to have all byte masks set by the write buffer control unit, and a shared bus together with an address Burst transfer to shared memory via And having a-option means.

第1及び第2の発明では、バイトマスクが全て設定されているデータは転送せず、バイトマスクが全て設定されているデータではないと判定されたデータを選択して共有メモリへバースト転送するため、共有メモリの内部のデータに一切変更を加えないバイトマスクが全て設定されているデータのライトサイクルを不要にできる。   In the first and second aspects of the invention, data for which all byte masks are set is not transferred, and data determined not to be set for all byte masks is selected for burst transfer to the shared memory. This eliminates the need for a data write cycle in which all the byte masks that do not change the data in the shared memory are set.

本発明によれば、バスマスタがバイトマスクを多用するメモリ書き込みにおいて従来よりも少ないライトサイクル数で、書き込みバッファからメモリへのバースト転送を行うことができ、これによりシステム全体のメモリアクセス効率を向上することもできる。   According to the present invention, burst transfer from the write buffer to the memory can be performed with a smaller number of write cycles than before in memory writing in which the bus master frequently uses byte masks, thereby improving the memory access efficiency of the entire system. You can also.

以下に、本発明の実施の形態について図面と共に詳細に説明する。   Embodiments of the present invention will be described below in detail with reference to the drawings.

図1は本発明になるメモリアクセス装置の一実施の形態のブロック図を示す。このメモリアクセス装置10は、共有メモリ20及び周辺バスマスタ30に共有バス40を介して接続されている。メモリアクセス装置10は、CPUによってバスマスタ11、書き込みバッファ12、書き込みバッファ制御ユニット13、複数のレジスタ14、及びセレクタ15から構成されている。すなわち、バスマスタ11と共有バス40との間に、書き込みバッファ12、書き込みバッファ制御ユニット13を設け、また、書き込みバッファ12と共有メモリ20との間に複数のレジスタ14とセレクタ15とが配置されている。   FIG. 1 shows a block diagram of an embodiment of a memory access apparatus according to the present invention. The memory access device 10 is connected to the shared memory 20 and the peripheral bus master 30 via the shared bus 40. The memory access device 10 includes a bus master 11, a write buffer 12, a write buffer control unit 13, a plurality of registers 14, and a selector 15 by a CPU. That is, the write buffer 12 and the write buffer control unit 13 are provided between the bus master 11 and the shared bus 40, and a plurality of registers 14 and a selector 15 are arranged between the write buffer 12 and the shared memory 20. Yes.

バスマスタ11は、アドレス、データ、バイトマスクの組単位でそれらを書き込みバッファ12に供給する。書き込みバッファ制御ユニット13は、バスマスタ11からデータ書き込み要求信号を受け、データ書き込み承認信号を出力する。また、書き込みバッファ制御ユニット13は、バッファ制御信号を書き込みバッファ12に供給する。書き込みバッファ12は、バイトマスクを書き込みバッファ制御ユニット13に供給し、複数のレジスタ14にそれぞれアドレスとデータを出力する。   The bus master 11 supplies them to the write buffer 12 in units of addresses, data, and byte masks. The write buffer control unit 13 receives a data write request signal from the bus master 11 and outputs a data write approval signal. Further, the write buffer control unit 13 supplies a buffer control signal to the write buffer 12. The write buffer 12 supplies a byte mask to the write buffer control unit 13 and outputs an address and data to a plurality of registers 14, respectively.

複数のレジスタ14は、共有バス40と同じビット幅のレジスタである。セレクタ15は、書き込みバッファ制御ユニット13からのセレクタ制御信号に基づき、これら複数のレジスタ14のうちの1つを共有バス40に接続するためのものである。また、複数のレジスタ14は、書き込みバッファ制御ユニット13からのレジスタ更新制御信号によって更新制御される。   The plurality of registers 14 are registers having the same bit width as the shared bus 40. The selector 15 is for connecting one of the plurality of registers 14 to the shared bus 40 based on a selector control signal from the write buffer control unit 13. The plurality of registers 14 are controlled to be updated by a register update control signal from the write buffer control unit 13.

共有メモリ20は、データの実体を格納するメモリ部としてのSDRAM22と、SDRAM22に対してデータ書き込み制御を行う制御部である共有メモリコントローラ(SDRAMコントローラ)21とからなる。共有メモリコントローラ21は、共有バス40を通じて書き込みバッファ12から出力されるデータを、SDRAM22に書き込む制御を行う。   The shared memory 20 includes an SDRAM 22 as a memory unit that stores data entities, and a shared memory controller (SDRAM controller) 21 that is a control unit that performs data write control on the SDRAM 22. The shared memory controller 21 performs control to write data output from the write buffer 12 through the shared bus 40 to the SDRAM 22.

ここで、共有メモリコントローラ21からSDRAM22へは制御信号(Command)、アドレス信号(Address)、バイトマスク(DQM)が出力される。また、データ(DQ)が共有メモリコントローラ21とSDRAM22との間で転送される。   Here, a control signal (Command), an address signal (Address), and a byte mask (DQM) are output from the shared memory controller 21 to the SDRAM 22. Data (DQ) is transferred between the shared memory controller 21 and the SDRAM 22.

また、バスマスタ11、書き込みバッファ12、書き込みバッファ制御ユニット13、複数のレジスタ14に用いるクロック(CLK)と、共有メモリコントローラ21、SDRAM22に入力するクロック(CLK)とは共通のクロックであり、それらは互いに同期して動作する。   The clock (CLK) used for the bus master 11, the write buffer 12, the write buffer control unit 13, and the plurality of registers 14 and the clock (CLK) input to the shared memory controller 21 and SDRAM 22 are common clocks. Operate in sync with each other.

この実施の形態では、書き込みバッファ12から共有メモリ20へのデータ転送は、バースト転送によって行う。このとき、後述するように、バイトマスクが設定されているデータについては、共有メモリ20にデータ転送しないようにし、書き込みバッファ12から共有メモリ20に転送する処理において、複数のレジスタ14及びセレクタ15によって、転送データを選択して転送データが途切れないようにする。   In this embodiment, data transfer from the write buffer 12 to the shared memory 20 is performed by burst transfer. At this time, as will be described later, the data for which the byte mask is set is not transferred to the shared memory 20 and is transferred from the write buffer 12 to the shared memory 20 by a plurality of registers 14 and selectors 15. The transfer data is selected so that the transfer data is not interrupted.

次に、本実施の形態の動作について、図2のフローチャートを併せ参照して更に詳細に説明する。まず、バスマスタ11は、共有メモリ20へライトアクセスするときに、一旦、書き込みバッファ制御ユニット13と通信を行い、書き込みバッファにアドレス、バイトマスク、ライトデータを書き込む。   Next, the operation of the present embodiment will be described in more detail with reference to the flowchart of FIG. First, when the bus master 11 performs a write access to the shared memory 20, it once communicates with the write buffer control unit 13 to write the address, byte mask, and write data to the write buffer.

すなわち、まず、バスマスタ11は、書き込みバッファ制御ユニット13に対してデータ書き込み要求信号を出力する。これにより、書き込みバッファ制御ユニット13は、書き込みバッファ12に書き込み可能か否かを判断する(ステップS1)。書き込みバッファ制御ユニット13は、書き込みバッファ12に書き込み可能であると判断すると、バスマスタ11に対してデータ書き込み承認信号を出力する。   That is, first, the bus master 11 outputs a data write request signal to the write buffer control unit 13. Thereby, the write buffer control unit 13 determines whether or not writing to the write buffer 12 is possible (step S1). When the write buffer control unit 13 determines that data can be written to the write buffer 12, it outputs a data write approval signal to the bus master 11.

バスマスタ11は、このデータ書き込み承認信号を入力として受けると、1ワード分のアドレス、バイトマスク、ライトデータを書き込みバッファ12に書き込んだ後(ステップS2)、全データを書き込んだかを判定し(ステップS3)、全データを書き込むまでステップS2とS3の処理を繰り返す。   Upon receiving this data write approval signal as an input, the bus master 11 writes an address, byte mask, and write data for one word into the write buffer 12 (step S2), and then determines whether all data has been written (step S3). ) Repeat steps S2 and S3 until all data is written.

続いて、全データの書き込み完了後、書き込みバッファ制御ユニット13は、バスマスタ11が複数回データの書き込み処理を行うのを待つかどうかを判定し(ステップS4)、複数回の書き込み処理を行うのを待つときはステップS1の処理に戻り、待たないときは書き込みバッファ12から共有メモリ20へのデータ転送が可能かどうかを判断する(ステップS5)。   Subsequently, after all the data has been written, the write buffer control unit 13 determines whether or not to wait for the bus master 11 to perform data write processing a plurality of times (step S4), and performs the plurality of write processing. When waiting, the process returns to step S1, and when not waiting, it is determined whether data transfer from the write buffer 12 to the shared memory 20 is possible (step S5).

書き込みバッファ制御ユニット13は、ステップS5で書き込みバッファ12から共有メモリ20へのデータ転送が可能と判断すると、まず、バッファ制御信号を制御し、書き込みバッファ12から出力されるバイトマスク出力とデータ出力とを更新した後、更新したバイトマスク出力の状態をもとに、どのデータを共有メモリ20に転送するかを判断し、レジスタ更新制御信号を制御する。これにより、共有メモリ20へ転送されるデータがレジスタ14にセットされる。そして、書き込みバッファ制御ユニット13は、共有メモリ20へのデータ転送が始まると、セレクタ制御信号を制御してレジスタ14に格納されているバイトマスクが設定されないデータをセレクタ15により1ワード選択させ、それを共有バス40を介して共有メモリ20へ転送する(ステップS6)。   When the write buffer control unit 13 determines in step S5 that data transfer from the write buffer 12 to the shared memory 20 is possible, the write buffer control unit 13 first controls the buffer control signal, and outputs the byte mask output and data output output from the write buffer 12. Then, based on the updated byte mask output state, it is determined which data is transferred to the shared memory 20, and the register update control signal is controlled. As a result, data transferred to the shared memory 20 is set in the register 14. Then, when the data transfer to the shared memory 20 starts, the write buffer control unit 13 controls the selector control signal to cause the selector 15 to select one word of data for which the byte mask stored in the register 14 is not set. Is transferred to the shared memory 20 via the shared bus 40 (step S6).

続いて、書き込みバッファ制御ユニット13は、書き込みバッファ12に用意した全データの転送が完了したかを判定し(ステップS7)、全データの転送が完了するまでステップS6とS7の処理を繰り返す。このとき、書き込みバッファ制御ユニット13は、レジスタ14に格納されたデータの残量を確認し、バースト転送が途切れる前に、バッファ制御信号とレジスタ更新制御信号とを制御し、レジスタ14のデータ更新及びバイトマスク出力の取得を行う。   Subsequently, the write buffer control unit 13 determines whether or not the transfer of all data prepared in the write buffer 12 is completed (step S7), and repeats the processes of steps S6 and S7 until the transfer of all data is completed. At this time, the write buffer control unit 13 checks the remaining amount of data stored in the register 14 and controls the buffer control signal and the register update control signal before the burst transfer is interrupted. Get byte mask output.

このようにして、書き込みバッファ12の中の用意した全データの転送が完了すると、データ転送処理を終了し、バスマスタ11から書き込みバッファ12へのデータ書込み制御処理に移る。   In this way, when the transfer of all the prepared data in the write buffer 12 is completed, the data transfer process is terminated, and the process proceeds to a data write control process from the bus master 11 to the write buffer 12.

図3は、書き込みバッファ制御ユニット13が、図2のステップS4でバスマスタ11が2回の書き込み動作を終えるのを待つように判定した場合の、シーケンス図を示す。図3に示すように、バスマスタ11が1回目のメモリ書き込みアクセスと、2回目のメモリ書き込みアクセスとを書き込みバッファ制御ユニット13に順次に行うのを待ってから(ステップS11、S12)、書き込みバッファ制御ユニット13は、書き込みバッファ12に書き込まれた、アドレス、データ、バイトマスクのうちのアドレスとデータをまとめて共有メモリ20へ転送する(ステップS13;図2のステップS5〜S7)。   FIG. 3 shows a sequence diagram when the write buffer control unit 13 determines to wait for the bus master 11 to finish the two write operations in step S4 of FIG. As shown in FIG. 3, after waiting for the bus master 11 to sequentially perform the first memory write access and the second memory write access to the write buffer control unit 13 (steps S11 and S12), the write buffer control is performed. The unit 13 collectively transfers the address and data of the address, data, and byte mask written in the write buffer 12 to the shared memory 20 (step S13; steps S5 to S7 in FIG. 2).

次に、書き込みバッファ12のデータ格納構成を説明する。書き込みバッファ12に格納する内容は、アドレス、バイトマスク、データを1セットとし、1ワード以上のサイズとする(アドレスについては、本発明の対象外である)。   Next, the data storage configuration of the write buffer 12 will be described. The contents stored in the write buffer 12 are a set of addresses, byte masks, and data, and have a size of one word or more (the addresses are outside the scope of the present invention).

図1に示す本実施の形態の構成のうち、共有バス40のデータバス幅を128ビット、バイトマスクを16ビットとすると、バイトマスク1ビットにつき8ビット(=1バイト)のデータについて、書き込みバッファ制御ユニット13は、共有メモリ20への書き込みを行うか行わないかを制御する。ここで、バイトマスクの値が「1」のとき「データを書き込まない」、値が「0」のとき「データを書き込む」とする。なお、バイトマスクの値が「1」であるということは、そのバイトマスクに対応するデータにバイトマスクが設定されている(全てセットされている)ということを意味する。また、バイトマスクの値が「0」であるということは、そのバイトマスクに対応するデータにバイトマスクが設定されていない(全てはセットされていない)ということを意味する。   In the configuration of the present embodiment shown in FIG. 1, if the data bus width of the shared bus 40 is 128 bits and the byte mask is 16 bits, the write buffer for data of 8 bits (= 1 byte) per 1 byte mask. The control unit 13 controls whether to write to the shared memory 20 or not. Here, when the value of the byte mask is “1”, “data is not written”, and when the value is “0”, “data is written”. Note that a byte mask value of “1” means that a byte mask is set (all set) for data corresponding to the byte mask. The byte mask value of “0” means that no byte mask is set for the data corresponding to the byte mask (all are not set).

バスマスタ11が32ビット処理系のCPUの場合、単一ワードのライトアクセスを2回行ったとき、書き込みバッファ12の内容は、図4のようになる。バスマスタ11の1回目のメモリ書き込みアクセスでは、書き込みバッファ12の図4中の書き込まれたデータDa0、Da1、Da2、Da3にそれぞれ対応するバイトマスクのうち、Da0に対応するバイトマスクのみ値が「0」で、Da0〜Da3に対応するバイトマスクの値は「1」である。従って、バスマスタ11の1回目のメモリ書き込みアクセスでは、Da0のデータを書き込もうとしている。一方、データDa1〜Da3は、データバスに出力されるが、値が「1」であるバイトマスクによって共有メモリ20には書き込まれない。   When the bus master 11 is a 32-bit processing CPU, the contents of the write buffer 12 are as shown in FIG. 4 when a single word write access is performed twice. In the first memory write access of the bus master 11, only the byte mask corresponding to Da0 among the byte masks corresponding to the written data Da0, Da1, Da2, and Da3 in FIG. ”, The value of the byte mask corresponding to Da0 to Da3 is“ 1 ”. Therefore, in the first memory write access of the bus master 11, the data of Da0 is to be written. On the other hand, the data Da1 to Da3 are output to the data bus, but are not written to the shared memory 20 due to the byte mask whose value is “1”.

また、バスマスタ11の2回目のライトアクセスでは、書き込みバッファ12の図4中の書き込まれたデータDb0、Db1、Db2、Db3にそれぞれ対応するバイトマスクのうち、Db1に対応するバイトマスクのみ値が「0」で、Db0、Db2、Db3に対応するバイトマスクの値は「1」である。従って、バスマスタ11の2回目のメモリ書き込みアクセスでは、図4中のDb1のデータを書き込もうとする。一方、データDb0およびDb2、Db3はバイトマスクによって共有メモリ20に書き込まれない。   In the second write access of the bus master 11, only the byte mask corresponding to Db1 among the byte masks corresponding to the written data Db0, Db1, Db2, and Db3 in FIG. “0”, the value of the byte mask corresponding to Db0, Db2, and Db3 is “1”. Therefore, in the second memory write access of the bus master 11, data of Db1 in FIG. 4 is to be written. On the other hand, the data Db0, Db2, and Db3 are not written to the shared memory 20 by the byte mask.

次に、本実施の形態のメモリアクセス方法による、共有メモリ20内のSDRAM22へのライトアクセス動作について、図5のタイミングチャートと共に説明する。本実施の形態のメモリアクセス方法では、BL(Burst Length)=1でSDRAM22を制御する。   Next, a write access operation to the SDRAM 22 in the shared memory 20 by the memory access method of the present embodiment will be described with reference to the timing chart of FIG. In the memory access method of the present embodiment, the SDRAM 22 is controlled with BL (Burst Length) = 1.

共有メモリコントローラ21は、まず図5(B)に示すように制御信号(Command)としてACTコマンドをSDRAM22に発行する。続いて、図5(A)に示すクロック(CLK)の3サイクル後に同図(B)に示すようにWRITEaコマンドを発行し、データDQには同図(D)に示すようにDa0を出力し、バイトマスクDQMには同図(C)に示すように0x0を出力する。   First, the shared memory controller 21 issues an ACT command to the SDRAM 22 as a control signal (Command) as shown in FIG. Subsequently, after three cycles of the clock (CLK) shown in FIG. 5A, a WRITEa command is issued as shown in FIG. 5B, and Da0 is output as data DQ as shown in FIG. 5D. , 0x0 is output to the byte mask DQM as shown in FIG.

そして、共有メモリコントローラ21は、1サイクル後には、従来方法では、DQMを0xFとしていたDa1〜Da3についてはWRITEコマンドを発行せず、図5(B)に示すようにWRITEbコマンドを発行し、DQにはDb1、DQMには0x0を出力する。   Then, after one cycle, the shared memory controller 21 does not issue a WRITE command for Da1 to Da3 in which DQM is set to 0xF in the conventional method, and issues a WRITEb command as shown in FIG. Db1 and 0x0 are output to DQM.

このように、図7に示したように従来方法でDQにDb0やDb2〜Db3を出力していたWRITEコマンドは発行しないので、図8に示したように従来方法で11サイクルかかっていた書き込み動作が、本実施の形態では、5サイクルで完了することができる。   Thus, since the WRITE command that outputs Db0 and Db2 to Db3 to DQ in the conventional method as shown in FIG. 7 is not issued, the write operation that took 11 cycles in the conventional method as shown in FIG. However, in this embodiment, it can be completed in 5 cycles.

このように、本実施の形態では、書き込みバッファ制御ユニット13に、書き込みバッファ12中のバイトマスクを用いてライトサイクル発行を制御する機能を設けることにより、書き込みバッファ12から共有メモリ20へのバースト転送動作において無駄なライトサイクルを防止することができる。   As described above, in the present embodiment, the write buffer control unit 13 is provided with a function for controlling the write cycle issuance using the byte mask in the write buffer 12, thereby performing burst transfer from the write buffer 12 to the shared memory 20. It is possible to prevent useless write cycles in operation.

ところで、あるバスマスタが共有メモリ20をメモリアクセスしている途中に、その他のバスマスタが共有メモリ20をメモリアクセスする準備が整った場合、その他のバスマスタは、現在行われているメモリアクセスが完了するまで、メモリアクセスが待たされる。   By the way, when another bus master is ready to access the shared memory 20 while a certain bus master is accessing the shared memory 20, the other bus masters complete the current memory access. Memory access is awaited.

すなわち、本実施の形態でも、図6のシーケンス図に示すように、バスマスタ11から共有メモリ20へデータのバースト転送が完了した後(ステップS21)、周辺バスマスタ30が共有メモリ20へデータのバースト転送を開始する(ステップS22)。しかし、本実施の形態では、バスマスタ11の共有メモリ20へのアクセスが最適化され、短縮された結果、周辺バスマスタ30の転送待ち時間が、図8に示した従来方法のT1から図6に示すT2に短縮される。   That is, also in this embodiment, as shown in the sequence diagram of FIG. 6, after the burst transfer of data from the bus master 11 to the shared memory 20 is completed (step S21), the peripheral bus master 30 performs the burst transfer of data to the shared memory 20. Is started (step S22). However, in this embodiment, as a result of optimization and shortening of access to the shared memory 20 of the bus master 11, the transfer waiting time of the peripheral bus master 30 is shown in FIG. 6 from T1 of the conventional method shown in FIG. Shortened to T2.

従って、本実施の形態によれば、バスマスタ11の共有メモリ20のメモリアクセス中に、周辺バスマスタ30がデータ転送する準備が整った場合には、周辺バスマスタ30は、従来方法に比べて早くデータ転送を開始することができるため、本実施の形態は、システム全体のメモリアクセス効率についても、向上させることができるといえる。   Therefore, according to the present embodiment, when the peripheral bus master 30 is ready to transfer data during memory access of the shared memory 20 of the bus master 11, the peripheral bus master 30 transfers data faster than the conventional method. Therefore, it can be said that this embodiment can also improve the memory access efficiency of the entire system.

本発明のメモリアクセス装置の一実施の形態のブロック図である。It is a block diagram of one embodiment of a memory access device of the present invention. 図1に示す装置の動作説明用フローチャートである。It is a flowchart for operation | movement description of the apparatus shown in FIG. 本発明装置におけるバスマスタから共有メモリへの書き込み動作の一例を示すシーケンス図である。It is a sequence diagram which shows an example of the write-in operation | movement from the bus master in this invention apparatus to shared memory. 本発明装置における書き込みバッファに格納されたデータの一例の構成図である。It is a block diagram of an example of the data stored in the write buffer in this invention apparatus. 本発明方法によって書き込みバッファのデータが共有メモリに書き込まれるときの一例の動作説明用タイミングチャートである。6 is a timing chart for explaining an example of operation when data in a write buffer is written into a shared memory by the method of the present invention. 本発明による周辺バスマスタも含めたメモリアクセス効率向上を表すシーケンス図である。It is a sequence diagram showing the memory access efficiency improvement including the peripheral bus master by this invention. 従来方法により書き込みバッファのデータが共有メモリに書き込まれるときの一例の動作説明用タイミングチャートである。10 is a timing chart for explaining an example of operation when data in a write buffer is written into a shared memory by a conventional method. 従来方法による周辺バスマスタも含めたメモリアクセスを表すシーケンス図である。It is a sequence diagram showing memory access including a peripheral bus master by a conventional method.

符号の説明Explanation of symbols

10 メモリアクセス装置
11 バスマスタ
12 書き込みバッファ
13 書き込みバッファ制御ユニット
14 レジスタ
15 セレクタ
20 共有メモリ
21 共有メモリコントローラ(SDRAMコントローラ)
22 SDRAM
30 周辺バスマスタ
40 共有バス
DESCRIPTION OF SYMBOLS 10 Memory access apparatus 11 Bus master 12 Write buffer 13 Write buffer control unit 14 Register 15 Selector 20 Shared memory 21 Shared memory controller (SDRAM controller)
22 SDRAM
30 Peripheral bus master 40 Shared bus

Claims (2)

共有バスを介して共有メモリにデータをバースト転送して書き込むメモリアクセス方法において、
バスマスタからデータ、バイトマスク、及びアドレスを書き込みバッファに一旦書き込む第1のステップと、
前記書き込みバッファに書き込まれたデータ及びアドレスを前記共有メモリにバースト転送する際に、転送するデータが、そのデータに対応する前記バイトマスクが全て設定されているデータであるか否かを判定する第2のステップと、
前記第2のステップにより、前記バイトマスクが全て設定されているデータではないと判定されたデータを選択して前記アドレスと共に前記共有バスを介して前記共有メモリへバースト転送する第3のステップと
を含むことを特徴とするメモリアクセス方法。
In a memory access method for writing data by burst transfer to a shared memory via a shared bus,
A first step of temporarily writing data, byte mask, and address from the bus master to the write buffer;
When burst-transferring the data and address written in the write buffer to the shared memory, it is determined whether the data to be transferred is data in which all the byte masks corresponding to the data are set. Two steps,
A third step of selecting data determined not to have all the byte masks set by the second step and transferring the burst together with the address to the shared memory via the shared bus; and A memory access method comprising:
共有バスを介して共有メモリにデータをバースト転送して書き込むメモリアクセス装置において、
データ、バイトマスク、及びアドレスを出力するバスマスタと、
前記バスマスタから出力された前記データ、バイトマスク、及びアドレスを一旦書き込む書き込みバッファと、
前記書き込みバッファに書き込まれたデータ及びアドレスを前記共有メモリにバースト転送する際に、転送するデータが、そのデータに対応する前記バイトマスクが全て設定されているデータであるか否かを判定する書き込みバッファ制御ユニットと、
前記書き込みバッファ制御ユニットにより、前記バイトマスクが全て設定されているデータではないと判定されたデータを選択して前記アドレスと共に前記共有バスを介して前記共有メモリへバースト転送する選択手段と
を有することを特徴とするメモリアクセス装置。
In a memory access device that writes data by burst transfer to a shared memory via a shared bus,
A bus master that outputs data, byte masks, and addresses;
A write buffer for temporarily writing the data, byte mask, and address output from the bus master;
When burst-transferring the data and address written in the write buffer to the shared memory, writing to determine whether the data to be transferred is data in which all the byte masks corresponding to the data are set A buffer control unit;
Selecting means for selecting, by the write buffer control unit, data that is determined not to have all the byte masks set therein, and burst-transferring the address together with the address to the shared memory via the shared bus; A memory access device.
JP2008057324A 2008-03-07 2008-03-07 Memory access method and memory access device Pending JP2009217310A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008057324A JP2009217310A (en) 2008-03-07 2008-03-07 Memory access method and memory access device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008057324A JP2009217310A (en) 2008-03-07 2008-03-07 Memory access method and memory access device

Publications (1)

Publication Number Publication Date
JP2009217310A true JP2009217310A (en) 2009-09-24

Family

ID=41189137

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008057324A Pending JP2009217310A (en) 2008-03-07 2008-03-07 Memory access method and memory access device

Country Status (1)

Country Link
JP (1) JP2009217310A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013097618A (en) * 2011-11-01 2013-05-20 Renesas Electronics Corp Memory control device
US10108568B2 (en) 2015-03-30 2018-10-23 Samsung Electronics Co., Ltd. Master capable of communicating with slave and system including the master

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013097618A (en) * 2011-11-01 2013-05-20 Renesas Electronics Corp Memory control device
US10108568B2 (en) 2015-03-30 2018-10-23 Samsung Electronics Co., Ltd. Master capable of communicating with slave and system including the master

Similar Documents

Publication Publication Date Title
JP5260511B2 (en) Dual port SRAM memory using single port memory cells
JP5103663B2 (en) Memory control device
US7380076B2 (en) Information processing apparatus and method of accessing memory
KR20040106303A (en) Memory system with burst length shorter than prefetch length
JP2003173676A (en) Semiconductor memory
JPH1031886A (en) Random access memory
JP2010015667A (en) Data transfer circuit and semiconductor memory device equipped with the same
JP4618758B2 (en) Method for driving quad data rate synchronous semiconductor memory device
JP4041358B2 (en) Semiconductor memory
US8069303B2 (en) Method and apparatus for controlling memory precharge operation
JPH0845277A (en) Semiconductor memory
US8793540B2 (en) Test apparatus and test method
JP2007087375A (en) Memory control system and memory control circuit
US7180822B2 (en) Semiconductor memory device without decreasing performance thereof even if refresh operation or word line changing operation occur during burst operation
US7239569B2 (en) Semiconductor memory device and memory system
JP2007141372A (en) Semiconductor memory apparatus
JP2009217310A (en) Memory access method and memory access device
JP4783501B2 (en) Semiconductor memory device
TW201730769A (en) Memory device
JP2004206850A (en) Semiconductor storage device
JP2002197864A (en) Multi-port memory and its control method
JP7199493B2 (en) Non-sequential page read
JP2005339659A (en) Semiconductor memory apparatus and its operating method
JPH10241360A (en) Semiconductor memory
JP4398066B2 (en) Memory control method, SDRAM control method, and memory system